Git Product home page Git Product logo

geojsonpy's Introduction

GeoJsonPy

Open GeoJSON data on geojson.io from Python.


Table of contents

Description

There are two methods by which geojsonpy.py gets geojson.io to render the data:

Embedding the GeoJSON contents in the geojson.io URL directly Creating an anonymous Github gist and embedding the gist id in the geojson.io URL. geojsonpy.py automatically determines which method is used based on the length of the GeoJSON contents. If the contents are small enough, they will be embedded in the URL. Otherwise geojsonio.py creates an anonymous Gist on Github with the GeoJSON contents. Note: when an anonymous gist is created, the data is uploaded to Github and a unique gist ID is created. If anyone else is able to obtain the gist ID, they will be able to see your data.

Folder

geojsonpy
├── geojsonpy
│   ├── geojsonpy.py
├── README.md
├── setup.cgf

Requirements

For running each sample code:

  • python: >= 3.7

Setup

Install with pip:

$ pip install geojsonpy

Usage

Send data to geojson.io and open a browser within python:

from geojsonpy import display

with open('map.geojson') as f:
    contents = f.read()
    display(contents)

It can also be used on the command line. Read or pipe a file

$ geojsonpy map.geojson
$ geojsonpy < run.geojson

Contributors

geojsonpy's People

Contributors

pietrolechthaler avatar

Watchers

 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.