openplannerteam / routable-tiles

An API and preprocessor to serve routable tiles.
https://openplanner.team/
11 stars 1 forks source link

Consider adding a @type to the nodes in the tile data #24

Closed hdelva closed 5 years ago

hdelva commented 5 years ago

We currently define nodes like this:

{
  "@id":"http://www.openstreetmap.org/node/31366201",
  "geo:long":3.7202407,
  "geo:lat":51.0346015
}

Which is fine, the OSM wiki says everything with a longtitude/latitude pair is a node. Still though, I'd recommend adding the type explicitly. This would make filtering more clean and it would make the data more machine-friendly. Definitions on a wiki seem like more of a human thing.

Adding an @type to all ~3000 nodes in https://tiles.openplanner.team/planet/14/8361/5482/ increases the plaintext file size from 706kb to 808kb, but it only raises the compressed file size from 81kb to 82kb. I think having cleaner data is worth the extra 1% larger files.

xivk commented 5 years ago

We can still do this, I will change the nodes to this:

{
  "@id":"http://www.openstreetmap.org/node/31366201",
  "@type": "osm:Node",
  "geo:long":3.7202407,
  "geo:lat":51.0346015
}