ArcGIS Hub makes it easy to share your data to any CKAN site by providing data catalog output in the DCAT format. This type of interoperability enables users to follow known workflows to share data from ArcGIS and make it available in multiple download formats (SHP, KML, CSV) and APIs (Geoservices, WMS, GeoJSON) in a CKAN platform.
Before you begin, your CKAN instance must be properly configured to support harvesting. This involves installing and configuring two extensions that are developed and maintained by the CKAN team and are used by Data.gov and others to harvest datasets.
- Follow the instructions here: https://github.com/ckan/ckanext-harvest/blob/master/README.rst if you do not already have the CKAN Harvesting extension installed.
- Follow the instructions here: https://github.com/ckan/ckanext-dcat/blob/master/README.md if you do not already have the CKAN DCAT extension installed.
- Make sure you have the Harvester Gather_Consumer and Fetch_Consumer services running as background services.
- Activate your local python environment: ./usr/lib/ckan/default/bin/activate
- Activate the Gather process: paster --plugin=ckanext-harvest harvester gather_consumer --config='/path/to/your config.ini'
- Activate the Fetch process: paster --plugin=ckanext-harvest harvester fetch_consumer --config='/path/to/your config.ini'
Harvest the ArcGIS Hub catalog
- Go to your CKAN harvest administration page and log in at http://yourCKANinstance/harvest.
- Select add harvest source and enter some information about your Hub site:
- Fill in the URL with http://yourOpenDataSite/data.json
- Give the harvest source a title similar to the title of your Hub site
- (Optional) Fill in the description box
- Select source-type: DCAT JSON Harvester
- Select update frequency: manual
- Click save when done
- Select admin then select reharvest.
- Run harvest jobs on your CKAN instance.
- Activate your python environment: ./usr/lib/ckan/default/bin/activate.
- Enter the command: paster --plugin=ckanext-harvest harvester run --config='path/to/your config.ini'
CKAN will now start processing your data.json file and will bring in all your datasets. You can see what gets harvested by viewing the harvest source. All of your descriptions, tags, and dataset distributions from ArcGIS Hub will be accessible from the instance of CKAN.
Note: You may notice some strange behavior the first time you try to preview a CSV or JSON file. Hub is generating a cache of this data and CKAN does not know how to handle this case when the data is processing. This will not occur again the next time you try to preview the file.