Skip to content

Axis order not correctly extracted from EPSG:4326 #28

@SimonBin

Description

@SimonBin

using this definition from gdalsrsinfo:

gdalsrsinfo -o wkt1 EPSG:4326

GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AXIS["Latitude",NORTH],
    AXIS["Longitude",EAST],
    AUTHORITY["EPSG","4326"]]

we can see the axis order is NE (lat/long) however wkt-parser fails to extract it:

wkt(epsg4326)

{
  type: 'GEOGCS',
  name: 'WGS 84',
  DATUM: {
    name: 'WGS_1984',
    SPHEROID: {
      name: 'WGS 84',
      a: 6378137,
      rf: 298.257223563,
      AUTHORITY: [Object]
    },
    AUTHORITY: { EPSG: '6326' }
  },
  PRIMEM: { name: 'greenwich', convert: 0, AUTHORITY: { EPSG: '8901' } },
  UNIT: {
    name: 'degree',
    convert: 0.0174532925199433,
    AUTHORITY: { EPSG: '9122' }
  },
  AXIS: [ [ 'Latitude', 'NORTH' ], [ 'Longitude', 'EAST' ] ],
  AUTHORITY: { EPSG: '4326' },
  projName: 'longlat',
  units: 'degree',
  to_meter: 111319.4907932736,
  datumCode: 'wgs84',
  ellps: 'WGS 84',
  a: 6378137,
  rf: 298.257223563,
  srsCode: 'WGS 84'
}

the missing axis key then later on lets proj4js set axis: 'enu'

https://github.com/proj4js/proj4js/blob/a8bdc85b7c5804d0c05d99c95a8c165287c3c362/lib/Proj.js#L38

  json.axis = json.axis || 'enu';

resulting in a mess

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions