1

Currently, I have an application generating time series spacial data. The data is weather data with coordinates and a time of reading.

I would like to receive chunks of the data in a time series way and I am currently using a generated CSV as a response to input requests

temperature,latitude,longitude,timestamp,
10,50,4,11,1610138555,
...
...

I am used to working with geojson and would like the coordinates to be 4 dimensional I.e. 3 spacial directions and time.


{ "type": "FeatureCollection",
  "features": [
    { "type": "Feature",
      "geometry": {"type": "Point", "coordinates": [102.0, 0.5]},
      "properties": {"prop0": "value0"}
      },
    { "type": "Feature",
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [102.0, 0.0, 100, 123456], [103.0, 1.0, 105, 123456], [104.0, 0.0, 106, 123456], [105.0, 1.0, 107, 123456]
          ]
        },
      "properties": {
        "prop0": "value0",
        "prop1": 0.0
        }
      }
    ]
  }

The purpose is to represent mobile sensors that run on a trajectory and I would like to have the data clearly represented.

Any suggestions on good JSON formats? Ideally something with a common standard similar to GeoJSON would be ideal.

  • 1
    Why is GeoJSON not working for your use case? – lennon310 Jan 08 '21 at 23:15
  • @lennon310 As I currently understand, Geojson in it's current format for coordinates would only allow for spacial dimensions i.e. the coordinates key would have the following values of [x, y, z] for longitude, latitude and height. I would like to use a format that matched up as [x, y, z, t] for a time to be included so I can monitor the movement and join time with space - this is a user requirement that has come to me to view json in this desired format - is Geojson suitable? Or are there more suitable formats for representing the spatial time series relation? – apollowebdesigns Jan 09 '21 at 14:37

1 Answers1

1

There are several options:

{ "type": "Feature",
  "geometry": {
      "type": "Point", 
      "coordinates": [102.0, 0.5]
   },
  "properties": {
      "timestamp": 123456
      "prop0": "value0"
  }
}
  • Use GeoJSON-X, a GeoJSON extension where you can define both weather data and timestamp as the elements in extensions field:
{ "type": "Feature",
  "geometry": {
      "type": "Point", 
      "extensions" : [ "time", "atemp"],
      "coordinates" : [
        [
          102.0,
          0.5,
          "2021-01-08T19:16:06.000Z", 
          31.0, 
        ], 
   },
}
{ "type": "Feature",
  "geometry": {
      "type": "Point", 
      "coordinates": [102.0, 0.5]
   },
  "when": {
    "start": "2021-01-08T19:16:06.000Z",
    "type": "Instant"
  } 
  "properties": {
      "prop0": "value0"
  }
}
lennon310
  • 3,132
  • 6
  • 16
  • 33