[PROJ] On Looking Up ESRI WKIDs

Peter Townsend peter.townsend at maplarge.com
Wed Apr 27 06:11:00 PDT 2022


Thanks! That's an interesting link. It led me to thinking of trying
something like this:
1) Go fetch a flat file from the repo at
https://github.com/Esri/projection-engine-db-doc (CSV, JSON, whatever)
2) Parse it out and create essentially a static set of lookup
tables/dictionaries. Match wkid/latestWkid to an authority field.

Something like wkid 20002 looks up in PROJ as ESRI:20002.

{ "wkid": 20002,
    "latestWkid": 20002,
    "macro": "PE_PCS_PULKOVO_1995_GK_2",
    "name": "Pulkovo_1995_GK_Zone_2",
    "wkt": "PROJCS[\"Pulkovo_1995_GK_Zone_2\",GEOGCS[\"GCS_Pulkovo_1995\",DATUM[\"D_Pulkovo_1995\",SPHEROID[\"Krasovsky_1940\",6378245.0,298.3]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Gauss_Kruger\"],PARAMETER[\"False_Easting\",2500000.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",9.0],PARAMETER[\"Scale_Factor\",1.0],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0]]",
    "wkt2": "PROJCRS[\"Pulkovo_1995_GK_Zone_2\",BASEGEOGCRS[\"GCS_Pulkovo_1995\",DATUM[\"D_Pulkovo_1995\",ELLIPSOID[\"Krasovsky_1940\",6378245.0,298.3,LENGTHUNIT[\"Meter\",1.0]]],PRIMEM[\"Greenwich\",0.0,ANGLEUNIT[\"Degree\",0.0174532925199433]],CS[ellipsoidal,2],AXIS[\"Latitude
(lat)\",north,ORDER[1]],AXIS[\"Longitude
(lon)\",east,ORDER[2]],ANGLEUNIT[\"Degree\",0.0174532925199433]],CONVERSION[\"Gauss_Kruger\",METHOD[\"Gauss_Kruger\"],PARAMETER[\"False_Easting\",2500000.0,LENGTHUNIT[\"Meter\",1.0]],PARAMETER[\"False_Northing\",0.0,LENGTHUNIT[\"Meter\",1.0]],PARAMETER[\"Central_Meridian\",9.0,ANGLEUNIT[\"Degree\",0.0174532925199433]],PARAMETER[\"Scale_Factor\",1.0,SCALEUNIT[\"Unity\",1.0]],PARAMETER[\"Latitude_Of_Origin\",0.0,ANGLEUNIT[\"Degree\",0.0174532925199433]]],CS[Cartesian,2],AXIS[\"Easting
(X)\",east,ORDER[1]],AXIS[\"Northing
(Y)\",north,ORDER[2]],LENGTHUNIT[\"Meter\",1.0]]",
    "description": "Pulkovo 1995 GK Zone 2",
    "authority": "Esri",
    "version": "8.0.1",
    "deprecated": "no",
    "areaname": "Europe - 6~E to 12~E and Pulkovo by country",
    "extent":
    { "slat": 50.21,
      "nlat": 54.18,
      "llon": 9.93,
      "rlon": 12.0
    }
  },


But I did run into a bit of a counterexample with 9712. In PROJ it doesn't
look up under ESRI:9712 but as ESPG:9712, despite the authority value being
"Esri". I wonder if it's just an error on account of the ESRI docs not
updating their field, or maybe something with how PROJ imports its ESRI
values (I'm not familiar with that process myself as it might use some
other data source?).

{ "wkid": 9712,
    "latestWkid": 9712,
    "macro": "PE_PCS_NAD83_UTM_24N",
    "name": "NAD_1983_UTM_Zone_24N",
    "wkt": "PROJCS[\"NAD_1983_UTM_Zone_24N\",GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137.0,298.257222101]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",500000.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-39.0],PARAMETER[\"Scale_Factor\",0.9996],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0]]",
    "wkt2": "PROJCRS[\"NAD_1983_UTM_Zone_24N\",BASEGEOGCRS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",ELLIPSOID[\"GRS_1980\",6378137.0,298.257222101,LENGTHUNIT[\"Meter\",1.0]]],PRIMEM[\"Greenwich\",0.0,ANGLEUNIT[\"Degree\",0.0174532925199433]],CS[ellipsoidal,2],AXIS[\"Latitude
(lat)\",north,ORDER[1]],AXIS[\"Longitude
(lon)\",east,ORDER[2]],ANGLEUNIT[\"Degree\",0.0174532925199433]],CONVERSION[\"Transverse_Mercator\",METHOD[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",500000.0,LENGTHUNIT[\"Meter\",1.0]],PARAMETER[\"False_Northing\",0.0,LENGTHUNIT[\"Meter\",1.0]],PARAMETER[\"Central_Meridian\",-39.0,ANGLEUNIT[\"Degree\",0.0174532925199433]],PARAMETER[\"Scale_Factor\",0.9996,SCALEUNIT[\"Unity\",1.0]],PARAMETER[\"Latitude_Of_Origin\",0.0,ANGLEUNIT[\"Degree\",0.0174532925199433]]],CS[Cartesian,2],AXIS[\"Easting
(X)\",east,ORDER[1]],AXIS[\"Northing
(Y)\",north,ORDER[2]],LENGTHUNIT[\"Meter\",1.0]]",
    "description": "NAD 1983 UTM Zone 24N",
    "authority": "Esri",
    "version": "12.9.0",
    "deprecated": "no",
    "areaname": "Canada - east of 42~W",
    "extent":
    { "slat": 45.53,
      "nlat": 49.53,
      "llon": -42.0,
      "rlon": -40.73
    }
  },

With the existence of the counterexample, trying ESRI:CODE or
ESPG:CODE and hoping for the best still remains a viable option.
Though the ESRI data dump DOES provide the WKT as an alternative to
the lookup method too!


On Wed, Apr 27, 2022 at 1:32 AM Javier Jimenez Shaw <j1 at jimenezshaw.com>
wrote:

> Hi Peter
>
> Looking at
> https://jjimenezshaw.github.io/crs-explorer/?ignoreWorld=false&allowDeprecated=false&authorities=ESRI&activeTypes=PROJECTED_CRS,GEOGRAPHIC_2D_CRS,GEOGRAPHIC_3D_CRS,GEOCENTRIC_CRS,GEODETIC_CRS,VERTICAL_CRS,COMPOUND_CRS,CRS
> You can see there are some of them below 32767 (allow deprecated to get
> some more)
>
> In this other project
> https://jjimenezshaw.github.io/Esri-codes-analyzer/not-deprecated-esri.html
> the data from ESRI is listed. See the GitHub repo to see from where is it
> getting the data (PROJ is using the same source). Maybe you can get more
> useful information there.
>
> Cheers,
> Javier
> .___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
> Entre dos pensamientos racionales
> hay infinitos pensamientos irracionales.
>
>
>
> On Wed, 27 Apr 2022 at 00:21, Peter Townsend via PROJ <
> proj at lists.osgeo.org> wrote:
>
>> Greetings! I'm going to be responding to calls to a FeatureServer and it
>> gives me back a response that looks like this:
>>
>> {
>>   "objectIdFieldName": "objectid",
>>   "globalIdFieldName": "",
>>   "geometryType": "esriGeometryPoint",
>>   "spatialReference": {
>>     "wkid": 26949,
>>     "latestWkid": 26949
>>   },
>>   "fields": [
>>     {
>>       "name": "objectid",
>>       "alias": "OBJECTID",
>>       "type": "esriFieldTypeOID"
>>     },
>>     ...
>>   ],
>>   "features": [
>>     {
>>       "attributes": {
>>         "objectid": 1,
>>         "cities_lam": 25552,
>>         "cities_l_1": 25552,
>>         "citiesx020": 25552,
>>         "feature": "Populated Place",
>>         "name": "Harris",
>>         "pop_range_": "Undetermined",
>>         "pop_90": -99999,
>>         "pop_98": -99999,
>>         "fips55": "31320",
>>         "county": "Mohave County",
>>         "fips": "04015",
>>         "state": "AZ",
>>         "state_fips": "04",
>>         "display": 0
>>       },
>>       "geometry": {
>>         "x": 15704.363599999808,
>>         "y": 460919.1546
>>       }
>>     },
>>     ...
>>   ]
>> }
>>
>> It's obviously ESRI related. The problem is the "wkid"/"latestWkid"
>> field. We'd like to turn that into a PROJ CRS lookup. In the case of 26949,
>> it turns out to match up nicely to EPSG:26949, aka "NAD83 / Arizona
>> Central". In the ARCGIS docs, it has the name
>> "NAD_1983_StatePlane_Arizona_Central_FIPS_0202". A PROJ CRS lookup by that
>> name also returns EPSG:26949.
>>
>> But then consider WKID 102649. It's outside of the EPSG code range,
>> right? So EPSG:102649 doesn't turn up anything. But it is findable under
>> ESRI:102649, with the name
>> "NAD_1983_StatePlane_Arizona_Central_FIPS_0202_Feet".
>>
>> My question is thus, is it safe to assume that if I encounter an ESRI
>> wkid greater than 32767 that I should try looking it up with the ESRI
>> authority? And less than or equal, that it is the same as the EPSG code?
>>
>> A quick search through the list history found me a semi-related question
>> from 11 years ago that kind of implies this, so it wouldn't hurt to ask
>> again.
>>
>> --
>> Peter Townsend
>> Senior Software Developer
>> _______________________________________________
>> PROJ mailing list
>> PROJ at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/proj
>>
>

-- 
Peter Townsend
Senior Software Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20220427/901e90a1/attachment-0001.html>


More information about the PROJ mailing list