Convert shapefiles to GeoSPARQL
Project description
shape2geosparql
A library for converting shapefiles to GeoSPARQL.
Install
The GDAL
library should already be installed on the system. On Fedora:
$ sudo yum install gdal-devel
On other systems:
- Ubuntu: https://mothergeo-py.readthedocs.io/en/latest/development/how-to/gdal-ubuntu-pkg.html#install-gdal-ogr
- Windows: https://sandbox.idre.ucla.edu/sandbox/tutorials/installing-gdal-for-windows
You only need to install the core library, as the Python bindings will be installed with shape2geosparql
.
Once GDAL is installed:
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install shape2geosparql
Should there be any problems in installing the GDAL
Python library, try to run this first:
$ pip install gdal==$(gdal-config --version)
or insert the GDAL version number in place of $(gdal-config --version)
.
Usage
Download and extract a shapefile, for example from:
- https://dati.trentino.it/dataset/stazioni-treno-open-data
- https://hifld-geoplatform.opendata.arcgis.com/datasets/american-red-cross-chapter-facilities
Then, from python
, IPython
or Jupyter
:
from shape2geosparql import convert
converter = convert('FILENAME.shp')
print(converter.write().decode())
You can also run the shape2geosparql
command:
$ shape2geosparql FILENAME.shp
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
shape2geosparql-0.1.1.tar.gz
(3.9 kB
view hashes)
Built Distribution
Close
Hashes for shape2geosparql-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 088707dbac0eb42df9caf1121de3e1820f6227c64c2f7896afdffcc27e032ad7 |
|
MD5 | 3df6e62487bd18ccb958c5a0ea86fa46 |
|
BLAKE2b-256 | 851535a6b8a3d2ea8a406dcc954eaff822a467d4224b2f1495ca9aebbf13e392 |