-
-
Notifications
You must be signed in to change notification settings - Fork 184
-
Hi, is there a way to generate a JSON or even just a text file of the possible geom types for each layer for a given schema, like OMT?
For example:
park -> ["Polygon"]
water -> ["Polygon"]
... -> ["MultiPolygon"]
I was thinking of parsing a full planet mbtiles for this, but planetiler needs to have this information inside, I guess. Or does it depend on the OSM dump?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 3 replies
-
There's no out-of-the-box way to do this now, although it would be relatively straightforward to add this to LayerAttrStats in addition to the properties types by layer that it already tracks. We could pass it through as a non-standard extra field in mbtiles metadata vector_layers. The expanded tilestats json field uses the geostats format which has a "geometry" field, but that only allows for a single geometry type 🙁
Beta Was this translation helpful? Give feedback.
All reactions
-
I guess we can insert a new key in geostats, can we not? Does it actively say that it's not allowed?
To explain why this would be great, is that right now there is a big problem with MapLibre shipping v5.0.0 breaking backwards compatibility on geom types (details are in Slack). Hence we have to update all the existing stylesheets, and at that point we could greatly simplify them by removing the geom type filter from many, if not most of them.
Beta Was this translation helpful? Give feedback.
All reactions
-
Yeah I don't see any downside to tracking this in LayerAttrStats and outputting in vector_layers, we could hide it behind a command-line flag if we're concerned about the extra key. It would look something like this:
{
"vector_layers": [
{
"id": "tl_2016_us_county",
"description": "Census counties",
+ "geometries": ["Polygon"]
"minzoom": 0,
"maxzoom": 5,
"fields": {
"ALAND": "Number",
"AWATER": "Number",
"GEOID": "String",
"MTFCC": "String",
"NAME": "String"
}
},
{
"id": "tl_2016_us_primaryroads",
"description": "Census primary roads",
+ "geometries": ["LineString", "MultiLineString"]
"minzoom": 0,
"maxzoom": 5,
"fields": {
"FULLNAME": "String",
"LINEARID": "String",
"MTFCC": "String",
"RTTYP": "String"
}
}
]
}Beta Was this translation helpful? Give feedback.
All reactions
-
This sounds great!
Beta Was this translation helpful? Give feedback.