Difference between revisions of "Retrieving Geocoordinates From Points In Images"
From reBiND Documentation
(description of the process) |
(Images added) |
||
Line 2: | Line 2: | ||
The source image we use, shows six locations in the western part of Nicaragua. Though the image is of poor quality, luckily the lines for latitude and longitude are visible in the picture. | The source image we use, shows six locations in the western part of Nicaragua. Though the image is of poor quality, luckily the lines for latitude and longitude are visible in the picture. | ||
− | + | [[File:JOSM Mapping 00 Original Image.png|frame|none|The Source Image with six locations marked with circled dots]] | |
To start download the program JOSM from [http://josm.openstreetmap.de/ http://josm.openstreetmap.de/]. JOSM is a Java based Editor for [http://www.oepnstreetmap.org OpenStreetMap]. | To start download the program JOSM from [http://josm.openstreetmap.de/ http://josm.openstreetmap.de/]. JOSM is a Java based Editor for [http://www.oepnstreetmap.org OpenStreetMap]. | ||
− | + | [[File:JOSM Mapping 01 Initial Window.png|frame|none|The Initial Screen of JOSM]] | |
== Download PicLayer Plugin == | == Download PicLayer Plugin == | ||
* Start JOSM | * Start JOSM | ||
Line 13: | Line 13: | ||
* Check the checkbox for the PicLayer plugin | * Check the checkbox for the PicLayer plugin | ||
* Click OK and restart JOSM | * Click OK and restart JOSM | ||
+ | [[File:JOSM Mapping 02 Preferences Plugins.png|frame|none|Selecting the PicLayer Plugin]] | ||
== Select the OpenStreetMap Image Layer == | == Select the OpenStreetMap Image Layer == | ||
Line 24: | Line 25: | ||
* Switch to the drawing tool by pressing '''A''' | * Switch to the drawing tool by pressing '''A''' | ||
* Connect the four points to a rectangle. | * Connect the four points to a rectangle. | ||
+ | [[File:JOSM Mapping 03 Grid Rectangle.png|frame|none|The rectangle on the map]] | ||
== Loading the reference image == | == Loading the reference image == | ||
Line 29: | Line 31: | ||
* Select the prepared image. | * Select the prepared image. | ||
* The Picture Layer may be displayed below the OpenStreetMap Layer. If so, move it up in the Layers Box, so that the image becomes visible. | * The Picture Layer may be displayed below the OpenStreetMap Layer. If so, move it up in the Layers Box, so that the image becomes visible. | ||
+ | [[File:JOSM Mapping 04 Image Loaded.png|frame|none|The image loaded as a PicLayer]] | ||
* Also make the Picture Layer the active layer, by clicking on the third button in the Layers Box Toolbar, when the Picture Layer is selected. By doing so, the tools for calibrating the picture will become visible in the toolbar at the left side. | * Also make the Picture Layer the active layer, by clicking on the third button in the Layers Box Toolbar, when the Picture Layer is selected. By doing so, the tools for calibrating the picture will become visible in the toolbar at the left side. | ||
+ | [[File:JOSM Mapping 05 Image Layer Selected.png|frame|none|The image layer is now the selected layer]] | ||
== Calibrating the reference image == | == Calibrating the reference image == | ||
Line 36: | Line 40: | ||
* If you now make the image layer semi-transparent, you can see how the image aligns with the map. | * If you now make the image layer semi-transparent, you can see how the image aligns with the map. | ||
* If you do not have the latitude and longitude lines, you should make the image layer semi transparent and try to align distinct points in the image with the map. | * If you do not have the latitude and longitude lines, you should make the image layer semi transparent and try to align distinct points in the image with the map. | ||
+ | |||
+ | [[File:JOSM Mapping 06 Image Layer Calibrated.png|frame|none|The image is now calibrated. The gray arrows of the rectangle of the data layer are now over the grid lines in the image.]] | ||
+ | [[File:JOSM Mapping 07 Image Layer Semi-Transparent.png|frame|none|Setting the image layer as semi transparent.]] | ||
== Mapping the points in the image == | == Mapping the points in the image == | ||
Line 42: | Line 49: | ||
* Draw points on the positions of the image from which you want to know the coordinates. | * Draw points on the positions of the image from which you want to know the coordinates. | ||
* If there are several points, you should add a name for each point in the Properties Box on the right. | * If there are several points, you should add a name for each point in the Properties Box on the right. | ||
+ | [[File:JOSM Mapping 08 Points Mapped And Named.png|frame|none|Mapping the points. They are visible as the light small rectangles in the black dots on the image.]] | ||
* After all the points are mapped, right-click on the new data layer and select '''Save As ...''' and save it as XML file on your local file system. | * After all the points are mapped, right-click on the new data layer and select '''Save As ...''' and save it as XML file on your local file system. | ||
+ | [[File:JOSM Mapping 09 Exporting Points.png|frame|none|Exporting the mapped points.]] | ||
* The file contains the coordinates of the selected points for further processing. | * The file contains the coordinates of the selected points for further processing. | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> |
Revision as of 17:03, 24 July 2012
This manual will show how to get the geocoordinates from points in an image.
The source image we use, shows six locations in the western part of Nicaragua. Though the image is of poor quality, luckily the lines for latitude and longitude are visible in the picture.
To start download the program JOSM from http://josm.openstreetmap.de/. JOSM is a Java based Editor for OpenStreetMap.
Contents
Download PicLayer Plugin
- Start JOSM
- Press F12 to get to the Preferences Window
- Go to the Plugin-Tab
- Click on Download List
- Search for PicLayer
- Check the checkbox for the PicLayer plugin
- Click OK and restart JOSM
Select the OpenStreetMap Image Layer
- Go on Imagery and select OpenStreetMap (Mapnik)
- navigate to the area of interest
Draw a reference rectangle
This step can be skipped if the image does not show the lines for latitude and longitude, like the example image above does.
- Open a new Data Layer by pressing Ctrl + N
- Insert a new Point by pressing Shift + D and entering its coordinates and press OK. In this example we start with 13.0 -87.0. Repeat for the other points as well: 12.0 -87,0; 12.0 -86,0 and 13.0 -86,0.
- Switch to the drawing tool by pressing A
- Connect the four points to a rectangle.
Loading the reference image
- In the Menu go on PicLayer and select New picture layer from file ...
- Select the prepared image.
- The Picture Layer may be displayed below the OpenStreetMap Layer. If so, move it up in the Layers Box, so that the image becomes visible.
- Also make the Picture Layer the active layer, by clicking on the third button in the Layers Box Toolbar, when the Picture Layer is selected. By doing so, the tools for calibrating the picture will become visible in the toolbar at the left side.
Calibrating the reference image
- Click on the button with the green arrow to add three reference points on the image, each on one of the confluence points (where the latitude and longitude lines cross).
- Click on the button with the red arrow to move the reference points until they align with the corners of the rectangle.
- If you now make the image layer semi-transparent, you can see how the image aligns with the map.
- If you do not have the latitude and longitude lines, you should make the image layer semi transparent and try to align distinct points in the image with the map.
Mapping the points in the image
- Open a new data layer by pressing Ctrl + N
- Select the drawing tool by pressing A
- Draw points on the positions of the image from which you want to know the coordinates.
- If there are several points, you should add a name for each point in the Properties Box on the right.
- After all the points are mapped, right-click on the new data layer and select Save As ... and save it as XML file on your local file system.
- The file contains the coordinates of the selected points for further processing.
<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' upload='true' generator='JOSM'>
<node id='-95' action='modify' visible='true' lat='12.881180287556537' lon='-86.11194760698338'>
<tag k='name' v='1' />
</node>
<node id='-94' action='modify' visible='true' lat='12.79249813630681' lon='-86.10761639569195'>
<tag k='name' v='2' />
</node>
<node id='-93' action='modify' visible='true' lat='12.403621057420668' lon='-86.22455910056097'>
<tag k='name' v='3' />
</node>
<node id='-92' action='modify' visible='true' lat='12.084582576302516' lon='-86.11790302250911'>
<tag k='name' v='6' />
</node>
<node id='-91' action='modify' visible='true' lat='12.20261349095152' lon='-86.46277572159048'>
<tag k='name' v='5' />
</node>
<node id='-90' action='modify' visible='true' lat='12.40062989709886' lon='-86.83219726377988'>
<tag k='name' v='4' />
</node>
</osm>
Closing JOSM
- Close JOSM. WARNING: When you try to close JOSM, it will ask you if you want to upload the two data layers to OpenStreetMap and selects these options for you. DO NOT UPLOAD THE DATA! Click on Exit Now.
- JOSM will then ask if the calibration file for the image should be saved. You can do so, if you want to. It will be stored in the same directory as the image. The next time you select the image to be used by PicLayer it will detect this file and put the image in the correct position.