Skip to content

Latest commit

 

History

History
86 lines (62 loc) · 3.12 KB

README.md

File metadata and controls

86 lines (62 loc) · 3.12 KB

Vector Tile Spark Process

The Vector Tile Spark Process allows developers and data scientists clip geographic data into Hadoop SequeueFiles on Spark platform.

The effect comes from Preview Example.
Preview

Features

Dependencies

  • GeoTools - an open source Java library that provides tools for geospatial data
  • mapbox-vector-tile-java - Java Mapbox Vector Tile Library for Encoding/Decoding

Requirements

  • Hadoop 2.7 and later
  • Spark 2.1.1 and above
  • Protocol Buffers 3.0.0-beta-2

Getting Started

Build

$ mvn clean && mvn package

Run

$SPARK_HOME/bin/spark-submit --class org.ieee.codemeow.geometric.spark.VectorTileTask --master yarn --deploy-mode cluster --jars /path/to/postgresql-42.0.0.jar --driver-class-path /path/to/postgresql-42.0.0.jar /path/to/vectortile-spark-process-1.0-SNAPSHOT.jar hdfs:///path/to/vectortile-spark-process.yml

Configuration File

---
# vectortile-spark-process.yml

appName: "Vector Tile Process"
sequenceFileDir: "hdfs:///path/to"
layers:
  - layerName: "layerName"
    minZoom: "0"
    maxZoom: "22"
    dataProvider: "org.ieee.codemeow.geometric.spark.data.SQLDataProvider"
    kwargs:
      url: "jdbc:postgresql://hostname/dbname"
      dbtables:
        planet_osm_line: "public.planet_osm_line"
        planet_osm_point: "public.planet_osm_point"
        planet_osm_polygon: "public.planet_osm_polygon"
        planet_osm_roads: "public.planet_osm_roads"
      user: "postgres"
      password: "postgres"
      zooms:
        0: "SELECT osm_id AS __id__, ST_GeomFromWKB(way) AS __geometry__ FROM ..."
        1: "SELECT osm_id AS __id__, ST_GeomFromWKB(way) AS __geometry__ FROM ..."
		...
        22: "SELECT osm_id AS __id__, ST_GeomFromWKB(way) AS __geometry__ FROM ..."

Resources

Issues

Find a bug or want to request a new feature? Please let us know by submitting an issue.

Tips

  1. Upgrade protobuf package version on your Spark cluster

    cp protobuf-java-3.0.0-beta-2.jar $SPARK_HOME/jars

  2. Use SparkSQL in the zooms section of the configuration file