Skip to content

Coordinate reprojection #7

@ClaudioPrimerano

Description

@ClaudioPrimerano

Hi @LucaBTE,
I’m testing your interface with a local istSOS4 instance that uses EPSG:2056 as its spatial reference system. Currently, the map only works with EPSG:4326, so it is necessary to reproject the coordinates from 2056 to 4326 (for example, using the proj library).

When you define an EPSG different from 4326 in istSOS4, geometry fields (e.g., observedArea in Datastream) include a crs key specifying the coordinate reference system. Here’s an example with EPSG:2056:

"observedArea": {
  "crs": {
    "type": "name",
    "properties": {
      "name": "EPSG:2056"
    }
  },
  "type": "Point",
  "coordinates": [
    2724678,
    1122644.000000001
  ]
}

If the EPSG is 4326, the observedArea field does not include the crs key, but only the geometry:

"observedArea": {
  "type": "Point",
  "coordinates": [
    2724678,
    1122644.000000001
  ]
}

⚠️ Important note: when creating or updating geometry fields using coordinates from the map, you must also reproject them back to the original istSOS4 system (e.g., from 4326 to 2056).

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