Thursday, October 20, 2011

Adding coordinate data to a shapefile and lining up your layers

...or, Why is Maryland floating out in the Atlantic Ocean?

If you find that one (or more) of your layers aren't lining up in your mxd file, it's probably a problem with the geographic and/or projection coordinate systems. Your layers need to be projected in the same system. You can check the projections by right clicking the layer in the table of contents, selecting "properties", and looking at the information listed for both Projected Coordinate System and (by scrolling down) Geographic Coordinate System.

If you need to re-project a layer, see this post (steps 1 - 3) on how to. Remember to add your newly projected layer to your mxd file, and remove your "floating in the ocean" layer.

A problem arises if you have a shapefile that lacks coordinate data. You just can't re-project something that hasn't been projected yet.

For example, the 2000 census zip code shapefiles (available here) lack a coordinate system. When you download the zip file, it does not include the projection (.prj) file for the shapefile. Adding this layer will result in the zip code layer floating in the ocean.

To add a coordinate system, open Arc Catalog (not just the shortcut thru ArcMap). Select the shapefile that corresponds to the layer that is missing the coordinate data by double clicking it in the table of contents so you get a popup window. In this window, go to the XY Coordinate System tab, and click "select" to select a pre-defined coordinate system. Chose the appropriate coordinate system, click "add", and then "ok".

Re-add the layer to your mxd file. Check the properties to make sure the coordinate system has been updated. If the layer is still out of line with the other layers on your map, go through the re-projection steps described above.

No comments:

Post a Comment