Coder Social home page Coder Social logo

rtarway / apache-beam-spatial Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davideanastasia/apache-beam-spatial

0.0 0.0 0.0 487 KB

Build spatial-aware sessions in Apache Beam

Home Page: https://medium.com/@davide.anastasia/time-space-sessions-in-apache-beam-b402cdf8470

License: Apache License 2.0

Java 100.00%

apache-beam-spatial's Introduction

Apache Beam Spatial

This project contains a modified session algorithm for the calculation of time/space sessions using Apache Beam. The algorithm leverages Uber H3 (an hex-based tiling system), and works in either batch or streaming mode. With little modification, it can be extended to work using Google S2 or the classic Geohash algorithm.

The code is support material for the article Time/Space Sessions in Apache Beam on Medium.

Examples

Reference dataset

Most of the code in the project (including the demo app) is tested with the Microsoft T-Drive dataset.

On Google Dataflow

Execution of the batch job on Google Dataflow can be performed using:

export GCP_PROJECT=...
export GCP_REGION=...
export GOOGLE_APPLICATION_CREDENTIALS=...

java -cp ../target/beam-spatial-examples-bundled-0.0.1.jar com.davideanastasia.beam.spatial.Batch \
  --runner=DataflowRunner \
  --project=${GCP_PROJECT} \
  --region=${GCP_REGION} \
  --maxNumWorkers=6 \
  --tempLocation=gs://${GCP_PROJECT}-data/temp/ \
  --inputFile=gs://${GCP_PROJECT}-data/raw-data/*.txt \
  --outputFile=gs://${GCP_PROJECT}-data/sessions-3/out

Demo

The folder demo/ contains a combination of dataflow + python to create a real-time mapping visualization of the taxi data. For further info, please refer to the README.md file in the same folder.

apache-beam-spatial's People

Contributors

davideanastasia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.