ckanext-iotrans
This CKAN extension lets you convert datastore resources into files of various formats and, for spatial data, Coordinate Reference Systems.
This extension is intended for use cases that require download of datastore resources in multiple formats or Coordinate Reference Systems aside from CKAN’s built-in formats.
This extension leverages the Fiona Python library.
Requirements
This extension only works if the CKAN Datastore Extension is active.
Compatibility with core CKAN versions:
- 2.9: yes
- 2.6-2.8: not tested
Usage
ckanext-iotrans creates the following CKAN actions - both will only work for admin users:
to_file
Inputs:
- resource_id: CKAN datastore resource ID
- source_epsg: source EPSG of resource ID, if data is spatial, as an integer
- target_epsgs: list of desired EPSGs of output files, if data is spatial
- target_formats: list of desired file formats (CSV, GEOJSON, GPKG, SHP, JSON, XML)
Outputs:
Writes desired files to folder in /tmp, and returns a list of filepaths.
prune
Inputs:
- path: path to file or directory in /tmp to delete
Memory and Disk Use
Data is first streamed from the datastore into a CSV stored on disk. Processing to convert files is done in memory on one chunk at a time.
Geometric Data
Identifies spatial data as anything containing a geometry attribute. Supported geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon.