Skip to content

About the GeoJSON format

GeoJSON is a geospatial data interchange format based on JavaScript Object Notation (JSON). It defines several types of JSON objects and the manner in which they are combined to represent data about geographic features, their properties, and their spatial extents. GeoJSON uses a geographic coordinate reference system, World Geodetic System 1984, and units of decimal degrees.

In our APIs, we mainly use 3 types of GeoJSON format:

  • The Point type:

    This GeoJSON type is mainly use in the Site entity. It is used to defined a single position on the map referenced by a coordinates array: [longitude, latitude].

API Example:

GET https://api.omniaccess-stellar-asset-tracking.com/api/v1/sites/{siteId}

Response extract:

...
"location": {
    "type": "Point",
    "coordinates": [
        -4.412685781717301, // longitude
        48.44161012295645 // latitude
    ]
},
...
  • The MultiPoint type (Floor position)

    This GeoJSON type is mainly use in the Floor entity. It is used to defined an array of Point coordinates to set the exact location of the floor plan image on the map.

API Example:

GET https://api.omniaccess-stellar-asset-tracking.com/api/v1/sites/{siteId}/buildings/{buildingId}/floors/{floorId}

Response extract:

...
"mapCoordinates": {
    "type": "MultiPoint",
    "coordinates": [
        [
            -4.412909913808108,
            48.44125100249419
        ],
        [
            -4.41273292992264,
            48.44194600894336
        ],
        [
            -4.412645731936209,
            48.441220381776006
        ],
        [
            -4.412468522787095,
            48.44191539559465
        ]
    ]
},
...
  • The Polygon type (Indoor area et Geofence)

    This GeoJSON type is mainly use in the Indoor Area and Geofence entities. It is used to defined an array of coordinates where the first and last points are equivalent.

API Example:

GET https://api.omniaccess-stellar-asset-tracking.com/api/v1/sites/{siteId}/indoorareas/{indoorAreaId}

Response extract:

...
"polygon": {
    "type": "Polygon",
    "coordinates": [
        [
            [
                -4.412761,
                48.441845
            ],
            [
                -4.412475,
                48.441914
            ],
            [
                -4.412621,
                48.441319
            ],
            [
                -4.412911,
                48.441251
            ],
            [
                -4.412761,
                48.441845
            ]
        ]
    ]
},
...