Code Monkey home page Code Monkey logo

geojson2shp's Introduction

geoJSONToShpFile

This code converts GeoJSON to shape files. Please keep in mind that the current code expects the common geoJSON format with features list. The code will not work if you do not have the features list. The following example is OK since it has a features list with three points. One more important comment, shapefiles can hold only one feature type e.g. points, lines, and polygons. For that, I decided that the code will grab only features similar to the first feature in the list. In geoJSON, you can have different feature types in one feature list, and that does not work with shape files.

{ "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": {"id": 1, "name": "Indian Ocean" }, "geometry": { "type": "Point", "coordinates": [ 80.15625, -22.91792293614602 ] } }, { "type": "Feature", "properties": {"id": 2, "name": "Atlantic Ocean" }, "geometry": { "type": "Point", "coordinates": [ -37.96875, 17.644022027872726 ] } }, { "type": "Feature", "properties": {"id": 3, "name": "Pacific Ocean" }, "geometry": { "type": "Point", "coordinates": [ -164.1796875, 1.4061088354351594 ] } } ] }

how to use

$python3 geojson2shp -i /location/of/your/file.geojson

output

file.shp, file.shx, file.dbf, file.prj

geojson2shp's People

Contributors

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