CodePlexProject Hosting for Open Source Software

After I got looking at the data, I didn't recognize the information that was being generated from the database. I was getting polygons like:

POLYGON ((1545347.5215454102 1529231.8526077271, 1545348.7315063477 1529231.9053649902, 1545349.9340820313 1529232.0163879395, ....

All the examples in the Google Maps API show that these coordinates need to be latitude and longitude numbers. So I started digging. In the xml file that is distributed with the city's data as an explanation of the data I found this section:

The map projection used is Transverse Mercator.

Projection parameters:

Scale

Longitude

Latitude

False_Easting: 1640416.666667

False_Northing: 0.000000

coordinates are encoded using coordinate pair

Abscissae (x-coordinates) are specified to the nearest 0.000651

Ordinates (y-coordinates) are specified to the nearest 0.000651

coordinates are specified in survey feet

The horizontal datum used is D

The ellipsoid used is Geodetic Reference System 80.

The semi-major axis of the ellipsoid used is 6378137.000000.

The flattening of the ellipsoid used is 1/298.257222.

Vertical

Altitude

Altitude_Resolution: 1.000000

Altitude

Explicit elevation coordinate included with horizontal coordinates

So I started looking at Transverse Mercator also called a Gauss-Kruger coordinate system. Turns out the most common one is Universal Transverse Mercator or UTM. This coordinate system is common on GPSs. It splits the whole world up into grids and the numbers generated are essential the number of units (meters, feet, etc) from the median line of the grid. However, our data is magic in that it doesn't use the Universal grids and median lines. It sets up it's own. So I try to find a calculator where I can specify what the where the grid starts. No luck. There are plenty of products that claim to do it, but most of them are closed source and charge money.

So I keep digging. Turns out, our numbers match up very nicely with a system called the State Plane Coordinate system. In fact our medians are exactly those of the New Mexico Central plane. Now we are cooking. I was finally able to track down an online calculator that would convert our data to latitude and longitude. We have to use the NAD83 datum, but our units are in survey feet. So we need to convert our survey feet to meters using the fraction 1200/3937.

So now we need to see if there is source code available for this calculator. Turns out there the source code is available. It's in FORTRAN. Lucky me. Now we get to port some FORTRAN code to C#. All in a days work.

Not sure how we should go about editing these docs but here goes. Found a guy who has an example of how to Convert State Plane coordinates to Lat/Long (WGS84) in ASP. I have a very rudimentary understanding of MATLAB scripting but found this Geodetic Toolbox which I think has some libraries we could use as jumping off points.

Last edited Mar 24, 2009 at 5:06 AM by ahsteele, version 1