tilezen / mapbox-vector-tile

Python package for encoding & decoding Mapbox Vector Tiles
MIT License
230 stars 46 forks source link

Stringify complex properties #94

Open nvkelso opened 6 years ago

nvkelso commented 6 years ago

We currently drop properties that are lists (or any complex property including nested properties like found in Who's On First features) on conversion from native GeoJSON like format to MVT format.

The convention that is generally followed is to stringify the complex properties.

The following Tilezen properties would be affected:

roads layer lists:

pois layer lists:

Each station has several (optional) lists of routes per transport type:

rmarianski commented 6 years ago

Just confirming, stringify here means encode as a json string right?

nvkelso commented 6 years ago

I believe so, yes.

Tippecanoe should act as good reference:

matteblair commented 6 years ago

What's an example of styling with a "complex" property that can't be replaced with simple properties? The properties named here are all lists, so maybe there's a simpler way to represent this data (rather than allowing properties to be arbitrarily complex JSON objects).

matkoniecz commented 6 years ago

@matteblair I Imagine that map displaying bus routes or hiking routes or displaying separate shields on roads where multiple refs apply would use this kind of data.

I was thinking about displaying hiking routes, each in its associated colour - but I have yet to check is this data currently available (if provided it would be a list).

Note for people confused about colours for hiking routes - in some countries hiking routes have assigned colours and typical hiking map look like this:

Mapsme displays each ref separately (see roads with both European code like e77 and assigned by country). All shield texts are already available as lists.

nvkelso commented 6 years ago

That's a handsome map! I fixed display by wrapping in Markdown syntax of ![](url)

Yes, it's mostly about displaying additional labels.

For most the complex properties there's a basic property to use. In the case of transit we could do something similar, maybe?