Tuesday, April 25, 2006

Shapefile Coordinate Systems and Google Maps

While I worked for the town parks and rec. committee, I met the GIS consultant who did the town's mapping. I realized he could give me an ArcView shapfile of the trails and bike routes to put on my Google Maps mashup. I used shp2text which is a handy utility to convert shapfiles into either xml, gpx, or csv that I could then load into MySQL.

Problem. Once converted, I could tell the data points for the lines were not right. I knew what the long/lat coordinates were for points in the town and none of these matched from the shapefile dump. Looking back at my email from the GIS guy, he said the shapefile was "coordinate base is Colorado State Plane, Central Zone, NAD1983, Feet" Googling around for info on coordinate systems pointed out that of course the ArcView export was CO state. The Google Maps API expects WGS84 longitude/latitude coordinates.

Lucky for me my friend could easily produce a new shapefile export with the WGS84 coordinates. You can see an example of the GPolyline from the shapefile by clicking on "Show Bike Routes" on the map.

No comments: