[PROJ] CRS JSON
Even Rouault
even.rouault at spatialys.com
Fri Aug 9 10:07:51 PDT 2019
On lundi 8 juillet 2019 12:57:16 CEST Even Rouault wrote:
> Hi,
>
> following a recent Tweeter discussion, I've taken a crack at implementing a
> JSON representation for CRS objects, based on the ISO_19111:2019
> abstract model and compatible with WKT2:2019.
> See my proposal in https://github.com/OSGeo/PROJ/pull/1547
OK, so now import&export of PROJJSON has been implemented in this PR.
Examples:
Import from EPSG and export as PROJJSON:
$ projinfo EPSG:32631 -o PROJJSON -q > out.json
Import from PROJJSON and export as a old school PROJ string:
$ projinfo @out.json -o PROJ -q
+proj=utm +zone=31 +datum=WGS84 +units=m +no_defs +type=crs
$ cat out.json
{
"type": "ProjectedCRS",
"name": "WGS 84 / UTM zone 31N",
"base_crs": {
"name": "WGS 84",
"datum": {
"type": "GeodeticReferenceFrame",
"name": "World Geodetic System 1984",
"ellipsoid": {
"name": "WGS 84",
"semi_major_axis": 6378137,
"inverse_flattening": 298.257223563
}
},
"coordinate_system": {
"subtype": "ellipsoidal",
"axis": [
{
"name": "Geodetic latitude",
"abbreviation": "Lat",
"direction": "north",
"unit": "degree"
},
{
"name": "Geodetic longitude",
"abbreviation": "Lon",
"direction": "east",
"unit": "degree"
}
]
},
"id": {
"authority": "EPSG",
"code": 4326
}
},
"conversion": {
"name": "UTM zone 31N",
"method": {
"name": "Transverse Mercator",
"id": {
"authority": "EPSG",
"code": 9807
}
},
"parameters": [
{
"name": "Latitude of natural origin",
"value": 0,
"unit": "degree",
"id": {
"authority": "EPSG",
"code": 8801
}
},
{
"name": "Longitude of natural origin",
"value": 3,
"unit": "degree",
"id": {
"authority": "EPSG",
"code": 8802
}
},
{
"name": "Scale factor at natural origin",
"value": 0.9996,
"unit": "unity",
"id": {
"authority": "EPSG",
"code": 8805
}
},
{
"name": "False easting",
"value": 500000,
"unit": "metre",
"id": {
"authority": "EPSG",
"code": 8806
}
},
{
"name": "False northing",
"value": 0,
"unit": "metre",
"id": {
"authority": "EPSG",
"code": 8807
}
}
]
},
"coordinate_system": {
"subtype": "Cartesian",
"axis": [
{
"name": "Easting",
"abbreviation": "E",
"direction": "east",
"unit": "metre"
},
{
"name": "Northing",
"abbreviation": "N",
"direction": "north",
"unit": "metre"
}
]
},
"area": "World - N hemisphere - 0°E to 6°E - by country",
"bbox": {
"south_latitude": 0,
"west_longitude": 0,
"north_latitude": 84,
"east_longitude": 6
},
"id": {
"authority": "EPSG",
"code": 32631
}
}
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the PROJ
mailing list