Skip to content

A plan for future-proof tile URLs #20

@migurski

Description

@migurski

We are starting to see versioned/dated URLs in sharedstreets/sharedstreets-builder#10 (comment). @kpwebb and I talked by phone to see if there was a sensible URL structure that SharedStreets could commit to for tiles going forward. It would provide immutability so that tile consumers could be reassured of stable identifiers, links to the source OpenStreetMap data so OSM IDs could be unambiguously referenced, and an index format so that clients could choose when to move forward. As with OSM Planet, latest would be a special date to indicate the newest copy of the data.

Here’s what a sample JSON index with URI templates might look like:

[
  {
    "url_template": "https://tiles.sharedstreets.io/planet-latest/{z}-{x}-{y}.{layer}.pbf",
    "planet_url": "http://planet.openstreetmap.org/pbf/planet-180319.osm.pbf",
    "planet_date": "latest",
    "version": "0.2.0"
  },
  {
    "url_template": "https://tiles.sharedstreets.io/planet-180319/{z}-{x}-{y}.{layer}.pbf",
    "planet_url": "http://planet.openstreetmap.org/pbf/planet-180319.osm.pbf",
    "planet_date": "2018-03-19",
    "version": "0.2.0"
  },
  {
    "url_template": "https://tiles.sharedstreets.io/planet-180312/{z}-{x}-{y}.{layer}.pbf",
    "planet_url": "http://planet.openstreetmap.org/pbf/planet-180312.osm.pbf",
    "planet_date": "2018-03-12",
    "version": "0.1.0"
  }
]

We also talked a bit about different build levels for tiles based on road class. Right now, the SharedStreets tiles include all roads down to small service alleys and parking lots. A tile URL might include a minimum road class to slice the data:

  • All roads: https://tiles.sharedstreets.io/planet-latest/{z}-{x}-{y}.{layer}.pbf
  • Roads at and above a specific class: https://tiles.sharedstreets.io/planet-latest/{z}-{x}-{y}.{layer}.{roadClass}.pbf
    • Residential streets and larger: https://tiles.sharedstreets.io/planet-latest/{z}-{x}-{y}.{layer}.6.pbf
    • Motorways only: https://tiles.sharedstreets.io/planet-latest/{z}-{x}-{y}.{layer}.0.pbf

Feedback on this proposal welcome!

/cc @hassoncs

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