Thursday, June 13, 2013

Show & Tell for Module 5

In this "Show & Tell" session, I'll show you some useful things that were not included in  LAD module 5.

If you'd like you can try these yourself. The data is included in the Challenge5 zip file which you can download and unzip. Here are the notes to re-create what I show you.


Open "DiamondHead.mxd" in the Challenge5 folder.

Use Notepad to open the "traps.txt" file in Challenge5\data\Honolulu.

Note that the first row contains field names separated by commas and the rest of the rows contain the data. This is data for mouse traps set by the Department of Health around the Hawaii National Guard buildings inside Diamond Head. The data includes the type of trap, how many mice were caught and how many tested positive for Hanta virus. The last two fields were collected using GPS and are the X and Y coordinates (in longitude and latitude) for each trap. Please note - this is not actual data, I made it up for this exercise.

So how can you add this text file to your map as a set of points? Here's how:

Add the text file to your map. You'll see the table added in the Table of Contents but not on the map. Open the attribute table and look at the fields - they are named from the txt file and all the data is there along with the Xcoord and Ycoord fields.

Right click on the table and select "Display XY Data..." which opens up a new window. If the X and Y coordinate fields are not correctly identified, use the pulldown to select the correct fields. For the "Coordinate System of Input Coordinates", in this case these are GPS coordinates in WGS84 longitude and latitude. Click "Edit" and select the GCS/World/WGS84. It is important that you identify the coordinate system - ALWAYS DO THIS! Your window should look like this, click "OK":

The data has been added as features. You can now symbolize and label these features just like any other feature class.

You can also export the text data features into a shapefile or geodatabase feature class. Right click on the text feature layer, click "Export Data...".


Photos you take with your smartphone and many newer digital cameras save the GPS coordinates of the location you were in when you took the photo. ArcMap has a tool to automatically these geotagged photos to ArcMap. Here's how:

Open "Africa.mxd" in the Challenge5 folder.

Last summer I visited my sister-in-law in Tanzania and we trekked around Kilimanjaro. Using File Manager, open the Challenge5\data\Africa\pics folder and right click on one of the photos and click properties. Click the Details tab and scroll down until you see the GPS section where the coordinates are stored.

These are the coordinates that ArcMap will use to locate the photos. Go back to ArcMap, open ArcToolbox, click "Data Management Tools", click "Photos", click "GeoTagged Photos To Points".

For the Input Folder, point to the pics folder. You can use the default Output Feature Class location. Click "OK". The tool will run in the background, it may take a couple of minutes, but when it's done it will notify you and add the points to the map. They may be hard to see so change the symbol to a camera symbol.

The tool also has configured the features HTML Popup properties. Use the HTML Popup tool and click on each feature.

The windows will stay open and you can move them around. Here's an example:


There are times when you have a scanned image of an old map, or maybe some old air photos, that you'd like to add as a layer in your map. To do this you need to move the image into a coordinate system. Here's how to do that:

Open "Kauai.mxd" in the Challenge5 folder. These are parcels on Kauai.

Open the Challenge5\data\Kauai\413001.tif image. This is a plat map that is used to record property information. Right now it is not in a coordinate system. Go ahead and add the image to ArcMap. If ArcMap asks if you want to build pyramids, say "yes". You can right click on the image and then click "Zoom to Layer". Note what the map looks like.

Use the "Return to previous Extent" button to go back to the parcels. Zoom in to the same area in parcels that the plat map covers. Change the symbology of the parcels to have no color inside and a wide colored outline.

Open the Georeferencing Toolbar.

Under the Georeferencing pulldown, click "Fit to Display".

Now comes the hardest part. Scan the image and the map to find the same exact spot on both. Once you have found a spot, click the "Add Control Points" tool and do two clicks. The first click is the spot on the image, the second click is on the exact same spot on the map.

After you do the second click, the image will be moved so that the two points line up.

Now add a second control point in a different part of the image. Again, find the same spot on both the image and the map, click the image spot first, then the map spot. Always click the image first, then the map. After the second click, it's almost like magic how things line up.

Now that the image and the map are roughly aligned, you can zoom in and more carefully add two more control points.  Add them in opposite parts of the maps, think about legs on a table, try to choose points near the four corners.  Once you have added the third and fourth points, you might want to delete the first two and go back, zoom in, and add them more carefully.

Once you image and map are lined up with four (or more) control points, you can permanently save your work by clicking the Georeferencing pulldown and "Update Georeferencing".  This will write a world file in the same folder as the tif image.

No comments:

Post a Comment