Small Python utility for exporting Portuguese CAOP.
Setup a virtual environment and install dependencies
pip install -r app-requirements.txt
python execute.py --source /path/to/my/caop.shp --output /path/to/my/caop.geojson
python execute.py --source /path/to/my/caop.shp --group /path/to/my/group_root
Important: In this mode, individual freguesias are grouped by district code folders. (Portuguese administrative code DICOFRE)
usage: caop2geojson [-h] [-v] [--source SOURCE] [-s_srs S_SRS]
[-s_format S_FORMAT] [--output OUTPUT] [-o_srs O_SRS]
[-o_format O_FORMAT] [--query QUERY] [--group GROUP]
[--overwrite]
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
--source SOURCE, -s SOURCE
Path to source file for conversion
-s_srs S_SRS Source reference system (EPSG:3763)
-s_format S_FORMAT Source file format using OGR definition (ESRI
Shapefile)
--output OUTPUT, -o OUTPUT
Path to output the converted file
-o_srs O_SRS Output reference system (EPSG:4326)
-o_format O_FORMAT Output file format using OGR definition (GeoJSON)
query:
--query QUERY, -q QUERY
WIP: Query the source file for DICOFRE with a k:v
list. (Example: ['DICOFRE:100301', 'DICOFRE:180101]'
--group GROUP, -g GROUP
Path to where to group individual parishes by
district. (Example: /path/to/mycaop'
options:
--overwrite Overwrite existing files on export.
Despite it's initial purpose and naming, the tool was tested to export GeoJSON
and ESRI Shapefile
formats.
Since it's using Fiona in the background, the supported driver's list for export will depend on the OGR installation on your system.
For further info check Fiona and OGR documentation.
If you need further assistance please contact info[at]geocrafter.eu
caop2geojson is Free and Open Source sofware and is licensed under 3-clause BSD License.