Showing posts with label project. Show all posts
Showing posts with label project. Show all posts

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.

Thursday, June 23, 2011

Converting latitude and longitude to state plane feet

1. Access the "Project tool"

Click the Arc Toolbox window icon which looks like a small box with a red really-that's-supposed-to-be-a-toolbox icon in the center (for me, it's
directly under the "Customize" menu header, but that will depend on where you root your menus)

2. In the resulting Toolbox window, click Data Management Tools, then Projections and Transformations, then Feature, then Project (double click).

3. Select your input dataset, re-name your output dataset, and choose your output coordinate system


For example, I was projecting file Cases_2002, so I renamed my output
dataset "Cases_2002_proj" and chose "Predefined coordinate system", "Projected
coordinate systems", "State plane", "NAD 1983 (US Feet)", and my state of interest.prj file.



This adds the newly projected layer to your mxd file.

4. Next, open the attribute table of this projected layer, add a field type "Double" and name it "X_St_Pl_ft".

5. Right click the X_St_Pl_ft column and choose "Calculate Geometry".
Sometimes, I randomly encounter an error that I cannot utilize this function unless I'm in editor mode, even if I am in editor mode (enter editor mode by right clicking layer, selecting "Edit" then "Start editing"). When this happens, I save my project, shut it down, and restart ArcGIS 10, which fixes the problem.


6. Select Property: "X Coordinate of Point" and "Use coordinate system of the data source". Select Units: "Feet US [ft]"

7. Repeat for State Plane Y coordinate.

NOTE that if you performed a join on the original layer, the join may not transfer to the projected layer.