Extension Data Spatial


Extension Basics

Title
Data Spatial
Name
ckanext-dataspatial
Type
Public extension
Description
CKAN extension providing geospatial awareness for datastore data, including spatial searches, query extent calculation, with PostGIS and Solr support.
CKAN versions
Download-Url (zip)
Last commit
6 years ago (2019-11-26 13:16:00)
Url to repo
Category
Data Management & Quality


Background Infos

Description (long)
Show details

ckanext-dataspatial

⚠️ This extension is no longer maintained. (Archived on Nov 26, 2019)

A CKAN extension that provides geospatial awareness of datastore data.

Overview

NB: This extension is unmaintained. There have been some syntax updates so it should work with CKAN 2.8+, but it hasn’t been tested and is not currently in use by the Museum.

This extension provides geospatial awareness of datastore data. This includes:

  • Geospatial searches within datasets
  • Spatial extent of datastore searches
  • Support for PostGIS
  • Support for Solr via the ckanext-datasolr extension

Installation

  1. Clone the repository into the src folder:
cd $INSTALL_FOLDER/src
git clone https://github.com/NaturalHistoryMuseum/ckanext-dataspatial.git
  1. Activate the virtual env and install requirements:
. $INSTALL_FOLDER/bin/activate
cd $INSTALL_FOLDER/src/ckanext-dataspatial
pip install -r requirements.txt
python setup.py develop
  1. Add ‘dataspatial’ to the list of plugins in your config file.

Configuration

# Backend for query_extent queries ('postgis' or 'solr'), default: postgis
dataspatial.query_extent = postgis

# WGS data field in PostGIS database, default: _geom
dataspatial.postgis.field = _geom

# Mercator field in PostGIS database, default: _the_geom_webmercator
dataspatial.postgis.mercator_field = _the_geom_webmercator

# For Solr (requires ckanext-datasolr)
dataspatial.solr.index_field = _geom
dataspatial.solr.latitude_field = latitude
dataspatial.solr.longitude_field = longitude

Actions

  • create_geom_columns: Creates PostGIS columns on a resource table
  • update_geom_columns: Updates geospatial columns when a row is updated
  • datastore_search: Supports filtering by WKT polygon using _tmgeom filter
  • datastore_query_extent: Returns geospatial extent of query results

Commands

# Create PostGIS columns
paster --plugin=ckanext-dataspatial dataspatial create-columns $RESOURCE_ID -c $CONFIG_FILE

# Create index
paster --plugin=ckanext-dataspatial dataspatial create-index $RESOURCE_ID -c $CONFIG_FILE

# Populate columns from lat/long
paster --plugin=ckanext-dataspatial dataspatial populate-columns $RESOURCE_ID -l $LATITUDE_COLUMN -g $LONGITUDE_COLUMN -c $CONFIG_FILE

Further Setup

PostGIS

Your PostgreSQL database must have PostGIS support installed.

Solr

Requires the ckanext-datasolr extension for Solr support.

Version
0.0.1
Version release date
2017-12-07
Contact name
Natural History Museum
Contakt email
(not set)
Contact Url
(not set)


Installation Guide

Configuration hints

ARCHIVED repository - no longer maintained. Requires PostGIS for PostgreSQL or ckanext-datasolr for Solr backend.

Plugins to configure (ckan.ini)
dataspatial
CKAN Settings (ckan.ini)
# dataspatial.query_extent = postgis
# dataspatial.postgis.field = _geom
# dataspatial.postgis.mercator_field = _the_geom_webmercator
DB migration to be executed
(not set)
<< back to Extensions