Showing posts with label shapefiles. Show all posts
Showing posts with label shapefiles. 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.

Wednesday, July 27, 2011

Uploading files to ftp

This morning, an email requested that I upload sensitive files to a lab ftp. The email gave me the site, user name, and password, and nothing else.

If you ever find yourself in this position, may I suggest starting here:
Download the Client -- it's all you'll need to do a simple file transfer.

Next, hit this up:
The quick guide is both quick and easy to understand.

One big headache I have not been able to overcome is the size limitations on transferred files. I'm trying to upload multiple shapefiles with over 3K records and 20+ fields... anyone out there have a workaround short of breaking up the shapefiles in ArcGIS???

Friday, May 6, 2011

Joining insanity in ArcGIS 10, Excel 2010

Problem: I haven't been able to join the Excel file that contains demographic data by census tract to the census tract shape file.

My specific issue is that when I open the Join window, the joinable field names are not selectable... if the CT shapefile field name is selected, the corresponding field name in the Excel file is not available to select, and vice versa.

I downloaded both sets of info from the census website... so why the technical trubs???

After renaming, resaving, repopulating, and refilling my beer, I finally thought to check the field properties for my problem fields in both layers (open attribute table, highlight column of interest, right click column heading, select "Properties", check "Type"). Surprise! My field of interest in my shapefile layer is type "string", while the corresponding field of interest in my Excel file layer is type "double".

Solution: I created a same-type field to complete the join.

Since I couldn't seem to add a string type field to the Excel layer in ArcGIS, I ended up adding a double type field to the shapefile layer: Open attribute table, select "Add field...", named it "GeoId10d" and type "double" leaving the default for precision and scale. Then I started Editor (button that looks like a pencil connecting the dots), selected the appropriate layer to edit, opened the attribute table, right clicked on my new GeoID10d column, selected "Field Calculator" and just double clicked the "GeoID10" column (telling ArcGIS that GeoID10d = [GeoId10]... in English, setting the new GeoID10d column to copy the values from the old GeoID10 column and store those values as type double).

Once I had a matching type field, the join worked! Horray!

Wednesday, May 4, 2011

Merging census data with Tiger shapefiles

The US census makes it easy with this nifty step-by-step guide:

http://www.census.gov/geo/www/tiger/wwtl/brochures/DownloadingAFFData.pdf

More helpful resources here:
http://www.census.gov/geo/www/tiger/wwtl/wwtl.html

Although I have to wonder why they didn't just integrate the datasets (shapefiles and demographic data) in a more user friendly format to begin with...

Monday, April 11, 2011

Why census block groups?

From http://www.census.gov/geo/www/cob/bg_metadata.html:

"A census block group (BG) is a cluster of census blocks having the same first digit of their four-digit identifying numbers within a census tract. For example, block group 3 (BG 3) within a census tract includes all blocks numbered from 3000 to 3999. BGs generally contain between 600 and 3,000 people, with an optimum size of 1,500 people. Most BGs were delineated by local participants as part of the U.S. Census Bureau's Participant Statistical Areas Program.

BGs never cross the boundaries of states, counties, or statistically equivalent entities, except for a BG delineated by American Indian tribal authorities, and then only when tabulated within the American Indian hierarchy... BGs never cross the boundaries of census tracts."

Baltimore stats and maps

The Baltimore Neighborhood Indicators Alliance offers some great resources online.

Start with the neighborhood profiles at http://www.bniajfi.org/neighborhood_data. Of course, the 'hood you think you live in may not be the official name (i.e. there is no "East Baltimore" Community Statistical Area), so click "Choose your Community Statistical Area" under the map at the upper left of the page then and click a CSA on the resulting map. This will show you a map with the boundaries to that CSA. Repeat until you find your CSA of interest, then return to the neighborhood data page to get the stats.

The neighborhood data page has 3 sections. The first section lists the Community Statistical Area (CSA) Profiles. The individual CSAs link you to PDFs that include vital signs from the 2000 census, housing & community development stats, children and family stats, crime, workforce & economic development, sanitation facts (including the rate of rat incidents... RAT CZAR!), environment & transit data, education stats, and community action info like voting rates. Example here.

The second section on the neighborhood data page is a link to downloadable shapefiles (GIS Shapefiles page at http://www.bniajfi.org/map_gallery/gis_shapefiles). These shapefiles include Community Statistical Areas (CSAs), Neighborhood Statistical Areas (NSAs), Inner Harbor, Baltimore City Public Schools (2010-2011 School Year), Farmers' Markets, Enoch Pratt Libraries, Senior Centers, Recreation Centers, Block Groups, Census Tracts, and Zip Codes. This page also directs you to important links through the "Related Resources" right side bar, including US census maps and cartographic resources, GIS resources at the Maryland State Data Center, maps from the Baltimore City Planning Department, and National Atlas shapefiles.

The last section on the neighborhood data page include the Neighborhood Statistical Area (NSA) Profiles. The data varies for neighborhoods. For example, the Canton link simply returns a map of the Canton CSA (which includes the large section of Patterson Park but not, oddly, the small section... curious), while the link for East Baltimore Midway returns a PDF with stat summary data on demographic, social, economic, and housing characteristics from the 2000 census (check it).