GithubHelp home page GithubHelp logo

isabella232 / pg_mvt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from developmentseed/pg_mvt

0.0 0.0 0.0 5.95 MB

[Experimental] A TiMVT replica using Starlite framework

License: MIT License

Shell 0.03% Dockerfile 0.01% PLpgSQL 99.69% Python 0.21% HTML 0.07%

pg_mvt's Introduction

     _______           __       __ __     __ ________
    |       \         |  \     /  \  \   |  \        \
    | ▓▓▓▓▓▓▓\ ______ | ▓▓\   /  ▓▓ ▓▓   | ▓▓\▓▓▓▓▓▓▓▓
    | ▓▓__/ ▓▓/      \| ▓▓▓\ /  ▓▓▓ ▓▓   | ▓▓  | ▓▓
    | ▓▓    ▓▓  ▓▓▓▓▓▓\ ▓▓▓▓\  ▓▓▓▓\▓▓\ /  ▓▓  | ▓▓
    | ▓▓▓▓▓▓▓| ▓▓  | ▓▓ ▓▓\▓▓ ▓▓ ▓▓ \▓▓\  ▓▓   | ▓▓
    | ▓▓     | ▓▓__| ▓▓ ▓▓ \▓▓▓| ▓▓  \▓▓ ▓▓    | ▓▓
    | ▓▓      \▓▓    ▓▓ ▓▓  \▓ | ▓▓   \▓▓▓     | ▓▓
     \▓▓      _\▓▓▓▓▓▓▓\▓▓      \▓▓    \▓       \▓▓
             |  \__| ▓▓
              \▓▓    ▓▓
                \▓▓▓▓▓▓
  

A TiMVT replica using Starlite framework.

Test Coverage License


Source Code: https://github.com/developmentseed/pg_mvt


pg_mvt is a replica of TiMVT but using Starlite framework instead of FastAPI.

Install

$ git clone https://github.com/developmentseed/pg_mvt.git
$ cd pg_mvt
$ python -m pip install -e .

Launch

$ pip install uvicorn

$ uvicorn pg_mvt.main:app

PostGIS/Postgres

pg_mvt rely mostly on ST_AsMVT function and will need PostGIS >= 2.5.

If you want more info about ST_AsMVT function or on the subject of creating Vector Tile from PostGIS, please read this great article from Paul Ramsey: https://info.crunchydata.com/blog/dynamic-vector-tiles-from-postgis

Configuration

To be able to create Vector Tile, the application will need access to the PostGIS database. pg_mvt uses starlette's configuration pattern which make use of environment variable and/or .env file to pass variable to the application.

Example of .env file can be found in .env.example

# you need define the DATABASE_URL directly
PG_MVT_DATABASE_URL=postgresql://username:[email protected]:5432/postgis

Performances

$ siege --file benchmark/urls.txt -b -c 20 -r 100
# pg_mvt (starlite)
Transactions:                   2000 hits
Availability:                 100.00 %
Elapsed time:                   5.03 secs
Data transferred:               7.00 MB
Response time:                  0.04 secs
Transaction rate:             397.61 trans/sec
Throughput:                     1.39 MB/sec
Concurrency:                   16.97
Successful transactions:        2000
Failed transactions:               0
Longest transaction:            0.19
Shortest transaction:           0.01

# timvt (fastapi)
Transactions:                   2000 hits
Availability:                 100.00 %
Elapsed time:                   5.12 secs
Data transferred:               6.98 MB
Response time:                  0.04 secs
Transaction rate:             390.62 trans/sec
Throughput:                     1.36 MB/sec
Concurrency:                   16.84
Successful transactions:        2000
Failed transactions:               0
Longest transaction:            0.19
Shortest transaction:           0.01

Contribution & Development

See CONTRIBUTING.md

License

See LICENSE

Authors

Created by Development Seed

Changes

See CHANGES.md.

pg_mvt's People

Contributors

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