Giter Club home page Giter Club logo

ogr2reclinejs's Introduction

ogr2reclinejs

if you use reclinejs and you want show geodata, you need a conversion in csv, and a field with a geojson geometry to display.
This script reads the data from an OGR (ex. ESRI Shapefile) source and creates a cvs file with a field "GeoJSON" where stores a single geometry in geojson format.
In the case of point geometry type, the script generates a CSV file with the fields LAT and LON, otherwise creates a geojson string.

ATTENTION: the script converts the coordinates in WGS84 (epsg:4326)

requirements

GDAL binding for python
http://pypi.python.org/pypi/GDAL/1.9.1

Example

with an ESRI Shapefile with point geometry
(the data in the example are open data with cc0 license)

wget http://www.territorio.provincia.tn.it/geodati/712_Sedi_comunali_della_PAT__pup__12_12_2011.zip
unzip http://www.territorio.provincia.tn.it/geodati/712_Sedi_comunali_della_PAT__pup__12_12_2011.zip
python ogr2reclinejs.py pupsedi07f.shp

Output file pupsedi07f.cvs (headers in first row)

PERIMETER,COMU,AREA,LON,LAT
49767.3225177,39,67013655.1778,11.773502305996132,46.47643262636006
31015.9257141,46,25872033.6238,11.116940689711424,46.45539355182122
31148.5732236,36,25038741.4929,11.742433651377064,46.47694596119694
32414.1120528,88,30629279.1232,11.136952626670512,46.43908681182543
26279.9981388,27,19167373.4818,11.10820237197858,46.430823557150056
28158.6961106,113,23628453.2065,11.699810966529446,46.45683741870301
...

ogr2reclinejs's People

Contributors

napo avatar michelemostarda avatar

Stargazers

albert avatar Nazeeruddin Ikram avatar Tobias Preuss avatar Bill Morris avatar  avatar

Watchers

 avatar Tobias Preuss avatar James Cloos avatar  avatar

Forkers

spaziodati

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.