-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow vectortile.Layer to pass a valid 'id' to internal.vector_tile.Tile.Layer #2884
Comments
Looks like you're absolutely right. The GeoJSON spec indeed does include an optional Any thoughts, @echeipesh, @pomadchin ? |
A breadcrumb for where VectorTile feature are being created: geotrellis/vectortile/src/main/scala/geotrellis/vectortile/Layer.scala Lines 127 to 140 in f8af6e6
|
Hi! I'm using GeoTrellis and VectorPipe to create MapBox vector tiles. The problem I have is... I need to be able to write a top level 'id' in each Feature (not as part of 'properties')... and in
vectortile.Layer.unfeature()
, the argid: Option[Long]
passed tovectortile.internal.vector_tile.Tile.Feature
is hard-coded in .unfeature() asNone
.To solve this for my purposes, I forked and compiled locally with a
Map[String,Value] => Option[Long]
function hard coded inLayer.unfeature()
to create an 'id' from 'data' to pass tovt.Tile.Feature
. This worked, and the output .PBFs had the expected 'id' in them.I'm trying to think through how else users might want to create an 'id'... maybe a random Long would be sufficient for some, but that could still be coded into a 'data' => 'id' function.
I believe this would be a common pattern, to want an 'id' and to be able to create from the metadata. It looks like the VectorPipe API has completely changed since two days ago, but it used to be in
Collate.generically()
where avectortile.StrictLayer
is constructed. If there was a way to pass in aMap[String,Value] => Option[Long]
function to Layer/StrictLayer/LazyLayer forLayer
to use in .unfeature() to convert 'data' to valid 'id' instead of hard-coding as None... I think that would be a common use case.The text was updated successfully, but these errors were encountered: