-
Notifications
You must be signed in to change notification settings - Fork 1
Home
This extension provides the MapStore integration into the CKAN Data Portal. Two additional plugins are available in order to manage:
- WMS and WMTS preview using MapStore: This replaces the standard CKAN WMS Preview (data in CKAN wms) allowing to show WMS/WMTS resources inside the MapStore WebGIS. The GetCapabilities URL must be provided with the layer name (including the workspace if needed) as the name of the CKAN resource.
- GeoStore Harvesting: This plugin can be used in order to manage Harvest operations to GeoStore. New Datasets are created in CKAN and populated from the GeoStore's resources (basically the MapStore's maps).
In this case a new mapstore format in CKAN is used from the CKAN MapStore plugin in order to show manage and show the preview inside the MapStore WebGIS.
In order to install the ckanext-mapstore, copy (or clone using git) the ckanext-mapstore directory inside the CKAN src directory (i.e. ckan/default/src).
Before using the plugin, the extension must installed into the CKAN virtual environment:
- activate the virtualenv
- change to the CKAN’s directory
- clone the extension repo
- run
setup.py
$ . /usr/lib/ckan/default/bin/activate
(default)$ cd /usr/lib/ckan/default/src
(default)$ git clone https://github.com/geosolutions-it/ckanext-mapstore.git
(default)$ cd ckanext-mapstore
(default)$ python setup.py develop
In order to make available the preview through MapStore you have also to provide a standard MapStore installation running, as specified inside the MapStore WIKI.
The ckanext-mapstore is a common CKAN extension that can be enabled in your CKAN installation as usual editing the mySite.ini configuration file, as an instance:
ckan.plugins = stats pdf_preview harvest mapstore_preview geostore_harvester
In this case both plugins (mapstore_preview and geostore_harvester) are enabled. You have to restart your CKAN when done.
NOTE: The geostore_harvester extends the basic CKAN 'harvest', so this must be included if you want to us it.
You should now be able to start CKAN in the development web server and have it start up without any problems:
[ckan@localhost ~]$ paster serve /etc/ckan/default/development.ini
Starting server in PID 13961.
serving on 0.0.0.0:5000 view at http://127.0.0.1:5000`
The MapStorePlugin manages the formats below:
- wms: Standard WMS resource
- wmts: Standard WMTS resource
- mapstore: Is used to manage MapStore's map previews for GeoStore harvested resources.
In general, the preview through the MapStore WebGIS, is managed in CKAN with an HTML iFrame; So the connections parametes to the MapStore instances must be specified. Please check/modify these inside the preview_config.js file:
[ckan@localhost ~]$ cd /usr/lib/ckan/default/src/ckanext-mapstore
[ckan@localhost ~]$ vim ckanext/mapstore/preview/preview_config.js
Below the configurations parameters to use:
var preview_config = {
viewerConfigName: "preview",
viewerPath: "/embedded",
composerPath: "/composer",
mapStoreBaseURL: "http://localhost:8080/mapstore",
basketStatus: false,
storageMethod: "sessionstorage",
forceLocaleTo: "en",
storeSize: 5000
}
-
viewerConfigName
: The MapStore WebGIS configuration to use (see the MapStore WIKI for more details). -
viewerPath
: The relative URL of the MapStore viewer (used for the basic preview inside the CKAN resource page). -
composerPath
: The relative URL of the MapStore advanced viewer (used inside the CKAN preview page in order to open the advanced MapStore viewer in a separate browser page). -
mapStoreBaseURL
: The MapStore base URL. -
basketStatus
: (default to false) Enable this to true only if WMS validation is enabled in CKAN .ini file -
forceLocaleTo
: (optional) you can force the i18n labels to a specific language (Shopping Cart's panel/buttons) -
storageMethod
: The storage method to use in order to store usage information about the Shopping Cart status. Valid values are: ‘localstorage’, ‘sessionstorage’ or ‘cookies’. -
storeSize
: The limit in Byte of the client storage to use (sessioStorage, localStorage or cookies). For most browsers we have more or less 5MB for session and local storage and 4K for cookies.
-
localstorage: The localStorage object stores the data with no expiration date. The data will not be deleted when the browser is closed, and will be available the next day, week, or year.
-
sessionstorage: The sessionStorage object is equal to the localStorage object, except that it stores the data for only one session. The data is deleted when the user closes the browser window.
-
cookies: Use the standar cookie behavior.
An additional configuration for preview_config
, allows to use an existing map as background of the preview. This configuration property are optional, below an example:
backgroundData: {
baseMapId: "387",
geostoreBaseUrl: "http://localhost:8080/geostore/rest/"
}
-
baseMapId
: The map ID. -
geostoreBaseUrl
: The GeoStore URL.
Configure the WMS version
The MapStore's CKAN extension allows to configure the WMS version to use for the GetCapabilities URL.
By default 1.1.1 is used, in order to modify the version number open the mapstore_utils.js
file::
$ vim /usr/lib/ckan/default/src/ckanext-mapstore/ckanext/mapstore/preview/mapstore_utils.js
and change the defaultVersion
internal property value. For example to use the WMS 1.3.0 version::
defaultVersion: "1.3.0"