vectorpipe | Convert Vector data to VectorTiles with GeoTrellis | Map library
kandi X-RAY | vectorpipe Summary
kandi X-RAY | vectorpipe Summary
VectorPipe (VP) is a library for working with OpenStreetMap (OSM) vector data and writing geometries to vector tile layers. Powered by Geotrellis and Apache Spark. OSM provides a wealth of data which has broad coverage and a deep history. This comes at the price of very large size which can make accessing the power of OSM difficult. VectorPipe can help by making OSM processing in Apache Spark possible, leveraging large computing clusters to churn through the large volume of, say, an OSM full history file. For those cases where an application needs to process incoming changes, VP also provides streaming Spark DataSources for changesets, OsmChange files, and Augmented diffs generated by Overpass. For ease of use, the output of VP imports is a Spark DataFrame containing columns of JTS Geometry objects, enabled by the user-defined types provided by GeoMesa. That package also provides functions for manipulating those geometries via Spark SQL directives. The final important contribution is a set of functions for exporting geometries to vector tiles. This leans on the geotrellis-vectortile package.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vectorpipe
vectorpipe Key Features
vectorpipe Examples and Code Snippets
val df = spark.read.orc(path)
import vectorpipe.sources.Source
val df = spark.read
.format(Source.Changes)
.options(Map[String, String](
Source.BaseURI -> "https://download.geofabrik.de/europe/isle-of-m
import Dependencies._
lazy val mainRunner = project.in(file("mainRunner")).dependsOn(RootProject(file("."))).settings(
libraryDependencies ++= Seq(
sparkSql % Compile
)
)
spark-shell --packages com.azavea.geotrellis:vectorpipe_2.11:2.1.3
// Make JTS types available to Spark
import org.locationtech.geomesa.spark.jts._
spark.withJTS
import vectorpipe._
Community Discussions
Trending Discussions on vectorpipe
QUESTION
I'm writing MapBox vector tiles using geotrellis vectorpipe.
see here for the basic flow: https://geotrellis.github.io/vectorpipe/usage.html
Typically GeoJson Features can have an id
field, so that Features can be rolled up into FeatureCollections. I need to make use of this field, but vectorpipe doesn't (natively) have this capability.
This is the Feature
type used, and you can see it only has space for 1) a Geometry
and 2) a data object D
(which ends up populating properties
in the output). There is no spot for an id
.
https://geotrellis.github.io/scaladocs/latest/index.html#geotrellis.vector.Feature
Upstream there's a method called writeFeatureJsonWithID()
that does let you inject an id
field into a Feature
when writing GeoJson.
My question is this:
I have worked through the vectorpipe code (https://github.com/geotrellis/vectorpipe), and I can't figure out if/where the data ever exists as GeoJson in a way where I can override and inject the id
, maybe using the writeFeatureJsonWithID()
or something I write explicitly. A lot of conversions are implicit, but it also may never explicitly sit as json.
Any ideas for how to get an id
field in the final GeoJson written to vector tiles?
EDIT
Right now I think the trick is going to be finding a way to override .unfeature()
method here:
The problem is that the internal.vector_tile.Tile
is private, so I can construct it without forking the project.
ANSWER
Answered 2019-Mar-27 at 20:37Ended up having to fork geotrellis, hard-code a metadata => id
function in Layer.unfeature()
and compile locally to include in my project. Not ideal, but it works fine.
Also opened an issue here: https://github.com/locationtech/geotrellis/issues/2884
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vectorpipe
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page