11

I have JSON generated from ArcGIS that I want to convert to GeoJSON in EPSG 4326. This fails:

$ ogr2ogr -f GeoJSON -t_srs EPSG:4326 out.geo.json in.arcgis.json OGRGeoJSON
ERROR 6: EPSG PCS/GCS code 102100 not found in EPSG support files.  Is this a valid
EPSG coordinate system?

I found a forum post that says 102100 can be changed to 3857, which is mathematically identical. So, this works, with the same error message:

$ ogr2ogr -f GeoJSON -s_srs EPSG:3857 -t_srs EPSG:4326 out.geo.json in.arcgis.json OGRGeoJSON 
ERROR 6: EPSG PCS/GCS code 102100 not found in EPSG support files.  Is this a valid
EPSG coordinate system?

However, I have several files in the 102100 projection system. I'd like to teach ogr2ogr about the 102100 projection, so I can script the conversion. Is there a way to update the config so that 102100 is recognized and treated the same as 3857?

Update - This data is from the REST API of ArgGIS Server 9.3.1. If I don't specify an output spatial reference, then I get 102100, which they define as the projected coordinate system "WGS_1984_Web_Mercator_Auxiliary_Sphere". A much easier way to accomplish my goal is to ask for the desired projection, with the outSR=4326 query parameter. The question is still valid if you don't have access to original data.

11

As 102100 and 3857 are mathematically identical, I think you can safely ignore the errors and just continue with overriding the source srs using the -s_srs flag.

You can try adding the definition for 102100 in your $GDAL_DATA$ but it's not really recommended. If you really want to do it though, here's the method and the accompanying warning from Frank Warmerdam:

The .csv files are primarily intended for EPSG coordinate systems, so it isn't really appropriate to extend them manually.

But you can add your own custom dictionaries in a manner similar to gdal/data/cubewerx_extra.wkt. These dictionary files consist of lines with a short name, a comma and then the WKT definition of the coordinate system.

You can reference such a definition from SetFromUserInput() and programs that use that function (such as s_srs, a_srs, t_srs for gdal_translate, ogr2ogr and gdalwarp) using the form:

gdal_translate -a_srs DICT:cubewerx_extra.wkt,41001

I hope this helps. Good luck!

  • 1
    Thanks, I did something similar to what you suggested. My $GDAL_DATA$ directory is at /usr/local/share/gdal, and EPSG 3857 is defined in pcs.csv in that folder. I copied that line to pcs.override.csv, and changed the ID (first column) from 3857 to 102100. At that point, conversions worked without the -s_srs flag. The longer-term solution was to get my source data in a known projection, so that I could use ogr2ogr for format conversion alone, rather than mix in projections. – jwhitlock Mar 12 '14 at 21:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.