Commit Graph

486 Commits

Author SHA1 Message Date
amercader 2f28c8c5c7 [#37] Add support for MapBox tiles and others
The common map function has been extended to allow configuring different
options for the base layer. There are default presets for MapQuest and
MapBox, but any XYZ layer can be added configuration options. The
options are passed to the templates via a helper function and to the js
modules via data-module attributes. Full docs included.
2013-10-06 23:22:04 +01:00
amercader 8a48ceb0e7 Merge branch 'master' of git://github.com/FuhuXia/ckanext-spatial into FuhuXia-master 2013-10-04 15:45:44 +01:00
fxia a19010d8e5 for progress, use gemini_values not iso_values 2013-09-10 10:57:15 -04:00
amercader f7f1a72df8 Remove progress field from tests 2013-09-10 11:08:06 +01:00
amercader 8ffc392f40 Merge branch 'master' of git://github.com/FuhuXia/ckanext-spatial into FuhuXia-master 2013-09-10 11:00:15 +01:00
fxia c1fe37647f change progress multiplicity to * 2013-09-09 14:47:14 -04:00
amercader 028d26e6e0 [#37] Common function for initializing maps
This avoids duplication, mkaes all map consistent and makes easier
future support for other base maps.
2013-08-30 17:10:11 +01:00
amercader b371aee381 [#36] Fix spatial query widget for CKAN 2.1 2013-08-30 16:26:02 +01:00
fxia a9414e755d add progress into the iso values 2013-08-29 00:05:24 -04:00
amercader 3f784de737 Merge branch 'master' into 24-pycsw-integration-command
Conflicts:
	README.rst
2013-08-20 14:35:53 +01:00
amercader c6e29ee25f [#35] Ignore auth when using site_user 2013-08-14 12:23:00 +01:00
amercader 5f56877eba Merge branch '29-new-preview-interface' 2013-08-08 17:52:05 +01:00
amercader 063a1b8530 [#26] Fix broken markers on debug mode 2013-08-08 17:33:56 +01:00
amercader 19ea9b1753 [#32] Do not set height to avoid scrollbars if container is less than 600px 2013-08-08 17:31:21 +01:00
amercader 28042d2b6f [#28] Fix function name 2013-07-29 17:25:04 +01:00
amercader 14048a153c [#31] Check if sort parameter exists 2013-07-29 17:23:21 +01:00
Dominik Moritz f0aa5076a0 [#29] Fix missing variable 2013-07-19 23:04:49 +02:00
Dominik Moritz f4ea4da3e0 [#29] Use new precedence feature for previews. 2013-07-19 12:35:35 +02:00
amercader 44e4ae380a [#24] Document CKAN-pycsw integration
Ad overview of how it works, how to set it up and deploy it in a
production server.
2013-06-21 13:21:30 +01:00
amercader 67b0941b3b [#24] Add clear command to empty the pycsw table 2013-06-20 16:45:37 +01:00
amercader 7b65813cba [#24] Add command for pycsw integration
Based on the work by @kindly on https://github.com/kindly/ckan_pycsw_import,
adds a command to the extension that allows to export easily the spatial
datasets to pycsw. This will only work for harvested ISO datasets for the time
being.

The command can be run both via paster (in the context of a CKAN install) or
independently (eg a separate server), as it uses the API to get the datasets.

TODO docs
2013-06-20 16:44:56 +01:00
amercader d8ed7c03cd Merge branch '21-geojson-preview' 2013-06-14 17:56:26 +01:00
amercader e30b662a36 [#21] Make popup table match the rest of CKAN tables 2013-06-14 17:53:38 +01:00
amercader f8dd4c02bd [#21] Fix i18n calls
All the 'self' on the 'showError' function should be 'this', otherwise you
will refer to the window. Also 'this.i18n' assumes an 'i18n' key in the
module options. Looks like you are trying to pass some variables to the
string template, note the sprintf-like syntax.
2013-06-14 17:39:58 +01:00
amercader a4b8ddb7db Merge branch 'master' of github.com:okfn/ckanext-spatial 2013-06-14 16:01:49 +01:00
amercader 9eec88b320 [#15] Check CKAN version when using the Solr Search backend 2013-06-14 15:59:45 +01:00
Dominik Moritz fe8c469c12 [#21] show object in popup, fix layout 2013-06-14 13:23:06 +02:00
Dominik Moritz 6eb180c02a [#21] Add properties information to popup, lighter style 2013-06-13 23:24:01 +02:00
Dominik Moritz 64d1846e90 [#21] Add basic GeoJSON preview and fix set up of wms preview 2013-06-13 22:51:01 +02:00
kindly add78d5931 allow csw to fetch differen output schema 2013-05-18 18:28:25 +01:00
amercader 27521221d6 [#20] Flag datasets created via the spatial harvesters via a generic extra 2013-05-15 16:58:12 +01:00
amercader 8e81d1bd69 [#19] Extract thumbnail from ISO documents 2013-05-15 16:41:36 +01:00
amercader b4a7cf2289 [#15] Reenable the Solr backend on master
It can be used against CKAN core master (eventually 2.1)
2013-05-14 14:34:10 +01:00
amercader ce8747198f Merge branch 'release-v2.0'
Conflicts:
	README.rst
	ckanext/spatial/commands/validation.py
	ckanext/spatial/controllers/api.py
	ckanext/spatial/harvesters/gemini.py
	ckanext/spatial/plugin.py
	ckanext/spatial/tests/lib/test_spatial.py
	ckanext/spatial/tests/model/test_harvested_metadata.py
	ckanext/spatial/tests/test_harvest.py
2013-05-14 14:02:28 +01:00
amercader 7919a19f7c Revert "[#15] Add suport for Solr spatial indexing and querying"
Reverting #15 as CKAN 2.0 does not include the necessary changes.

This reverts commit c7a9cc660f.
2013-05-13 18:55:32 +01:00
amercader 83d903f84f Revert "[#15] Ensure that bounding boxes are defined counter-clockwise"
Reverting #15 as CKAN 2.0 does not include the necessary changes.

This reverts commit fede0b0831.
2013-05-13 18:55:27 +01:00
amercader 5e35ac0fcb Revert "[#15] Read search backend config option once only"
Reverting #15 as CKAN 2.0 does not include the necessary changes.

This reverts commit d11693f076.

Conflicts:

	ckanext/spatial/plugin.py
2013-05-13 18:55:12 +01:00
amercader 17796c4ad0 Revert "[#15] Add a new Solr search backend based on boost function"
Reverting #15 as CKAN 2.0 does not include the necessary changes.

This reverts commit bddfdf6fba.

Conflicts:

	ckanext/spatial/plugin.py
2013-05-13 18:53:09 +01:00
amercader 72127fa151 Revert "[#15] Tweak doc to remove paper"
Reverting #15 as CKAN 2.0 does not include the necessary changes.

This reverts commit cf22017b7d.
2013-05-13 18:51:44 +01:00
amercader 6f3c699311 [#7] Remove old genshi spatial query widget 2013-05-13 17:13:19 +01:00
amercader 7e10eb9c16 [#7] Allow to customize the default extent for the spatial query widget 2013-05-13 16:59:49 +01:00
amercader af253d0f89 [#7] Spatial search widget for 2.0
Adds a new map widget to the 2.0 search templates. It is shown initially
in the sidebar but it is expanded when the user needs to draw an area.
It uses Leaflet and Leaflet.draw.
2013-05-13 16:14:48 +01:00
amercader 45f4f4da57 [#16] Ignore time zones when parsing harvest object modified date
Otherwise you get this exception when the date on the document has time
zone information, as dates as stored without it on the database:

TypeError: can't compare offset-naive and offset-aware datetimes
2013-04-25 17:13:03 +01:00
amercader a4c86d26e3 [#15] Better checks following 27d4d5 2013-04-12 16:44:52 +01:00
Ian Ward 27d4d5b2c9 make spatial field optional 2013-04-12 16:39:38 +01:00
amercader 51a2b20501 Merge branch '15-solr-based-spatial-search' into release-v2.0 2013-04-12 10:56:21 +01:00
amercader 822ddbb1b5 [#8] Don't add object id to error so it can be aggregated 2013-04-12 10:54:02 +01:00
amercader cf22017b7d [#15] Tweak doc to remove paper 2013-04-12 10:06:50 +01:00
amercader bddfdf6fba [#15] Add a new Solr search backend based on boost function
This backend does not use the spatial field on Solr, but indexes the
area and coordinates of the dataset's extent. On query time, a boost
function is used to calculate a ratio between the query area and the
dataset extent, which will give a value of 0 for areas that don't
overlap and 1 for a perfect fit. The same function is used both for
sorting and filtering.
2013-04-11 19:29:41 +01:00
amercader d11693f076 [#15] Read search backend config option once only 2013-04-11 17:13:53 +01:00
amercader 970dfd1b68 Merge branch 'release-v2.0' into 15-solr-based-spatial-search 2013-04-11 12:51:08 +01:00
kindly d1594b3790 do not use kwarg for unicode errors 2013-04-09 12:06:38 +01:00
amercader 65e056d519 Merge branch 'release-v2.0' into 15-solr-based-spatial-search 2013-04-03 12:14:20 +01:00
amercader ff25ff2f2b [#8] Abort import stage if get_package_dict returns nothing 2013-04-02 18:40:03 +01:00
amercader 9760546d13 [#8] Add extra xpath for getting resources
According to the ISO spec gmd:MD_DigitalTransferOptions can be accessed
via a gmd:MD_Distributer tag
2013-03-27 17:39:51 +00:00
amercader 0c98e6ec4c [#8] Minor fix in single doc harvester 2013-03-27 17:38:42 +00:00
amercader fede0b0831 [#15] Ensure that bounding boxes are defined counter-clockwise
To return correct results on a spatial query, rectangle geometries must
be defined in counter-clockwise order [1]. This changeset adds a small
sanity check to before_index when we are dealing with a Polygon geometry
that has 5 coordinate pairs. Shapely is used to generate a LinearRing
from the polygon coordinates and check if they are ccw. If not, they are
reordered and a new polygon is generated so the WKT sent to Solr is
properly ordered.

The GeoJSON template used for extents in the base spatial harvester has
been also updated to define the coordinates counter-clockwise.

[1]
http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4#JTS_.2BAC8_WKT_.2BAC8_Polygon_notes
2013-03-23 19:28:31 +00:00
amercader 40967385b0 [#8] Fix typo in WMS format detection 2013-03-21 17:53:38 +00:00
amercader 0e0b5a2cc2 [#8] Fix bug that prevented setting a default resource name 2013-03-21 14:34:42 +00:00
amercader 627c4c58e0 [#8] Fix bug that prevented setting a default resource name 2013-03-21 14:34:23 +00:00
amercader c7a9cc660f [#15] Add suport for Solr spatial indexing and querying
When the 'ckanext.spatial.search_backend' config option is set to
'solr', the extension will index geometries stored in the 'spatial'
extra on the spatial field of the Solr index (named 'spatial_geom').
This is done on the 'before_index' extension point.

Also, when doing a query, if the same config option is in place, the
necessary fq parameter will be set to pass the spatial query to Solr.
2013-03-20 16:54:55 +00:00
amercader a727aa815b Add helper functions useful to format extras coming from the spatial harvesters 2013-03-18 15:59:20 +00:00
amercader a7fc19768b [#8] Remove print commands from WAF harvester 2013-03-14 17:45:34 +00:00
amercader eb201e1759 [#8] Waf harvester: improve exception and return empty list if no records 2013-03-14 17:35:51 +00:00
amercader 0aafffc8dc [#8] Capture exceptions during request in WAF harvester 2013-03-14 14:56:42 +00:00
amercader d2723c3020 [#8] resource-type not always present 2013-03-14 14:30:16 +00:00
amercader a76a8d2ca7 [#8] Don't use object id so messages can be grouped 2013-03-14 12:37:35 +00:00
amercader 4638b3899f Revert "[#8] Don't use object id so messages can be grouped"
This reverts commit 032cc4d961.
2013-03-14 12:36:39 +00:00
amercader 032cc4d961 [#8] Don't use object id so messages can be grouped 2013-03-14 12:34:20 +00:00
amercader da1dc02c7e [#8] Improve fields returned in the package dict
Make them less uklp specific and more parse friendly. Helper functions
should be used in the UI to format them nicely.
2013-03-08 18:57:30 +00:00
amercader 724ef6ed7c [#8] Fix gemini harvester after change in spatial field 2013-03-08 18:56:03 +00:00
amercader e7f70c4f85 [#8] Fix KeyError in point template 2013-03-05 18:38:55 +00:00
amercader 7c5071bfc2 [#8] Sanitize bbox before creating spatial extra
Some common problems:
* Whitespace, tabs, line feeds and plus signs: should be handled by
  float()
* Text: log error and skip creation of spatial extra
* Same set of 2 coords for extent: create point instead of polygon

Note that the bbox values are stored as they are in the bbox-xx-yy
extras
2013-03-05 18:31:49 +00:00
amercader d158a6c684 [#8] Change 'Resource locator' string for unnamed resources
'Resource locator' was confusing, has been replaced by 'Unnamed
resource' and made translatable. Also don't set description if not
present, set name.
2013-03-04 17:55:34 +00:00
amercader d43cbb8800 [#8] Improve resource format detection
The 'guess_resource_format' function looks for common patterns in popular
geospatial services and file extensions. It just looks at the provided URL,
it does not attempt to perform any remote check. By default, it will use the
mimetypes module if no match was found before to try to guess the format.

On the previous version, all resources in documents of type 'service' were
queried to see if they were actually WMS. This is no longer the case,
but services flagged as 'wms' can be verified if the following setting
is set to True: ckanext.spatial.harvest.validate_wms
2013-03-04 17:44:18 +00:00
amercader da5b37bc45 [#8] Fix typo in GeoJSON template 2013-03-01 17:42:51 +00:00
amercader d5461477aa [#8] Do not add XML declaration when storing the content
Rather than store the XML declaration in the DB, we add it if not present
when outputing the contents (Also in ckanext-harvest's show_object)
2013-03-01 17:33:53 +00:00
amercader d7d49c37e5 [#8] Check if tags exist on get_package_dict 2013-02-25 16:03:36 +00:00
amercader 5aeaa209ed Fix bug in spatial query sorting 2013-02-20 12:09:50 +00:00
amercader cc60327d0b [#10] Improve harvested metadata API
Some improvements on the endpoints that return the contents of the
harvest objects:

* Nicer URLs with redirects to the old ones
* Returning the raw harvest object content is available on the main
 harvest extension, so just redirect there
* Support for showing the original document of a harvest object, if
 present
* Suport for defining a custom XSLT for the HTML view, via

ckanext.spatial.harvest.xslt_html_content
ckanext.spatial.harvest.xslt_html_content_original
2013-02-19 18:38:15 +00:00
amercader 8647f90cb6 [#8] Clean up base harvester, docstrings, some pep8 2013-02-18 18:17:36 +00:00
amercader 6783d58006 [#8] Add support for import command to new harvester
The import CLI reruns the import stage for the last current objects, so
when running it, the previous objects don't need to be changed. Any
date check is overridden to force the update of the package.
2013-02-18 17:19:14 +00:00
amercader 1ffe8fc902 [#8] Use plugins toolkit whenever possible 2013-02-15 15:03:03 +00:00
amercader 32a93b8ec8 [#8] Add get_extra to SpatialHarvester class 2013-02-15 14:56:00 +00:00
amercader 4964ce9ec3 [#8] Provide a config option to continue after validation errors
This can be set instance wide on the ini file with

ckanext.spatial.harvest.continue_on_validation_errors

or per source, adding continue_on_validation_errors=true to the source
config.
2013-02-15 14:47:25 +00:00
amercader 596bdbf5d0 [#8] Minor tweak to source_config 2013-02-15 12:50:09 +00:00
amercader 2ff5a11911 [#8] Use site user for harvesting actions
You don't need to create a 'harvest' sysadmin user any more.
By default this will be the internal site admin user. This is the
recommended setting, but if necessary it can be overridden by
the `ckanext.spatial.harvest.user_name` config option, eg to
support the old hardcoded 'harvest' user
2013-02-15 12:28:58 +00:00
amercader baf7b5da67 [#8] Rename harvested document model to ISODocument
GeminiDocument has been kept for backwards incompatibility.
2013-02-13 19:16:36 +00:00
amercader dadd174293 [#8] Make sure only list and dict extras are dumped as JSON 2013-02-13 18:48:53 +00:00
amercader 00a0b5946b [#8] Add transform_to_iso method
This can be overridden by custom harvesters willing to support non ISO
formats (like FGDC). It is called whrn the original_document and
original_format harvest object extras are present. Custom harvesters are
responsible for transforming the original document to ISO.
2013-02-13 18:33:58 +00:00
amercader 641ffad589 Remove silly debug message 2013-02-13 17:49:15 +00:00
amercader 305951aeb5 [#8] Make get_package_dict public and document
So it is more obvious that it can be overridden by custom harvesters.
2013-02-13 17:06:01 +00:00
amercader 1d8a4c17c4 [#8] Update harvesters for CsW, WAF and Doc sources
These are the new versions of the spatial harvesters with significant
improvement over previous ones.
2013-02-12 18:29:30 +00:00
amercader f153b0f4ba [#8] Minor fixes in base harvester 2013-02-12 18:26:03 +00:00
amercader c7d872af7e [#8] Rename source config object and method to avoid confusion 2013-02-12 18:07:05 +00:00
amercader 24270cb4cb [#8] Move Gemini harvesters and updated base harvester to own files
Prior to the merging of the new spatial harvesters, the existing ones
based on Gemini and UKLP have been moved to their own namespace
(ckanext.spatial.harvesters.gemini). The plugin points have been updated
so users currently using these harvesters will still be able to use them
as normal.

The base harvester (SpatialHarvester) has been updated with new methods,
most significally '_get_package_dict' and 'import_stage'. Note that
SpatialHarvester now extends HarvesterBase on ckanext-harvest, which had
some of its methods updated.

TODO: still some geo.data.gov specific bits!
2013-02-12 17:40:41 +00:00
amercader b7f486ce04 [#8] Adapt model parsing code to make it ISO 19115 friendly
Changes in multiplicity to support the ISO 19115 spec rather than just
the Gemini 2 one. Thanks to @dread for his help on this.

Summary of the changes:

* dataset-reference-date: Set to 1..*
Note that there was a bug with mutliple values allowed per date.
Returned object should now be like:
 "dataset-reference-date": [{"type": "creation", "value": "2004-02"},
{"type": "revision", "value": "2006-07-03"}]

* metadata-languge: Set to 0..1

* resource-type: Set to *. That means that a list is now returned

* bbox: Set to *. Note that bboxes are now returned as objects such as:
[{"north":xxx, "south":xxx,, "east":xxx, "west":xxx}, {"north":xxx,
  "south":xxx,, "east":xxx, "west":xxx}]

The existing Gemini based harvesters and validators have been adapted,
all tests pass.
2013-02-11 17:35:06 +00:00
amercader 672e168bfa [#8] Adapt harvest tests to CKAN 2.0
Add new mandatory fields when creating sources, status dict has new
keys, CKAN lower cases formats, take into account harvest source
datasets.

Added a local getcapabilities response to avoid remote 404s.

Note that the TestValidation tests need to be fixed, as 27c4ee81e
removed the validation from the gather stage.
2013-02-11 16:57:38 +00:00
David Read b0312ed3a5 Conflicts:
ckanext/spatial/harvesters.py
	ckanext/spatial/tests/test_harvest.py
2013-02-08 17:47:32 +00:00
David Read fe2ebe016f Conflicts:
ckanext/spatial/harvesters.py
2013-02-08 17:40:19 +00:00
David Read f7d23dd576 #154 Gemini schematron 1.3 has been accepted, so loses the "a" suffix. 2013-02-08 17:38:41 +00:00
David Read aa080e9f75 #noticket No functionality has changed! Factored out responsible_organisation stuff into a separate method to add tests to show what it does. 2013-02-08 17:38:05 +00:00
David Read 9daff6a5b2 #noticket Tests added to clarify license URL extraction. 2013-02-08 17:36:34 +00:00
David Read e20080e69d Latest schematron added. FCSC is a good test of it. 2013-02-08 17:35:31 +00:00
David Read 6e23ae55c8 Relaxed "Multiplicity Check" so that it does not raise Exceptions any more - just log errors. This is because they are simply duplicates of the Gemini Schematron. Adria agreed these will be deleted anyway in 2.0. 2013-02-08 17:34:43 +00:00
David Read 779e00cd75 [xs] Improve docstrings and error messages. 2013-02-08 17:33:42 +00:00
David Read 5bcffdf14b More debug logging added to WAF harvester. 2013-02-08 17:33:16 +00:00
David Read 44728f12f7 Add XSL for converting Gemini XML to nice HTML, used in controllers/api.py. 2013-02-08 17:31:34 +00:00
David Read bcdf360b01 Spatial query can now be ordered. Does not play nicely with SOLR options - just uses that to get the facets counts and return each result. Have added performance tests for two alternative queries.
- Added a config option ('ckanext.spatial.use_postgis_sorting') to
activate this as this behaviour will be deprecated in the future
in favour of Solr 4 spatial sorting capabilities.
Also fixed the tests

Conflicts:

	ckanext/spatial/plugin.py
2013-02-08 17:28:37 +00:00
David Read fb4b041b30 Adding Parslow constraints schema previously missed. 2013-02-08 16:41:44 +00:00
David Read 8e0f7c7148 Added lower level tests for bbox search (at the lib level), complementing the API level ones.
Conflicts:

	ckanext/spatial/plugin.py
2013-02-08 16:41:02 +00:00
David Read 46fb0030a5 Comments about on cardinality/multiplicity. 2013-02-08 16:38:14 +00:00
David Read d2c97fe3cc Added new Parslow Constraints Schematron to test. Added command to validate on the command-line. 2013-02-08 16:37:44 +00:00
David Read 9ea3295b46 Get the validation XML to be included in the distribution. 2013-02-08 16:36:36 +00:00
David Read 892b44a3b3 Added useful logging to the validation report. Useful to have the date (i.e. version) in the name of the Eden schema. 2013-02-08 16:35:59 +00:00
David Read c6ac9494a2 Revert "#276 Coupled resources - first iteration."
Reverting changes for "#276 Coupled Resource" on master as it is INSPIRE-specific. Moving to datagovuk/ckanext-spatial branch dgu.

This reverts commit 91e547a622.
2013-02-04 16:07:19 +00:00
David Read f4e3cfad00 Revert "#276 Coupled resources - second iteration. Just need to update harvester now."
Reverting changes for "#276 Coupled Resource" on master as it is INSPIRE-specific. Moving to datagovuk/ckanext-spatial branch dgu.

This reverts commit ecd6036efe.
2013-02-04 16:07:03 +00:00
David Read c771a76e3d Revert "#276 Coupled Resource table now gets updated during harvest."
Reverting changes for "#276 Coupled Resource" on master as it is INSPIRE-specific. Moving to datagovuk/ckanext-spatial branch dgu.

This reverts commit 01536873b9.

Conflicts:

	ckanext/spatial/harvesters.py
2013-02-04 16:03:50 +00:00
David Read 84b75ea759 Revert "#276 Coupled Resource - fix to not show withdrawn packages in list of coupled resources."
Reverting changes for "#276 Coupled Resource" on master as it is INSPIRE-specific. Moving to datagovuk/ckanext-spatial branch dgu.

This reverts commit 3f627d9700.
2013-02-04 16:00:34 +00:00
David Read 27c4ee81e2 #287 Avoid doing extra validation for WAF in the gather stage. 2013-02-02 00:06:33 +00:00
David Read 3f627d9700 #276 Coupled Resource - fix to not show withdrawn packages in list of coupled resources. 2013-02-01 23:10:58 +00:00
David Read 3eee0be135 #noticket Bugfix - diff (when harvest content changed without timestamp change) displayed raw html. 2013-02-01 18:09:12 +00:00
David Read cdabab12cd #154 Gemini schematron 1.3 has been accepted, so loses the "a" suffix. 2013-02-01 14:00:51 +00:00
David Read 73af616b81 #noticket No functionality has changed! Factored out responsible_organisation stuff into a separate method to add tests to show what it does. 2013-02-01 12:04:50 +00:00
David Read 01536873b9 #276 Coupled Resource table now gets updated during harvest. 2013-01-31 18:05:48 +00:00
David Read 2cef9d6dae #noticket Tests added to clarify license URL extraction. 2013-01-31 14:32:19 +00:00
David Read ecd6036efe #276 Coupled resources - second iteration. Just need to update harvester now. 2013-01-28 23:56:12 +00:00
David Read 91e547a622 #276 Coupled resources - first iteration. 2013-01-28 21:53:15 +00:00
David Read 775a57d1f5 Latest schematron added. FCSC is a good test of it. 2013-01-24 11:30:23 +00:00
David Read 70c3eccdf5 Relaxed "Multiplicity Check" so that it does not raise Exceptions any more - just log errors. This is because they are simply duplicates of the Gemini Schematron. Adria agreed these will be deleted anyway in 2.0. 2013-01-21 17:22:24 +00:00
amercader 461607f06f Merge branch 'release-v2.0' into 2.0-validation-changes 2013-01-21 16:30:59 +00:00
amercader fd1071959e [#6] Move to Leaflet for dataset map widget
For this particular use case Leaflet offered the best option. Also
solves the issue when showing extent covering the whole world.
2013-01-18 15:12:09 +00:00
amercader 66b72163d5 Remove stuff from html.py
The rest will eventually go when we migrate the spatial search snippet.
2013-01-18 15:11:06 +00:00
amercader 70f7f6144b Factor out DGU code from the dataset map
It now lives in the DGU extension:

https://github.com/datagovuk/ckanext-dgu/blob/master/ckanext/dgu/theme/public/scripts/dgu-dataset-map.js
2013-01-18 13:32:30 +00:00
amercader 3da5807eb4 [#6] Update dataset map to be a pure snippet
No need to load an extension.
2013-01-18 13:07:26 +00:00
David Read 1622223a38 [xs] Improve docstrings and error messages. 2013-01-16 22:22:39 +00:00
David Read 7841691fc3 More debug logging added to WAF harvester. 2013-01-16 13:10:32 +00:00
David Read 348c1c4dc1 Add XSL for converting Gemini XML to nice HTML, used in controllers/api.py. 2013-01-16 13:08:28 +00:00
amercader 21a85a6b3f [#4] Register resources only once for all plugins
spatial_metadata will load the resources (public, templates and
resources) for all plugins to use, as it needs to be loaded anyway.
2013-01-15 20:00:46 +00:00
amercader 7abfb4eb61 Use plugins toolkit whenver possible on plugin.py 2013-01-15 19:57:31 +00:00
amercader da7bb48eb5 Merge branch 'release-v2.0' into 2.0-validation-changes 2013-01-14 14:03:04 +00:00
amercader 711391e971 [#4] Rewrtie WMS preview plugin for ResourcePreview interface
Much simplified plugin for previewing WMS. It requires the
resource_proxy plugin to work.

Also clean up public and template dir to mimic core layout.
2013-01-14 13:59:15 +00:00
kindly 4e47141717 add extra resource locator 2012-12-24 10:43:44 +00:00
amercader c927d8b6ab Add method for adding custom validators
This probably needs to be done properly, adding them once on startup
somehow.
2012-12-20 18:26:40 +00:00
David Read 6fcbf878c2 Spatial query can now be ordered. Does not play nicely with SOLR options - just uses that to get the facets counts and return each result. Have added performance tests for two alternative queries. 2012-12-06 18:17:45 +00:00
David Read 36905eed17 Adding Parslow constraints schema previously missed. 2012-12-05 15:02:27 +00:00
David Read 68f22147bc Added lower level tests for bbox search (at the lib level), complementing the API level ones. 2012-12-05 15:01:16 +00:00
David Read df884bdd3d Comments about on cardinality/multiplicity. 2012-12-05 12:05:45 +00:00
David Read 20e1a59227 Added new Parslow Constraints Schematron to test. Added command to validate on the command-line. 2012-12-05 11:42:57 +00:00
amercader 615a58ce93 Reduce log level for harvest object errors 2012-11-21 16:22:55 +00:00
amercader 9ea721e256 Encode remote documents from CSW servers as unicode 2012-11-20 15:42:07 +00:00
amercader 6cf7f79942 Save line if present when storing object errors 2012-11-20 11:47:04 +00:00
amercader 7113466760 Update harvesters to new validator outputs 2012-11-19 18:12:40 +00:00
amercader e12e38cab0 Improvements on the validation code
To make easier to filter and display errors on the UI, the validators
have been modified to return the message and line number separately. The
return format for validators is now:

(is_valid, [(error_message_string, error_line_number)])

Also the XSD based validators were returning only the last error found on
the document, instead of iterating the whole error log. Harvesters should
create a harvest object error for each of this validation errors.

Tests have been adapted to these changes.
2012-11-19 17:15:16 +00:00
amercader 0379852fe0 Merge branch '2641-spatial-widgets-new-theme' into release-v2.0 2012-11-12 16:44:05 +00:00
amercader b82dd4a9c0 Merge branch 'csw-harvester-enhancements' into release-v2.0 2012-11-12 16:43:52 +00:00
David Read ccbac9c3c5 Get the validation XML to be included in the distribution. 2012-11-07 16:23:27 +00:00
amercader a84268abf6 Don't trust the number of records returned by the remote server
Sometimes, even when requesting 10 records, the CSW server returns less
of them (see eg http://goo.gl/b7Rdj, only 9 records returned). The
current check made the process stop on this case, missing other
identifiers.
2012-11-02 11:12:46 +00:00
amercader 0444c14da2 Better check for config object 2012-10-30 16:40:32 +00:00
amercader 99dc2a7c55 Allow to define the validation profiles via source config
The profiles used are decided as follows:

1. 'validator_profiles' property of the harvest source config
object
2. 'ckan.spatial.validator.profiles' configuration option in
the ini file
3. Default value as defined in DEFAULT_VALIDATOR_PROFILES
2012-10-30 14:18:01 +00:00
David Read a45ff0c75f Merge branch 'master' of github.com:okfn/ckanext-spatial 2012-10-30 09:34:48 +00:00
David Read ee543df158 Added useful logging to the validation report. Useful to have the date (i.e. version) in the name of the Eden schema. 2012-10-30 09:34:40 +00:00
amercader ac7947549e Remove unused imports 2012-10-29 16:35:52 +00:00
amercader 9e9048c272 Add validator for FGDC XSD schema 2012-10-29 14:34:29 +00:00
amercader 9488ecd5a9 Add validator for ISO 19139 NGDC XSD schema 2012-10-29 14:28:58 +00:00
amercader c1d2a479f2 Add traceback to exception when getting CSW identifiers 2012-10-23 18:57:11 +01:00
amercader 92b781d0f1 Minor model tweaks to support parsing generic ISO documents 2012-10-23 13:03:53 +01:00
amercader aeb7d27bab Fix failing tests
The WMS one is just skipped, until we have a more clear way of how the
previews will work.
2012-10-22 19:44:33 +01:00
amercader 7f58374ac7 Enable command line interface for validation, useful for debug 2012-10-22 19:39:07 +01:00
amercader d95602eaff Fix wrong resource paths on validation 2012-10-22 19:37:54 +01:00
amercader 019cb3b45f Fix wrong imports and docs 2012-10-22 19:36:03 +01:00
David Read d90114cf07 Added ability to produce report into validation errors, for when changing validation. Added report infrastructure. 2012-10-19 18:20:32 +01:00
David Read 0e8a62fe1e Reorganise XML test files into more sensible directory names. Add lower level validation tests. 2012-10-19 14:23:34 +01:00
David Read 2d6f497720 Missed off some files from the previous commit., 2012-10-19 12:14:09 +01:00
David Read 20e8f12615 Merged in ckanext-inspire.
Tests are passing, apart from a couple which didn't work before:
* test_functional.py -> functional/test_package.py (3 failures in 4)
* functional/test_dataset_map.py (1 fail in 1)
There may be some code errors still untested.
Renamed Validator -> Validators to make more sense.
2012-10-19 11:19:01 +01:00
David Read 58fa06051d Added EDEN ISO10139 schema that was missed off before. 2012-10-17 17:08:20 +01:00
David Read 8181b3d3bf Merged in ckanext-csw @44d5a04656dff084e6bca57dda7b63deec69778c. Not tested yet. 2012-10-17 16:59:02 +01:00
amercader a84034d902 Merge branch '2641-spatial-widgets-new-theme' of github.com:okfn/ckanext-spatial into 2641-spatial-widgets-new-theme 2012-10-17 13:03:11 +01:00
amercader 3bb174d56d Update WMS viewer prototype to work with the new iframe on resource read page 2012-10-17 13:02:57 +01:00
amercader 80b8bc33c6 Update jquery path 2012-09-28 12:20:37 +01:00
amercader efa2307ee5 [wms] Fix small bug 2012-08-14 12:48:39 +01:00
amercader d841bb2c17 [wms] Fix typo 2012-08-13 18:52:30 +01:00
amercader 231f5806e9 [wms] Support for map param 2012-08-13 17:50:33 +01:00
amercader 917ce0124e Merge branch '2641-spatial-widgets-new-theme' of github.com:okfn/ckanext-spatial into 2641-spatial-widgets-new-theme 2012-08-13 17:09:32 +01:00
amercader 4ca61fd48b [wms] First go at adapting the WMS previewer to the new theme 2012-08-13 17:09:08 +01:00
amercader 01d6441886 [wms] More flexible wms format check 2012-08-13 17:07:59 +01:00
amercader 100b54d119 Merge branch 'master' into 2641-spatial-widgets-new-theme 2012-08-09 11:05:14 +01:00
amercader b784be8f9e Do not use repo.are_tables_created
When checking whether the core tables have been alredy created  it is
best to use package_table.exists(), as are_tables_created reflects the
tables, causing conflicts with other extensions.

This allows ckanext-harvest and ckanext-spatial to be used together on
ckan 1.8 onwards.
2012-08-09 11:02:13 +01:00
amercader 9bc3759bd1 Update tests for auth changes in core (#2388) 2012-07-12 19:13:21 +01:00
amercader a42dcd632f [#2641] Move snippet template to follow new convention 2012-07-12 11:59:35 +01:00
amercader 87de1280f2 [#2641] Adapt dataset map to new theme
The new theme is based on Jinja2 templates. Extensions can define their
own snippets, which can used when creating custom themes. In this case
two snippets have been created, one showing the map on the primary area
and the other on the sidebar.
2012-07-11 18:24:49 +01:00
amercader 493589aaf1 [#2399] Fixes for CKAN 1.8
* Fix broken imports in model after cleanup
* Minor CSS glitch on the spatial filter widget
2012-06-25 19:27:18 +01:00
David Read 745bed4e77 Customising extent map for dgu. 2012-05-22 10:51:44 +01:00
amercader 1ffe6f42d1 [ui] Fix alignment and button classes (update to latest bootstrap) 2012-05-08 14:19:28 +01:00
amercader e18f3210b8 [ui] Update button classes to bootstrap 2012-05-08 14:00:19 +01:00
amercader cafc0b9644 [tests] Fix test for changes in logic layer 2012-04-29 18:17:13 +01:00
David Read 8010c1e16b Stray comma caused IE7 to barf. 2012-04-27 15:04:22 +01:00
David Read e19227fe61 Added option for OS tiles (subject to licence). 2012-04-27 13:06:20 +01:00
David Read 8f4ae04570 Allow extent map to be shown on configurable routes. 2012-04-27 10:44:15 +01:00
amercader 23f392bb4c Merge branch 'master' of github.com:okfn/ckanext-spatial 2012-04-16 10:33:11 +02:00
amercader 60bc030e7d [tests] Update package create functions to logic refactor 2012-04-13 10:59:21 +01:00
amercader 82e3f90fb3 [cli] Srid param was not passed from the cli 2012-04-13 10:58:39 +01:00
David Read 2ecb8498bf Geographic extent now looks for id="dataset" because DGU templates use multiple classes for the root dataset div (as might other customised templates), yet having only one value for id is a reasonable assumption. Also works for core CKAN templates. 2012-04-12 21:35:38 +01:00
David Read 7280bc8d06 Tweaked instructions. 2012-04-12 19:49:12 +01:00
amercader a68d31abf7 [wms_preview] Fix url generation bug 2012-04-03 13:52:40 +01:00
amercader 939e4e4efa [plugin] Fix import from the core logic layer 2012-03-07 15:07:37 +00:00
amercader 0c6d0f7e48 [search] Maintain previous extent when filtering by area 2012-02-22 17:25:06 +00:00
amercader 25470e3a43 [tests] Add tests for spatial search integration and search widget 2012-02-22 12:26:52 +00:00
amercader a77e0ef2c3 [plugins, docs] Rearrange plugins
Separate different features to make it more flexible for users
to load different stuff depending on their needs and the CKAN
version they are using.
2012-02-21 12:00:47 +00:00
amercader 1f829b3031 [search] Add option to define a default extent 2012-02-21 11:05:13 +00:00
amercader 1d1f88195f Merge from master 2012-02-20 18:13:33 +00:00
amercader 43c997dee7 [model,tests] Better handling of model initialization on startup 2012-02-07 16:50:46 +00:00
amercader 51a8dfa857 [dataset_map] Use MapQuest tiles instead of OSM ones
Because of http://wiki.openstreetmap.org/wiki/Tile_usage_policy
2012-01-20 16:19:08 +00:00
amercader a20688a453 [search][#1469] Map widget for the spatial search UI
TODO: integrate better with the general look and feel.
2012-01-18 11:03:21 +00:00
amercader 03fd4c2b3c [search] Use before_search approach to integrate with Solr search
If filtering the results after the search, recalculating the facets
is too complicated, so we use the alternative approach of doing the
spatial search first and adding the ids as a filter in the Solr query.
2012-01-17 17:20:16 +00:00
amercader 95b6db2cfe [search] Update search plugin hook name 2012-01-17 10:44:25 +00:00
amercader 203558e97b [search] Integrate spatial search with the default CKAN search
Search results coming from the default CKAN search (which are received
via the `search` method of the `IPackageController` interface) are
filtered to only contain the ones intersecting the provided bbox.

The search form temporarily shows a text field, which will be replaced
by a nice map widget.
2011-12-13 17:40:47 +00:00
Adrià Mercader 6f2b15f5ea [api] Return only packages with state = active 2011-11-14 18:00:56 +00:00
Adrià Mercader ab52106f20 Separate non-GEOS/PostGIS plugins to avoid needing to install them if not needed
I.e for the WMS preview plugin. Also add tests for the WMS preview plugin and
use dataset instead of package on the UI.
2011-10-28 13:03:31 +01:00
Adrià Mercader 571a27a274 [tests] Add tests 2011-10-16 23:40:19 +01:00
Adrià Mercader 0b7808cd4b Use datasets instead of packages 2011-10-03 13:39:18 +01:00
Adrià Mercader e5dbeb9ff8 [wms_preview] Remove sysadmin check for WMS preview 2011-09-30 14:38:11 +01:00
Adrià Mercader 1798f63a08 [wms_preview] Fix for #1166 (Less stringent filters for WMS preview)
If one of the dataset resources has a 'WMS' format, the link will be
displayed. Also support for URLs with query params.
2011-09-30 12:15:53 +01:00
Adrià Mercader 9b0d00786a Update and cleanup for WMS previewer. It is still very unstable and should be
considered alpha stage.
2011-09-30 11:57:09 +01:00
Adrià Mercader 0ac18ba0a9 New Dataset Map Widget plugin.
When enabled, if the dataset has an 'spatial' extra, it shows a map on the
details page. It uses OpenLayers and supports all types of geometries.
2011-09-30 11:33:36 +01:00
Adrià Mercader 40bddb0005 Use GeoAlchemy on the spatial query controller 2011-09-29 15:41:45 +01:00
Adrià Mercader fddc7db2c7 Support for automatic indexing of spatial extent (#1272)
The spatial_query plugin now automatically checks for the existance of an
'spatial' extra when creating, updating or deleting a package and syncs its
value (in GeoJSON format) with the geometry column of the package_extent
table. The extension now uses GeoAlchemy, that makes performing spatial
operation extremely easy. The geometry field has been updated to support
multiple geometry types (Polygons, Points, MultiPolygons...) and the default
srid has been set as WGS 84 lat/lon (EPSG:4326).
2011-09-29 15:40:49 +01:00
Adrià Mercader 33235748b0 Update imports for the API controller 2011-05-26 15:34:21 +01:00
james gardner b5c83ab578 [packaging] Working paths config 2011-04-20 11:59:00 +01:00
james gardner 6b5d260b0a [packaging] Moving the resources into the module, no resources need when deployed should ever be outside 2011-04-20 11:44:55 +01:00
Adrià Mercader e3f27aeea7 Don't use the spatial-reference-system extra as all bbox will be in lat/lon 2011-04-14 14:45:32 +01:00
Adrià Mercader 5e1ab19dfc Fix bug in params binding 2011-04-14 09:56:12 +01:00
Adrià Mercader 70976340da Add a command to create the necessary DB tables 2011-04-13 12:05:59 +01:00
Adrià Mercader 1710205cf9 Moving the spatial query. You can enable it loading the spatial_query plugin in the ini file. 2011-04-11 18:04:28 +01:00
Adrià Mercader 76183b6f23 Moving the WMS previewer. You can enable it loading the wms_preview plugin in the ini file 2011-04-11 17:23:27 +01:00
Adrià Mercader 6ae23e4116 Initial commit. This extension will hold geo-related functionalities moved from ckanext-harvest. 2011-04-11 16:53:47 +01:00