Determining the SRID when you only have the name of the coordinate system
It's best when a dataset just gives you coordinates in WSG84 (SRID: 4326), but it's not the end of the world if they use a different coordinate system. To transform their coordinates to latitude and longitude, you just need to know the SRID of their coordinate system.
Unfortunately, your contact person for the dataset might not know the SRID. But if she knows the name of the coordinate system then there's still a way for you to obtain the SRID. The following is how I do it.
1. Get some reference points in their coordinate system. These are points for which you know the equivalent latitude and longitude coordinates. This is usually trivial, because most datasets have an address field. To get the latitude and longitude, you can use Google Maps: search for an address, and, on the result page, right-click the red pin and select "What's here?". The latitude and longitude will appear in the search bar.
2. Do a search on spatialreference.org. Entering all the keywords sometimes gives you nothing, because the actual name in their database will be spelled slightly differently than you expect, and their search engine only does exact matches. Pick the most important keyword and search on that first. You may get too many results, but from there you can start winnowing them down.
3. Write a program to try out all possible SRIDs. You might end up with several possible SRIDs. You are unlikely to be able to guess the correct one by reading their descriptions. Instead, write a simple program using GeoDjango to determine the most likely SRID. Here is an example:
from django.contrib.gis.geos import Point # Reference point. Note that the x coordinate comes first. COORDINATES = (397162, 140182) # Reference address: 3100 - 3299 BLOCK OF 14TH STREET NW, dc # Reference latitude, longitude from Google Maps: 38.929527,-77.032734 # Candidate SRIDs from spatialreference.org. At least one of them is right. SRIDS = [2248, 2804, 2893, 3559, 3583, 6620, 6654, 7058, 26785, 26985, 102285, 102685] for srid in SRIDS: pt = Point(*COORDINATES, srid=srid) try: pt.transform(4326) print '{}: {}, {}'.format(srid, pt.y, pt.x) except Exception: pass
The output will look something like this:
2248: 38.0078526925, -80.1766510551 2804: 38.9295130132, -77.0327305535 2893: 38.0078526925, -80.1766510551 3559: 38.9295130132, -77.0327305535 3583: 42.255458399, -71.7461411817 ERROR 6: EPSG PCS/GCS code 6620 not found in EPSG support files. Is this a valid EPSG coordinate system? ERROR 6: EPSG PCS/GCS code 6654 not found in EPSG support files. Is this a valid EPSG coordinate system? ERROR 6: EPSG PCS/GCS code 7058 not found in EPSG support files. Is this a valid EPSG coordinate system? 26785: 38.2098999912, -78.4016791905 26985: 38.9295130132, -77.0327305535 102285: 38.9295130132, -77.0327305535 102685: 38.0078526924, -80.1766510563
Note that there is more than one SRID that produces coordinates close to what we expect from the reference point. Just pick the lowest-numbered one (in this case, 2804). Just to be sure, plug the coordinates generated by your program into Google Maps to make sure that they really are close to the reference address.