GithubHelp home page GithubHelp logo

s2-playground's Introduction

s2-playground

Convert polygons to S2 cells & vice versa.

Running the app locally

First off, install requirements:

pip install -r requirements.txt

The Flask application can be started with

FLASK_APP=service.py flask run

This will just run the development server.

Another option is to use uWSGI's HTTP server mode. A sample command has been added to entrypoint.sh bash script.

Running ./entrypoint.sh dev will run the uWSGI HTTP server with hot-reload option enabled, so all changes applied to the codebase will trigger a server restart.

Running containerized app

docker build -t s2playground .

docker run --rm -p 8080:80 s2playground

Head over to 127.0.0.1:8080 and enjoy.

Installing Python port of S2Geometry

The following commands will work on Mac OS Mojave 10.14 with PyCharm IDE & its Python 3.7 venv.

Install deps

brew install swig gflags glog openssl

Clone repo in venv directory

cd venv && git clone [email protected]:google/s2geometry.git && cd s2geometry

Download & unzip googletest suite

wget https://github.com/google/googletest/archive/release-1.8.0.zip && unzip release-1.8.0.zip

Create build directory

mkdir build && cd build

Configure cmake

cmake -DCMAKE_INSTALL_PREFIX:PATH=/path/to/pycharm/venv -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2q -DOPENSSL_LIBRARIES=/usr/local/Cellar/openssl/1.0.2q/lib -DGTEST_ROOT=./googletest-release-1.8.0/googletest ..

Build & install the S2 Python library (available as pywraps2)

make && make install

s2-playground's People

Contributors

fpapadopou avatar

Watchers

 avatar  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.