https://github.com/bopen/ckanext-mapsearch
A CKAN extension to add an scale-aware map-centred search
https://github.com/bopen/ckanext-mapsearch
Last synced: 3 months ago
JSON representation
A CKAN extension to add an scale-aware map-centred search
- Host: GitHub
- URL: https://github.com/bopen/ckanext-mapsearch
- Owner: bopen
- License: agpl-3.0
- Created: 2014-03-27T14:38:59.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-11-07T11:53:36.000Z (over 11 years ago)
- Last Synced: 2026-03-13T04:51:03.505Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.59 MB
- Stars: 5
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
CKAN Mapsearch extension
========================
ABOUT
-----
Mapsearch is a CKAN-extension to add a scale-aware, map-centered search
to the *CKAN spatial extension* [(ckanext-spatial)](https://github.com/ckan/ckanext-spatial).

FEATURES
--------
Its main distinguishing factor is the scale-awareness of the
search-engine.
This scale-awareness lets you see how many results there are on 5
different scales for the same geographic area of interest, by using an
extra area field during indexing. see [this](#4-prepare-the-schema-for-the-extension) paragraph below.

DEMO
----
see a working demo on [bopen.eu](http://ckan.bopen.eu/mapsearch).
INSTALLATION
------------
*ckanext-mapsearch* is installed like any ckan extension. However, as it
depends on *ckanext-spatial* to be installed, make sure mapsearch comes
after ckanext-spatial in the plugin list (see [below](#2-add-the-extension-as-a-plugin)).
It also requires solr >= 3.1, as per http://docs.ckan.org/projects/ckanext-spatial/en/latest/spatial-search.html#choosing-a-backend-for-the-spatial-search.
### 1. install the extension with pip
```
pip install -e git+https://github.com/bopen/ckanext-mapsearch.git#egg=ckanext-mapsearch
```
### 2. add the extension as a plugin
add the plugin to the plugins-line in your configuration *.ini* file.
**NB. It must be included with, but after *spatial\_query***
```
ckan.plugins = stats text_preview resource_proxy recline_preview spatial_metadata spatial_query harvest csw_harvester ckan_harvester mapsearch
```
### 3. configure the extension
- set the initial mapextent
add a line to your ini-file specifying the initial map extent ([bottom-left, upper-right]). To show Europe area on loadpage add the following line:
```
ckanext.mapsearch.initial_map_extent = [[30.4806, -12.9449], [72.9295, 40.7210]]
```
- make sure the spatial extension uses solr-spatial field as the
backend.
**NB.: the search-backend of the spatial extension *must* be set to
‘solr-spatial-field’, as with simple ‘solr’ the extension will work
poorly and with ‘postgis’ it will not work at all!**
```
ckanext.spatial.search_backend = solr-spatial-field
```
### 4. prepare the schema for the extension
the extension needs an extra field in the solr index, add the following
line to the schema.xml file in the ‘\’ section.
```
```
### 5. restart solr
TESTS
-----
there are few basic selenium webdriver tests in `tests` folder.
NB:
- You will need full working instance with a minimum of data to run the tests.
- The tests assume you have an instance running on 'http://localhost:5000/mapsearch'.
However, you can override this by setting the *environment variable* MAPSEARCH_INSTANCE_URL appropriately.
```
export MAPSEARCH_INSTANCE_URL="http://ckan.bopen.eu/mapsearch"
```
LICENSE
=======
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
Acknowledgements
================
The development of this software, up to version *0.1.2*, has been partially funded by `Filas `_ under `POR FESR Lazio 2007-2013 `_.