AppGeo / ckanext-agsview

MIT License
10 stars 10 forks source link

====================================================== ckanext-agsview - Esri ArcGIS Server CKAN resources

This extension contains view plugins to display ArcGIS Map services (cached, dynamic) and Feature layer services in CKAN. It uses an Esri Leaflet Viewer <https://github.com/Esri/esri-leaflet>_ for display.


Available plugins

ArcGIS Feature Layer Viewer (ags_fs_view)

The ArcGIS Feature Layer Viewer provides access to different ArcGIS Feature Layers within a MapService or FeatureService. Each instance of a view has the following configuration options:

ArcGIS MapService Viewer (ags_ms_view)

The ArcGIS MapServer Viewer provides access to MapService and the ability to set which layers are to view within that MapService. Each instance of a view has the following configuration options:


Configuration Options (.ini)

ckanext.agsview.default_basemap_url

Can accept Esri basemap name <http://esri.github.io/esri-leaflet/api-reference/layers/basemap-layer.html>_ or generic tile url template::

ckanext.agsview.default_basemap_url = Gray

::

ckanext.agsview.default_basemap_url = http://example.com/MapServer/tile//{z}/{x}/{y}


Installation

To install ckanext-agsview for development:

  1. Clone the source::

    cd /usr/lib/ckan/default/src git clone https://github.com/ckan/ckanext-agsview.git

  2. Activate your CKAN virtual environment, for example::

    . /usr/lib/ckan/default/bin/activate

  3. Install the ckanext-agsview Python package into your python virtual environment::

    cd ckanext-agsview python setup.py install

  1. Add ags_fs_view and/or ags_ms_view to the ckan.plugins setting in your CKAN config (ini) file (by default the config file is located at /etc/ckan/default/production.ini)::

    ckan.plugins = ... ags_fs_view ags_ms_view

  2. Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu::

    sudo service apache2 reload

Quick development Install

  1. Copy the following code into a shell script named setup-agsview.sh and update the paths as needed::

    . /usr/lib/ckan/default/bin/activate cd ~/projects/ckanext-agsview/ python setup.py develop sed -i.bak -e "s/ckan.plugins = /ckan.plugins = ags_fs_view ags_ms_view /g" /etc/ckan/default/production.ini sed -i.bak '/^ckan.plugins/a ckanext.ags_view_default_basemap_url = Gray' /etc/ckan/default/production.ini sed -i.bak '/^ckan.plugins/a ckanext.ags_view_proxy = {"http://mapservices.bostonredevelopmentauthority.org":"https://jqnatividad-prod.apigee.net/mapservices-bostonredevelopmentauthority-org","http://maps.cityofboston.gov":"https://jqnatividad-prod.apigee.net/maps.cityofboston.gov"}' /etc/ckan/default/production.ini sudo service apache2 reload

  2. Run the shell script from the command line::

    sh setup-agsview.sh