├── .github └── workflows │ └── test.yml ├── .gitignore ├── .gitmodules ├── .readthedocs.yaml ├── CHANGELOG.md ├── MANIFEST.in ├── README.rst ├── bin ├── __init__.py └── ckan_pycsw.py ├── ckanext ├── __init__.py └── spatial │ ├── __init__.py │ ├── cli.py │ ├── commands │ ├── __init__.py │ ├── csw.py │ └── validation.py │ ├── controllers │ ├── __init__.py │ └── api.py │ ├── harvested_metadata.py │ ├── harvesters │ ├── __init__.py │ ├── base.py │ ├── csw.py │ ├── doc.py │ ├── gemini.py │ └── waf.py │ ├── helpers.py │ ├── interfaces.py │ ├── lib │ ├── __init__.py │ ├── csw_client.py │ ├── report.py │ └── reports.py │ ├── plugin │ ├── __init__.py │ ├── flask_plugin.py │ └── pylons_plugin.py │ ├── public │ ├── css │ │ ├── common_map.css │ │ ├── dataset_map.css │ │ └── spatial_query.css │ ├── img │ │ ├── marker.png │ │ └── pencil.png │ ├── js │ │ ├── common_map.js │ │ ├── dataset_map.js │ │ ├── spatial_query.js │ │ └── vendor │ │ │ ├── leaflet-providers.js │ │ │ ├── leaflet.draw │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ └── 0.4.14 │ │ │ │ ├── MIT-LICENSE.md │ │ │ │ ├── images │ │ │ │ ├── layers-2x.png │ │ │ │ ├── layers.png │ │ │ │ ├── marker-icon-2x.png │ │ │ │ ├── marker-icon.png │ │ │ │ ├── marker-shadow.png │ │ │ │ ├── spritesheet-2x.png │ │ │ │ ├── spritesheet.png │ │ │ │ └── spritesheet.svg │ │ │ │ ├── leaflet.draw-src.css │ │ │ │ ├── leaflet.draw-src.js │ │ │ │ ├── leaflet.draw-src.map │ │ │ │ ├── leaflet.draw.css │ │ │ │ └── leaflet.draw.js │ │ │ └── leaflet │ │ │ ├── .gitignore │ │ │ ├── .npmignore │ │ │ ├── .travis.yml │ │ │ └── 1.9.3 │ │ │ ├── LICENSE │ │ │ ├── images │ │ │ ├── layers-2x.png │ │ │ ├── layers.png │ │ │ ├── marker-icon-2x.png │ │ │ ├── marker-icon.png │ │ │ └── marker-shadow.png │ │ │ ├── leaflet-src.esm.js │ │ │ ├── leaflet-src.esm.js.map │ │ │ ├── leaflet-src.js │ │ │ ├── leaflet-src.js.map │ │ │ ├── leaflet.css │ │ │ ├── leaflet.js │ │ │ └── leaflet.js.map │ ├── resource.config │ └── webassets.yml │ ├── search │ └── __init__.py │ ├── templates │ ├── ckanext │ │ └── spatial │ │ │ └── gemini2-html-stylesheet.xsl │ └── spatial │ │ └── snippets │ │ ├── dataset_map.html │ │ ├── dataset_map_asset.html │ │ ├── dataset_map_base.html │ │ ├── dataset_map_resource.html │ │ ├── dataset_map_sidebar.html │ │ ├── map_attribution.html │ │ ├── spatial_query.html │ │ ├── spatial_query_asset.html │ │ └── spatial_query_resource.html │ ├── tests │ ├── __init__.py │ ├── base.py │ ├── ckan_setup.py │ ├── data │ │ ├── altafulla.geojson │ │ ├── chukot.geojson │ │ ├── dataset.json │ │ └── hawaii.geojson │ ├── functional │ │ ├── __init__.py │ │ ├── test_package.py │ │ └── test_widgets.py │ ├── lib │ │ └── test_spatial.py │ ├── model │ │ ├── __init__.py │ │ └── xml │ │ │ ├── FCSConservancyPolygons.xml │ │ │ └── gemini_dataset.xml │ ├── test_api.py │ ├── test_plugin │ │ ├── __init__.py │ │ ├── plugin.py │ │ └── templates │ │ │ └── package │ │ │ ├── read_base.html │ │ │ └── search.html │ ├── test_spatial_search.py │ ├── test_validation.py │ ├── waf_extract │ │ ├── html_files │ │ │ ├── apache-folder.html │ │ │ ├── apache-subfolder.html │ │ │ ├── iis-folder.html │ │ │ ├── iis-subfolder.html │ │ │ ├── nginx-folder.html │ │ │ └── nginx-subfolder.html │ │ └── test_waf_scraper.py │ ├── xml │ │ ├── gemini2.1-waf │ │ │ ├── index.html │ │ │ ├── wales1.xml │ │ │ └── wales2.xml │ │ ├── gemini2.1 │ │ │ ├── FCSConservancyPolygons.xml │ │ │ ├── dataset1.xml │ │ │ ├── error_bad_xml.xml │ │ │ ├── error_validation.xml │ │ │ ├── service1.xml │ │ │ ├── service1_newer.xml │ │ │ ├── source1 │ │ │ │ └── same_dataset.xml │ │ │ ├── source2 │ │ │ │ └── same_dataset.xml │ │ │ └── validation │ │ │ │ ├── 01_Dataset_Invalid_XSD_No_Such_Element.xml │ │ │ │ ├── 01_Dataset_Invalid_XSD_No_Such_Element_unix.xml │ │ │ │ ├── 02_Dataset_Invalid_19139_Missing_Data_Format.xml │ │ │ │ ├── 03_Dataset_Invalid_GEMINI_Missing_Keyword.xml │ │ │ │ ├── 04_Dataset_Valid.xml │ │ │ │ ├── 05_Series_Invalid_XSD_No_Such_Element.xml │ │ │ │ ├── 06_Series_Invalid_19139_Missing_Data_Format.xml │ │ │ │ ├── 07_Series_Invalid_GEMINI_Missing_Keyword.xml │ │ │ │ ├── 08_Series_Valid.xml │ │ │ │ ├── 09_Service_Invalid_No_Such_Element.xml │ │ │ │ ├── 10_Service_Invalid_19139_Level_Description.xml │ │ │ │ ├── 11_Service_Invalid_GEMINI_Service_Type.xml │ │ │ │ ├── 12_Service_Valid.xml │ │ │ │ └── 13_Dataset_Invalid_Element_srv.xml │ │ ├── iso19139 │ │ │ ├── dataset-invalid.xml │ │ │ └── dataset.xml │ │ └── wms │ │ │ └── capabilities.xml │ └── xml_file_server.py │ ├── util.py │ ├── validation │ ├── __init__.py │ ├── validation.py │ └── xml │ │ ├── fgdc │ │ ├── fgdc-std-001-1998-sect01.xsd │ │ ├── fgdc-std-001-1998-sect02.xsd │ │ ├── fgdc-std-001-1998-sect03.xsd │ │ ├── fgdc-std-001-1998-sect04.xsd │ │ ├── fgdc-std-001-1998-sect05.xsd │ │ ├── fgdc-std-001-1998-sect06.xsd │ │ ├── fgdc-std-001-1998-sect07.xsd │ │ ├── fgdc-std-001-1998-sect08.xsd │ │ ├── fgdc-std-001-1998-sect09.xsd │ │ ├── fgdc-std-001-1998-sect10.xsd │ │ ├── fgdc-std-001-1998.dtd │ │ ├── fgdc-std-001-1998.sch │ │ ├── fgdc-std-001-1998.xsd │ │ └── index.html │ │ ├── gemini2 │ │ ├── Gemini2_R1r3.sch │ │ ├── gemini2-schematron-20101014-v1.0.sch │ │ └── gemini2-schematron-20110906-v1.2.sch │ │ ├── iso19139 │ │ ├── 19139-GML_readme.txt │ │ ├── Version.txt │ │ ├── gco │ │ │ ├── basicTypes.xsd │ │ │ ├── gco.xsd │ │ │ └── gcoBase.xsd │ │ ├── gmd │ │ │ ├── applicationSchema.xsd │ │ │ ├── citation.xsd │ │ │ ├── constraints.xsd │ │ │ ├── content.xsd │ │ │ ├── dataQuality.xsd │ │ │ ├── distribution.xsd │ │ │ ├── extent.xsd │ │ │ ├── freeText.xsd │ │ │ ├── gmd.xsd │ │ │ ├── identification.xsd │ │ │ ├── maintenance.xsd │ │ │ ├── metadataApplication.xsd │ │ │ ├── metadataEntity.xsd │ │ │ ├── metadataExtension.xsd │ │ │ ├── portrayalCatalogue.xsd │ │ │ ├── referenceSystem.xsd │ │ │ └── spatialRepresentation.xsd │ │ ├── gml │ │ │ ├── basicTypes.xsd │ │ │ ├── coordinateOperations.xsd │ │ │ ├── coordinateReferenceSystems.xsd │ │ │ ├── coordinateSystems.xsd │ │ │ ├── coverage.xsd │ │ │ ├── datums.xsd │ │ │ ├── dictionary.xsd │ │ │ ├── direction.xsd │ │ │ ├── dynamicFeature.xsd │ │ │ ├── feature.xsd │ │ │ ├── geometryAggregates.xsd │ │ │ ├── geometryBasic0d1d.xsd │ │ │ ├── geometryBasic2d.xsd │ │ │ ├── geometryComplexes.xsd │ │ │ ├── geometryPrimitives.xsd │ │ │ ├── gml.xsd │ │ │ ├── gmlBase.xsd │ │ │ ├── grids.xsd │ │ │ ├── measures.xsd │ │ │ ├── observation.xsd │ │ │ ├── referenceSystems.xsd │ │ │ ├── temporal.xsd │ │ │ ├── temporalReferenceSystems.xsd │ │ │ ├── temporalTopology.xsd │ │ │ ├── topology.xsd │ │ │ ├── units.xsd │ │ │ └── valueObjects.xsd │ │ ├── gmx │ │ │ ├── catalogues.xsd │ │ │ ├── codelistItem.xsd │ │ │ ├── crsItem.xsd │ │ │ ├── extendedTypes.xsd │ │ │ ├── gmx.xsd │ │ │ ├── gmxUsage.xsd │ │ │ └── uomItem.xsd │ │ ├── gsr │ │ │ ├── gsr.xsd │ │ │ └── spatialReferencing.xsd │ │ ├── gss │ │ │ ├── geometry.xsd │ │ │ └── gss.xsd │ │ ├── gts │ │ │ ├── gts.xsd │ │ │ └── temporalObjects.xsd │ │ ├── readme.rst │ │ ├── resources │ │ │ ├── Codelist │ │ │ │ ├── ML_gmxCodelists.xml │ │ │ │ └── gmxCodelists.xml │ │ │ ├── crs │ │ │ │ ├── ML_gmxCrs.xml │ │ │ │ └── gmxCrs.xml │ │ │ ├── example │ │ │ │ └── fr-fr.xml │ │ │ └── uom │ │ │ │ ├── ML_gmxUom.xml │ │ │ │ └── gmxUom.xml │ │ └── xlink │ │ │ ├── version.txt │ │ │ └── xlinks.xsd │ │ ├── iso19139eden │ │ ├── ReadMe.txt │ │ ├── gco │ │ │ ├── ReadMe.txt │ │ │ ├── basicTypes.xsd │ │ │ ├── gco.xsd │ │ │ └── gcoBase.xsd │ │ ├── gfc │ │ │ ├── ReadMe.txt │ │ │ ├── featureCataloging.xsd │ │ │ └── gfc.xsd │ │ ├── gmd │ │ │ ├── ReadMe.txt │ │ │ ├── applicationSchema.xsd │ │ │ ├── citation.xsd │ │ │ ├── constraints.xsd │ │ │ ├── content.xsd │ │ │ ├── dataQuality.xsd │ │ │ ├── distribution.xsd │ │ │ ├── extent.xsd │ │ │ ├── freeText.xsd │ │ │ ├── gmd.xsd │ │ │ ├── identification.xsd │ │ │ ├── maintenance.xsd │ │ │ ├── metadataApplication.xsd │ │ │ ├── metadataEntity.xsd │ │ │ ├── metadataExtension.xsd │ │ │ ├── portrayalCatalogue.xsd │ │ │ ├── referenceSystem.xsd │ │ │ └── spatialRepresentation.xsd │ │ ├── gmi │ │ │ ├── ReadMe.txt │ │ │ ├── acquisitionInformation.xsd │ │ │ ├── contentInformation.xsd │ │ │ ├── dataQualityInformation.xsd │ │ │ ├── gmi.xsd │ │ │ ├── metadataEntitySet.xsd │ │ │ └── spatialRepresentationInformation.xsd │ │ ├── gml │ │ │ ├── ReadMe.txt │ │ │ ├── SchematronConstraints.xml │ │ │ ├── basicTypes.xsd │ │ │ ├── coordinateOperations.xsd │ │ │ ├── coordinateReferenceSystems.xsd │ │ │ ├── coordinateSystems.xsd │ │ │ ├── coverage.xsd │ │ │ ├── datums.xsd │ │ │ ├── defaultStyle.xsd │ │ │ ├── deprecatedTypes.xsd │ │ │ ├── dictionary.xsd │ │ │ ├── direction.xsd │ │ │ ├── dynamicFeature.xsd │ │ │ ├── feature.xsd │ │ │ ├── geometryAggregates.xsd │ │ │ ├── geometryBasic0d1d.xsd │ │ │ ├── geometryBasic2d.xsd │ │ │ ├── geometryComplexes.xsd │ │ │ ├── geometryPrimitives.xsd │ │ │ ├── gml.xsd │ │ │ ├── gmlBase.xsd │ │ │ ├── grids.xsd │ │ │ ├── measures.xsd │ │ │ ├── observation.xsd │ │ │ ├── referenceSystems.xsd │ │ │ ├── temporal.xsd │ │ │ ├── temporalReferenceSystems.xsd │ │ │ ├── temporalTopology.xsd │ │ │ ├── topology.xsd │ │ │ ├── units.xsd │ │ │ └── valueObjects.xsd │ │ ├── gmx │ │ │ ├── ReadMe.txt │ │ │ ├── catalogues.xsd │ │ │ ├── codelistItem.xsd │ │ │ ├── crsItem.xsd │ │ │ ├── extendedTypes.xsd │ │ │ ├── gmx.xsd │ │ │ ├── gmxUsage.xsd │ │ │ └── uomItem.xsd │ │ ├── gmx_and_srv.xsd │ │ ├── gsr │ │ │ ├── ReadMe.txt │ │ │ ├── gsr.xsd │ │ │ └── spatialReferencing.xsd │ │ ├── gss │ │ │ ├── ReadMe.txt │ │ │ ├── geometry.xsd │ │ │ └── gss.xsd │ │ ├── gts │ │ │ ├── ReadMe.txt │ │ │ ├── gts.xsd │ │ │ └── temporalObjects.xsd │ │ ├── readme.rst │ │ ├── resources │ │ │ ├── Codelist │ │ │ │ ├── ML_gmxCodelists.xml │ │ │ │ ├── gmxCodelists.xml │ │ │ │ └── tcCodelists.xml │ │ │ ├── ReadMe.txt │ │ │ ├── crs │ │ │ │ ├── ML_gmxCrs.xml │ │ │ │ └── gmxCrs.xml │ │ │ ├── example │ │ │ │ └── fr-fr.xml │ │ │ └── uom │ │ │ │ ├── ML_gmxUom.xml │ │ │ │ └── gmxUom.xml │ │ ├── srv │ │ │ ├── ReadMe.txt │ │ │ ├── serviceMetadata.xsd │ │ │ ├── serviceModel.xsd │ │ │ └── srv.xsd │ │ └── xlink │ │ │ ├── version.txt │ │ │ └── xlinks.xsd │ │ ├── iso19139ngdc │ │ ├── 19139.zip │ │ ├── CLASS │ │ │ └── SST50_Auxiliary.xsd │ │ ├── EML │ │ │ └── eml-2.1.0 │ │ │ │ ├── eml-access.xsd │ │ │ │ ├── eml-attribute.xsd │ │ │ │ ├── eml-constraint.xsd │ │ │ │ ├── eml-coverage.xsd │ │ │ │ ├── eml-dataTable.xsd │ │ │ │ ├── eml-dataset.xsd │ │ │ │ ├── eml-documentation.xsd │ │ │ │ ├── eml-entity.xsd │ │ │ │ ├── eml-literature.xsd │ │ │ │ ├── eml-methods.xsd │ │ │ │ ├── eml-party.xsd │ │ │ │ ├── eml-physical.xsd │ │ │ │ ├── eml-project.xsd │ │ │ │ ├── eml-protocol.xsd │ │ │ │ ├── eml-resource.xsd │ │ │ │ ├── eml-software.xsd │ │ │ │ ├── eml-spatialRaster.xsd │ │ │ │ ├── eml-spatialReference.xsd │ │ │ │ ├── eml-spatialVector.xsd │ │ │ │ ├── eml-storedProcedure.xsd │ │ │ │ ├── eml-text.xsd │ │ │ │ ├── eml-unitTypeDefinitions.xsd │ │ │ │ ├── eml-view.xsd │ │ │ │ ├── eml.xsd │ │ │ │ └── stmml.xsd │ │ ├── NPP │ │ │ └── NPPcoverageType.xsd │ │ ├── ngdcSchema │ │ │ ├── fgdc-std-001-1998 │ │ │ │ ├── fgdc-std-001-1998-ann.xsd │ │ │ │ ├── fgdc-std-001-1998-base-types-ann.xsd │ │ │ │ ├── fgdc-std-001-1998-sect01-ann.xsd │ │ │ │ ├── fgdc-std-001-1998-sect02-ann.xsd │ │ │ │ ├── fgdc-std-001-1998-sect03-ann.xsd │ │ │ │ ├── fgdc-std-001-1998-sect04-ann.xsd │ │ │ │ ├── fgdc-std-001-1998-sect05-ann.xsd │ │ │ │ ├── fgdc-std-001-1998-sect06-ann.xsd │ │ │ │ ├── fgdc-std-001-1998-sect07-ann.xsd │ │ │ │ ├── fgdc-std-001-1998-sect08-ann.xsd │ │ │ │ ├── fgdc-std-001-1998-sect09-ann.xsd │ │ │ │ └── fgdc-std-001-1998-sect10-ann.xsd │ │ │ ├── fgdc-std-012-2002 │ │ │ │ ├── fgdc-std-012-2002-algoinfo.xsd │ │ │ │ ├── fgdc-std-012-2002-base-types.xsd │ │ │ │ ├── fgdc-std-012-2002-instinfo.xsd │ │ │ │ ├── fgdc-std-012-2002-locainfo.xsd │ │ │ │ ├── fgdc-std-012-2002-missinfo.xsd │ │ │ │ ├── fgdc-std-012-2002-platinfo.xsd │ │ │ │ ├── fgdc-std-012-2002-plmiinfo.xsd │ │ │ │ ├── fgdc-std-012-2002-procinfo.xsd │ │ │ │ ├── fgdc-std-012-2002-sect01.xsd │ │ │ │ ├── fgdc-std-012-2002-sect02.xsd │ │ │ │ ├── fgdc-std-012-2002-sect03.xsd │ │ │ │ ├── fgdc-std-012-2002-sect04.xsd │ │ │ │ ├── fgdc-std-012-2002-sect05.xsd │ │ │ │ └── fgdc-std-012-2002.xsd │ │ │ └── schema.xsd │ │ ├── schema.xsd │ │ ├── schema │ │ │ ├── gco │ │ │ │ ├── basicTypes.xsd │ │ │ │ ├── gco.xsd │ │ │ │ └── gcoBase.xsd │ │ │ ├── gfc │ │ │ │ ├── featureCataloging.xsd │ │ │ │ └── gfc.xsd │ │ │ ├── gmd │ │ │ │ ├── applicationSchema.xsd │ │ │ │ ├── citation.xsd │ │ │ │ ├── constraints.xsd │ │ │ │ ├── content.xsd │ │ │ │ ├── dataQuality.xsd │ │ │ │ ├── distribution.xsd │ │ │ │ ├── extent.xsd │ │ │ │ ├── freeText.xsd │ │ │ │ ├── gmd.xsd │ │ │ │ ├── identification.xsd │ │ │ │ ├── maintenance.xsd │ │ │ │ ├── metadataApplication.xsd │ │ │ │ ├── metadataEntity.xsd │ │ │ │ ├── metadataExtension.xsd │ │ │ │ ├── portrayalCatalogue.xsd │ │ │ │ ├── referenceSystem.xsd │ │ │ │ └── spatialRepresentation.xsd │ │ │ ├── gmi │ │ │ │ ├── acquisitionInformation.xsd │ │ │ │ ├── contentInformation.xsd │ │ │ │ ├── dataQualityInformation.xsd │ │ │ │ ├── gmi.xsd │ │ │ │ ├── metadataEntitySet.xsd │ │ │ │ └── spatialRepresentationInformation.xsd │ │ │ ├── gml │ │ │ │ ├── SQC-coverage.txt │ │ │ │ ├── SchematronConstraints.xml │ │ │ │ ├── basicTypes.xsd │ │ │ │ ├── coordinateOperations.xsd │ │ │ │ ├── coordinateReferenceSystems.xsd │ │ │ │ ├── coordinateSystems.xsd │ │ │ │ ├── coverage.xsd │ │ │ │ ├── datums.xsd │ │ │ │ ├── defaultStyle.xsd │ │ │ │ ├── deprecatedTypes.xsd │ │ │ │ ├── dictionary.xsd │ │ │ │ ├── direction.xsd │ │ │ │ ├── dynamicFeature.xsd │ │ │ │ ├── feature.xsd │ │ │ │ ├── geometryAggregates.xsd │ │ │ │ ├── geometryBasic0d1d.xsd │ │ │ │ ├── geometryBasic2d.xsd │ │ │ │ ├── geometryComplexes.xsd │ │ │ │ ├── geometryPrimitives.xsd │ │ │ │ ├── gml.xsd │ │ │ │ ├── gmlBase.xsd │ │ │ │ ├── gml_3_2_1-ReadMe.txt │ │ │ │ ├── grids.xsd │ │ │ │ ├── measures.xsd │ │ │ │ ├── observation.xsd │ │ │ │ ├── readme.txt │ │ │ │ ├── referenceSystems.xsd │ │ │ │ ├── sqc050517_gml.txt │ │ │ │ ├── temporal.xsd │ │ │ │ ├── temporalReferenceSystems.xsd │ │ │ │ ├── temporalTopology.xsd │ │ │ │ ├── topology.xsd │ │ │ │ ├── units.xsd │ │ │ │ └── valueObjects.xsd │ │ │ ├── gmx │ │ │ │ ├── catalogues.xsd │ │ │ │ ├── codelistItem.xsd │ │ │ │ ├── crsItem.xsd │ │ │ │ ├── extendedTypes.xsd │ │ │ │ ├── gmx.xsd │ │ │ │ ├── gmxUsage.xsd │ │ │ │ └── uomItem.xsd │ │ │ ├── gsr │ │ │ │ ├── gsr.xsd │ │ │ │ └── spatialReferencing.xsd │ │ │ ├── gss │ │ │ │ ├── geometry.xsd │ │ │ │ └── gss.xsd │ │ │ ├── gts │ │ │ │ ├── gts.xsd │ │ │ │ └── temporalObjects.xsd │ │ │ ├── mf │ │ │ │ ├── cargene.xsd │ │ │ │ ├── coverageMeasures.xsd │ │ │ │ ├── coverageType.xsd │ │ │ │ ├── measureType.xsd │ │ │ │ ├── metafor.xsd │ │ │ │ └── mfExtensions.xsd │ │ │ ├── resources │ │ │ │ ├── Codelist │ │ │ │ │ ├── ML_gmxCodelists.xml │ │ │ │ │ └── gmxCodelists.xml │ │ │ │ ├── crs │ │ │ │ │ ├── ML_gmxCrs.xml │ │ │ │ │ └── gmxCrs.xml │ │ │ │ ├── example │ │ │ │ │ └── fr-fr.xml │ │ │ │ ├── extensions │ │ │ │ │ └── MD_MetadataExtensionInformation.xml │ │ │ │ └── uom │ │ │ │ │ ├── ML_gmxUom.xml │ │ │ │ │ └── gmxUom.xml │ │ │ ├── srv │ │ │ │ ├── serviceMetadata.xsd │ │ │ │ ├── serviceModel.xsd │ │ │ │ └── srv.xsd │ │ │ └── xlink │ │ │ │ ├── version.txt │ │ │ │ └── xlinks.xsd │ │ ├── schematron │ │ │ ├── ISOStyle.sch │ │ │ ├── asciiValidationForFGDC.sch │ │ │ ├── asciiValidationForISO.sch │ │ │ ├── codeListValidation.sch │ │ │ ├── schematronAll.xsl │ │ │ ├── schematronISO.sch │ │ │ ├── schematronOutput.css │ │ │ └── schematronOutputWMO.css │ │ └── schematronTEST.xsl │ │ ├── medin │ │ ├── ISOTS19139A1Constraints_v1.3.sch │ │ ├── ISOTS19139A1Constraints_v1.4.sch │ │ ├── MedinMetadataProfile_v1.0.pdf │ │ └── MedinMetadataProfile_v1.7.sch │ │ └── schematron │ │ ├── ExtractSchFromRNG.xsl │ │ ├── ExtractSchFromXSD.xsl │ │ ├── iso_abstract_expand.xsl │ │ ├── iso_dsdl_include.xsl │ │ ├── iso_schematron_message.xsl │ │ ├── iso_schematron_skeleton_for_xslt1.xsl │ │ ├── iso_svrl_for_xslt1.xsl │ │ ├── readme.txt │ │ └── schematron-skeleton-api.htm │ └── views.py ├── dev-requirements.txt ├── doc ├── _assets │ ├── ckan.ico │ └── logo.png ├── _css │ └── extra.css ├── _static │ ├── base-map-stamen.png │ ├── dataset-extent-map.png │ ├── index.png │ ├── no-map-provider.png │ ├── spatial-search-widget.png │ └── stamen-map-provider-error.png ├── changelog.md ├── csw.md ├── harvesters.md ├── index.md ├── install.md ├── map-widgets.md ├── previews.md ├── requirements.txt └── spatial-search.md ├── mkdocs.yml ├── pip-requirements.txt ├── pyproject.toml ├── requirements.txt ├── setup.cfg ├── setup.py └── test.ini /.gitignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | *.pyc 3 | *.egg-info 4 | *.swp 5 | *~ 6 | dist 7 | build 8 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/.gitmodules -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yaml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Set the version of Python and other tools you might need 9 | build: 10 | os: ubuntu-22.04 11 | tools: 12 | python: "3.12" 13 | 14 | mkdocs: 15 | configuration: mkdocs.yml 16 | 17 | formats: all 18 | 19 | python: 20 | install: 21 | - requirements: doc/requirements.txt 22 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include ckanext/spatial/templates * 2 | recursive-include ckanext/spatial/public * 3 | recursive-include ckanext/spatial/validation/xml * 4 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ============================================== 2 | ckanext-spatial - Geo related plugins for CKAN 3 | ============================================== 4 | 5 | .. image:: https://github.com/ckan/ckanext-spatial/workflows/Tests/badge.svg?branch=master 6 | :target: https://github.com/ckan/ckanext-spatial/actions 7 | 8 | 9 | This extension contains plugins that add geospatial capabilities to CKAN_, 10 | including: 11 | 12 | * Geospatial dataset search powered by Solr, providing a bounding box via 13 | a UI map widget or the API. 14 | * Harvesters to import geospatial metadata into CKAN from other sources 15 | in ISO 19139 format and others. 16 | * Commands to support the CSW standard using pycsw_. 17 | 18 | **Note**: The view plugins for rendering spatial formats like GeoJSON_ have 19 | been moved to ckanext-geoview_. 20 | 21 | Full documentation, including installation instructions, can be found at: 22 | 23 | https://docs.ckan.org/projects/ckanext-spatial/en/latest/ 24 | 25 | Supported Versions 26 | ------------------ 27 | 28 | ckanext-spatial >= 2.0.0 supports CKAN 2.9 and CKAN 2.10. 29 | Check the 30 | [tested enviroments](https://github.com/ckan/ckanext-spatial/blob/master/.github/workflows/test.yml) 31 | for more details. 32 | 33 | For previous CKAN versions please use the v1.x tags. 34 | 35 | 36 | Community 37 | --------- 38 | 39 | * `Developer mailing list `_ 40 | * `Gitter channel `_ 41 | * `Issue tracker `_ 42 | 43 | 44 | Contributing 45 | ------------ 46 | 47 | For contributing to ckanext-spatial or its documentation, follow the same 48 | guidelines that apply to CKAN core, described in 49 | `CONTRIBUTING `_. 50 | 51 | 52 | Copying and License 53 | ------------------- 54 | 55 | This material is copyright (c) 2011-2023 Open Knowledge Foundation and contributors. 56 | 57 | It is open and licensed under the GNU Affero General Public License (AGPL) v3.0 58 | whose full text may be found at: 59 | 60 | http://www.fsf.org/licensing/licenses/agpl-3.0.html 61 | 62 | .. _CKAN: http://ckan.org 63 | .. _pycsw: http://pycsw.org 64 | .. _GeoJSON: http://geojson.org 65 | .. _ckanext-geoview: https://github.com/ckan/ckanext-geoview 66 | -------------------------------------------------------------------------------- /bin/__init__.py: -------------------------------------------------------------------------------- 1 | # this is a namespace package 2 | try: 3 | import pkg_resources 4 | pkg_resources.declare_namespace(__name__) 5 | except ImportError: 6 | import pkgutil 7 | __path__ = pkgutil.extend_path(__path__, __name__) 8 | -------------------------------------------------------------------------------- /ckanext/__init__.py: -------------------------------------------------------------------------------- 1 | # this is a namespace package 2 | try: 3 | import pkg_resources 4 | pkg_resources.declare_namespace(__name__) 5 | except ImportError: 6 | import pkgutil 7 | __path__ = pkgutil.extend_path(__path__, __name__) 8 | -------------------------------------------------------------------------------- /ckanext/spatial/__init__.py: -------------------------------------------------------------------------------- 1 | # this is a namespace package 2 | try: 3 | import pkg_resources 4 | pkg_resources.declare_namespace(__name__) 5 | except ImportError: 6 | import pkgutil 7 | __path__ = pkgutil.extend_path(__path__, __name__) 8 | 9 | __version__ = "2.3.0" 10 | -------------------------------------------------------------------------------- /ckanext/spatial/cli.py: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | import click 3 | 4 | import ckanext.spatial.util as util 5 | 6 | 7 | def get_commands(): 8 | return [ 9 | spatial_validation 10 | ] 11 | 12 | 13 | @click.group(u"spatial-validation", short_help=u"Spatial formats validation commands") 14 | def spatial_validation(): 15 | pass 16 | 17 | 18 | @spatial_validation.command() 19 | @click.argument('pkg', required=False) 20 | def report(pkg): 21 | """ 22 | Performs validation on the harvested metadata, either for all 23 | packages or the one specified. 24 | """ 25 | 26 | return util.report(pkg) 27 | 28 | 29 | @spatial_validation.command('report-csv') 30 | @click.argument('filepath') 31 | def report_csv(filepath): 32 | """ 33 | Performs validation on all the harvested metadata in the db and 34 | writes a report in CSV format to the given filepath. 35 | """ 36 | return util.report_csv(filepath) 37 | 38 | 39 | @spatial_validation.command('file') 40 | @click.argument('filepath') 41 | def validate_file(filepath): 42 | """Performs validation on the given metadata file.""" 43 | return util.validate_file(filepath) 44 | -------------------------------------------------------------------------------- /ckanext/spatial/commands/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | import pkg_resources 3 | pkg_resources.declare_namespace(__name__) 4 | except ImportError: 5 | import pkgutil 6 | __path__ = pkgutil.extend_path(__path__, __name__) -------------------------------------------------------------------------------- /ckanext/spatial/commands/csw.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import sys 3 | import logging 4 | 5 | from bin import ckan_pycsw 6 | 7 | from paste import script 8 | log = logging.getLogger(__name__) 9 | class Pycsw(script.command.Command): 10 | '''Manages the CKAN-pycsw integration 11 | 12 | ckan-pycsw setup [-p] 13 | Setups the necessary pycsw table on the db. 14 | 15 | ckan-pycsw set_keywords [-p] [-u] 16 | Sets pycsw server metadata keywords from CKAN site tag list. 17 | 18 | ckan-pycsw load [-p] [-u] 19 | Loads CKAN datasets as records into the pycsw db. 20 | 21 | ckan-pycsw clear [-p] 22 | Removes all records from the pycsw table. 23 | 24 | All commands require the pycsw configuration file. By default it will try 25 | to find a file called 'default.cfg' in the same directory, but you'll 26 | probably need to provide the actual location with the -p option. 27 | 28 | paster ckan-pycsw setup -p /etc/ckan/default/pycsw.cfg 29 | 30 | The load command requires a CKAN URL from where the datasets will be pulled. 31 | By default it is set to 'http://localhost', but you can define it with the -u 32 | option: 33 | 34 | paster ckan-pycsw load -p /etc/ckan/default/pycsw.cfg -u http://ckan.instance.org 35 | 36 | ''' 37 | 38 | parser = script.command.Command.standard_parser(verbose=True) 39 | parser.add_option('-p', '--pycsw-config', dest='pycsw_config', 40 | default='default.cfg', help='pycsw config file to use.') 41 | parser.add_option('-u', '--ckan-url', dest='ckan_url', 42 | default='http://localhost', help='CKAN instance to import the datasets from.') 43 | 44 | summary = __doc__.split('\n')[0] 45 | usage = __doc__ 46 | max_args = 2 47 | min_args = 0 48 | 49 | def command(self): 50 | if len(self.args) == 0: 51 | self.parser.print_usage() 52 | sys.exit(1) 53 | 54 | config = ckan_pycsw._load_config(self.options.pycsw_config) 55 | cmd = self.args[0] 56 | if cmd == 'setup': 57 | ckan_pycsw.setup_db(config) 58 | elif cmd in ['load', 'set_keywords']: 59 | ckan_url = self.options.ckan_url.rstrip('/') + '/' 60 | if cmd == 'load': 61 | ckan_pycsw.load(config, ckan_url) 62 | else: 63 | ckan_pycsw.set_keywords(self.options.pycsw_config, config, ckan_url) 64 | elif cmd == 'clear': 65 | ckan_pycsw.clear(config) 66 | else: 67 | print('Command %s not recognized' % cmd) 68 | -------------------------------------------------------------------------------- /ckanext/spatial/commands/validation.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import sys 3 | 4 | import logging 5 | from ckan.lib.cli import CkanCommand 6 | 7 | import ckanext.spatial.util as util 8 | 9 | 10 | log = logging.getLogger(__name__) 11 | 12 | class Validation(CkanCommand): 13 | '''Validation commands 14 | 15 | Usage: 16 | validation report [package-name] 17 | Performs validation on the harvested metadata, either for all 18 | packages or the one specified. 19 | 20 | validation report-csv .csv 21 | Performs validation on all the harvested metadata in the db and 22 | writes a report in CSV format to the given filepath. 23 | 24 | validation file .xml 25 | Performs validation on the given metadata file. 26 | ''' 27 | summary = __doc__.split('\n')[0] 28 | usage = __doc__ 29 | max_args = 3 30 | min_args = 0 31 | 32 | def command(self): 33 | if not self.args or self.args[0] in ['--help', '-h', 'help']: 34 | print(self.usage) 35 | sys.exit(1) 36 | 37 | self._load_config() 38 | 39 | cmd = self.args[0] 40 | if cmd == 'report': 41 | self.report() 42 | elif cmd == 'report-csv': 43 | self.report_csv() 44 | elif cmd == 'file': 45 | self.validate_file() 46 | else: 47 | print('Command %s not recognized' % cmd) 48 | 49 | def report(self): 50 | 51 | if len(self.args) >= 2: 52 | pkg = self.args[1] 53 | else: 54 | pkg = None 55 | return util.report(pkg) 56 | 57 | def validate_file(self): 58 | if len(self.args) > 2: 59 | print('Too many parameters %i' % len(self.args)) 60 | sys.exit(1) 61 | if len(self.args) < 2: 62 | print('Not enough parameters %i' % len(self.args)) 63 | sys.exit(1) 64 | 65 | return util.validate_file(self.args[1]) 66 | 67 | def report_csv(self): 68 | if len(self.args) != 2: 69 | print('Wrong number of arguments') 70 | sys.exit(1) 71 | return util.report_csv(self.args[1]) 72 | -------------------------------------------------------------------------------- /ckanext/spatial/controllers/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | import pkg_resources 3 | pkg_resources.declare_namespace(__name__) 4 | except ImportError: 5 | import pkgutil 6 | __path__ = pkgutil.extend_path(__path__, __name__) 7 | 8 | -------------------------------------------------------------------------------- /ckanext/spatial/controllers/api.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from ckan.lib.base import abort 4 | from ckan.controllers.api import ApiController as BaseApiController 5 | from ckan.model import Session 6 | from ckantoolkit import response 7 | 8 | from ckanext.harvest.model import HarvestObject, HarvestObjectExtra 9 | from ckanext.spatial import util 10 | 11 | log = logging.getLogger(__name__) 12 | 13 | 14 | class HarvestMetadataApiController(BaseApiController): 15 | 16 | def _get_content(self, id): 17 | 18 | obj = Session.query(HarvestObject) \ 19 | .filter(HarvestObject.id == id).first() 20 | if obj: 21 | return obj.content 22 | else: 23 | return None 24 | 25 | def _get_original_content(self, id): 26 | extra = Session.query(HarvestObjectExtra).join(HarvestObject) \ 27 | .filter(HarvestObject.id == id) \ 28 | .filter( 29 | HarvestObjectExtra.key == 'original_document' 30 | ).first() 31 | if extra: 32 | return extra.value 33 | else: 34 | return None 35 | 36 | def _get_xslt(self, original=False): 37 | 38 | return util.get_xslt(original) 39 | 40 | def display_xml_original(self, id): 41 | content = util.get_harvest_object_original_content(id) 42 | 43 | if not content: 44 | abort(404) 45 | 46 | response.headers['Content-Type'] = 'application/xml; charset=utf-8' 47 | response.headers['Content-Length'] = len(content) 48 | 49 | if '\n' + content 51 | return content.encode('utf-8') 52 | 53 | def display_html(self, id): 54 | content = self._get_content(id) 55 | 56 | if not content: 57 | abort(404) 58 | 59 | xslt_package, xslt_path = self._get_xslt() 60 | out = util.transform_to_html(content, xslt_package, xslt_path) 61 | response.headers['Content-Type'] = 'text/html; charset=utf-8' 62 | response.headers['Content-Length'] = len(out) 63 | 64 | return out 65 | 66 | def display_html_original(self, id): 67 | content = util.get_harvest_object_original_content(id) 68 | 69 | if content is None: 70 | abort(404) 71 | 72 | xslt_package, xslt_path = self._get_xslt(original=True) 73 | 74 | out = util.transform_to_html(content, xslt_package, xslt_path) 75 | response.headers['Content-Type'] = 'text/html; charset=utf-8' 76 | response.headers['Content-Length'] = len(out) 77 | 78 | return out 79 | -------------------------------------------------------------------------------- /ckanext/spatial/harvesters/__init__.py: -------------------------------------------------------------------------------- 1 | # this is a namespace package 2 | try: 3 | import pkg_resources 4 | pkg_resources.declare_namespace(__name__) 5 | except ImportError: 6 | import pkgutil 7 | __path__ = pkgutil.extend_path(__path__, __name__) 8 | 9 | from ckanext.spatial.harvesters.base import SpatialHarvester 10 | from ckanext.spatial.harvesters.csw import CSWHarvester 11 | from ckanext.spatial.harvesters.waf import WAFHarvester 12 | from ckanext.spatial.harvesters.doc import DocHarvester 13 | -------------------------------------------------------------------------------- /ckanext/spatial/helpers.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from ckan import plugins as p 4 | from ckan.lib import helpers as h 5 | 6 | from ckantoolkit import config 7 | 8 | log = logging.getLogger(__name__) 9 | 10 | 11 | def get_reference_date(date_str): 12 | ''' 13 | Gets a reference date extra created by the harvesters and formats it 14 | nicely for the UI. 15 | 16 | Examples: 17 | [{"type": "creation", "value": "1977"}, {"type": "revision", "value": "1981-05-15"}] 18 | [{"type": "publication", "value": "1977"}] 19 | [{"type": "publication", "value": "NaN-NaN-NaN"}] 20 | 21 | Results 22 | 1977 (creation), May 15, 1981 (revision) 23 | 1977 (publication) 24 | NaN-NaN-NaN (publication) 25 | ''' 26 | try: 27 | out = [] 28 | for date in h.json.loads(date_str): 29 | value = h.render_datetime(date['value']) or date['value'] 30 | out.append('{0} ({1})'.format(value, date['type'])) 31 | return ', '.join(out) 32 | except (ValueError, TypeError): 33 | return date_str 34 | 35 | 36 | def get_responsible_party(value): 37 | ''' 38 | Gets a responsible party extra created by the harvesters and formats it 39 | nicely for the UI. 40 | 41 | Examples: 42 | [{"name": "Complex Systems Research Center", "roles": ["pointOfContact"]}] 43 | [{"name": "British Geological Survey", "roles": ["custodian", "pointOfContact"]}, {"name": "Natural England", "roles": ["publisher"]}] 44 | 45 | Results 46 | Complex Systems Research Center (pointOfContact) 47 | British Geological Survey (custodian, pointOfContact); Natural England (publisher) 48 | ''' 49 | formatted = { 50 | 'resourceProvider': p.toolkit._('Resource Provider'), 51 | 'pointOfContact': p.toolkit._('Point of Contact'), 52 | 'principalInvestigator': p.toolkit._('Principal Investigator'), 53 | } 54 | 55 | try: 56 | out = [] 57 | parties = h.json.loads(value) 58 | for party in parties: 59 | roles = [formatted[role] if role in list(formatted.keys()) else p.toolkit._(role.capitalize()) for role in party['roles']] 60 | out.append('{0} ({1})'.format(party['name'], ', '.join(roles))) 61 | return '; '.join(out) 62 | except (ValueError, TypeError): 63 | return value 64 | 65 | 66 | def get_common_map_config(): 67 | ''' 68 | Returns a dict with all configuration options related to the common 69 | base map (ie those starting with 'ckanext.spatial.common_map.') 70 | ''' 71 | namespace = 'ckanext.spatial.common_map.' 72 | return dict([(k.replace(namespace, ''), v) for k, v in config.items() if k.startswith(namespace)]) 73 | -------------------------------------------------------------------------------- /ckanext/spatial/lib/report.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Library for creating reports that can be displayed easily in an HTML table 3 | and then saved as a CSV. 4 | ''' 5 | 6 | from io import StringIO 7 | import datetime 8 | import csv 9 | 10 | 11 | class ReportTable(object): 12 | def __init__(self, column_names): 13 | assert isinstance(column_names, (list, tuple)) 14 | self.column_names = column_names 15 | self.rows = [] 16 | 17 | def add_row_dict(self, row_dict): 18 | '''Adds a row to the report table''' 19 | row = [] 20 | for col_name in self.column_names: 21 | if col_name in row_dict: 22 | value = row_dict.pop(col_name) 23 | else: 24 | value = None 25 | row.append(value) 26 | if row_dict: 27 | raise Exception('Have left-over keys not under a column: %s' % row_dict) 28 | self.rows.append(row) 29 | 30 | def get_rows_html_formatted(self, date_format='%d/%m/%y %H:%M', 31 | blank_cell_html=''): 32 | for row in self.rows: 33 | row_formatted = row[:] 34 | for i, cell in enumerate(row): 35 | if isinstance(cell, datetime.datetime): 36 | row_formatted[i] = cell.strftime(date_format) 37 | elif cell is None: 38 | row_formatted[i] = blank_cell_html 39 | yield row_formatted 40 | 41 | def get_csv(self): 42 | csvout = StringIO() 43 | csvwriter = csv.writer( 44 | csvout, 45 | dialect='excel', 46 | quoting=csv.QUOTE_NONNUMERIC 47 | ) 48 | csvwriter.writerow(self.column_names) 49 | for row in self.rows: 50 | row_formatted = [] 51 | for cell in row: 52 | if isinstance(cell, datetime.datetime): 53 | cell = cell.strftime('%Y-%m-%d %H:%M') 54 | elif isinstance(cell, int): 55 | cell = str(cell) 56 | elif isinstance(cell, (list, tuple)): 57 | cell = str(cell) 58 | elif cell is None: 59 | cell = '' 60 | else: 61 | cell = cell.encode('utf8') 62 | row_formatted.append(cell) 63 | try: 64 | csvwriter.writerow(row_formatted) 65 | except Exception as e: 66 | raise Exception("%s: %s, %s"%(e, row, row_formatted)) 67 | csvout.seek(0) 68 | return csvout.read() 69 | -------------------------------------------------------------------------------- /ckanext/spatial/lib/reports.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from lxml import etree 4 | 5 | from ckanext.spatial.harvesters import SpatialHarvester 6 | from ckanext.spatial.lib.report import ReportTable 7 | from ckan import model 8 | from ckanext.harvest.model import HarvestObject 9 | 10 | def validation_report(package_id=None): 11 | ''' 12 | Looks at every harvested metadata record and compares the 13 | validation errors that it had on last import and what it would be with 14 | the current validators. Useful when going to update the validators. 15 | 16 | Returns a ReportTable. 17 | ''' 18 | log = logging.getLogger(__name__ + '.validation_report') 19 | 20 | validators = SpatialHarvester()._get_validator() 21 | log.debug('Validators: %r', validators.profiles) 22 | 23 | query = model.Session.query(HarvestObject).\ 24 | filter_by(current=True).\ 25 | order_by(HarvestObject.fetch_finished.desc()) 26 | 27 | if package_id: 28 | query = query.filter(HarvestObject.package_id==package_id) 29 | 30 | report = ReportTable([ 31 | 'Harvest Object id', 32 | 'GEMINI2 id', 33 | 'Date fetched', 34 | 'Dataset name', 35 | 'Publisher', 36 | 'Source URL', 37 | 'Old validation errors', 38 | 'New validation errors']) 39 | 40 | old_validation_failure_count = 0 41 | new_validation_failure_count = 0 42 | 43 | for harvest_object in query: 44 | validation_errors = [] 45 | for err in harvest_object.errors: 46 | if 'not a valid Gemini' in err.message or \ 47 | 'Validating against' in err.message: 48 | validation_errors.append(err.message) 49 | if validation_errors: 50 | old_validation_failure_count += 1 51 | 52 | groups = harvest_object.package.get_groups() 53 | publisher = groups[0].title if groups else '(none)' 54 | 55 | xml = etree.fromstring(harvest_object.content.encode("utf-8")) 56 | valid, errors = validators.is_valid(xml) 57 | if not valid: 58 | new_validation_failure_count += 1 59 | 60 | report.add_row_dict({ 61 | 'Harvest Object id': harvest_object.id, 62 | 'GEMINI2 id': harvest_object.guid, 63 | 'Date fetched': harvest_object.fetch_finished, 64 | 'Dataset name': harvest_object.package.name, 65 | 'Publisher': publisher, 66 | 'Source URL': harvest_object.source.url, 67 | 'Old validation errors': '; '.join(validation_errors), 68 | 'New validation errors': '; '.join(errors), 69 | }) 70 | 71 | log.debug('%i results', query.count()) 72 | log.debug('%i failed old validation', old_validation_failure_count) 73 | log.debug('%i failed new validation', new_validation_failure_count) 74 | return report 75 | -------------------------------------------------------------------------------- /ckanext/spatial/plugin/flask_plugin.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import ckan.plugins as p 4 | import ckanext.spatial.views as blueprints 5 | from ckanext.spatial.cli import get_commands 6 | 7 | 8 | class SpatialQueryMixin(p.SingletonPlugin): 9 | p.implements(p.IClick) 10 | 11 | # IClick 12 | 13 | def get_commands(self): 14 | return get_commands() 15 | 16 | 17 | class HarvestMetadataApiMixin(p.SingletonPlugin): 18 | p.implements(p.IBlueprint) 19 | 20 | # IBlueprint 21 | 22 | def get_blueprint(self): 23 | return [blueprints.harvest_metadata] 24 | -------------------------------------------------------------------------------- /ckanext/spatial/plugin/pylons_plugin.py: -------------------------------------------------------------------------------- 1 | import ckan.plugins as p 2 | 3 | 4 | class SpatialQueryMixin(p.SingletonPlugin): 5 | pass 6 | 7 | 8 | class HarvestMetadataApiMixin(p.SingletonPlugin): 9 | p.implements(p.IRoutes, inherit=True) 10 | 11 | def before_map(self, route_map): 12 | controller = "ckanext.spatial.controllers.api:HarvestMetadataApiController" 13 | 14 | # Showing the harvest object content is an action of the default 15 | # harvest plugin, so just redirect there 16 | route_map.redirect('/api/2/rest/harvestobject/{id:.*}/xml', 17 | '/harvest/object/{id}', 18 | _redirect_code='301 Moved Permanently') 19 | 20 | route_map.connect('/harvest/object/{id}/original', controller=controller, 21 | action='display_xml_original') 22 | 23 | route_map.connect('/harvest/object/{id}/html', controller=controller, 24 | action='display_html') 25 | route_map.connect('/harvest/object/{id}/html/original', controller=controller, 26 | action='display_html_original') 27 | 28 | # Redirect old URL to a nicer and unversioned one 29 | route_map.redirect('/api/2/rest/harvestobject/:id/html', 30 | '/harvest/object/{id}/html', 31 | _redirect_code='301 Moved Permanently') 32 | 33 | return route_map 34 | -------------------------------------------------------------------------------- /ckanext/spatial/public/css/common_map.css: -------------------------------------------------------------------------------- 1 | .leaflet-control-no-provider { 2 | background-color: white; 3 | margin-right: 10px; 4 | padding: 10px; 5 | border: 1px solid #b1b1b1; 6 | } 7 | .leaflet-control-attribution { 8 | font-size: 11px; 9 | } 10 | -------------------------------------------------------------------------------- /ckanext/spatial/public/css/dataset_map.css: -------------------------------------------------------------------------------- 1 | /* Side bar */ 2 | .module-narrow #dataset-map-container{ 3 | height: 200px; 4 | } 5 | 6 | /* Primary content */ 7 | 8 | .dataset-map-section-20x { 9 | padding: 0 25px; 10 | margin: 20px 0; 11 | } 12 | 13 | .dataset-map #dataset-map-container{ 14 | height: 250px; 15 | } 16 | 17 | #dataset-map-attribution{ 18 | font-size: x-small; 19 | } 20 | 21 | .module-narrow #dataset-map-attribution{ 22 | margin-left: 3px; 23 | } 24 | -------------------------------------------------------------------------------- /ckanext/spatial/public/css/spatial_query.css: -------------------------------------------------------------------------------- 1 | .module-narrow #dataset-map-container { 2 | height: 200px; 3 | font-size: 14px; 4 | } 5 | .module-content #dataset-map-container { 6 | height: 250px; 7 | } 8 | .module-heading .action { 9 | float: right; 10 | color: #888888; 11 | font-size: 12px; 12 | line-height: 20px; 13 | text-decoration: underline; 14 | } 15 | .module-narrow #dataset-map-attribution { 16 | margin: 5px 8px; 17 | color: #666; 18 | } 19 | .leaflet-draw-label-single { 20 | display: none; 21 | } 22 | .leaflet-draw-label-subtext { 23 | display: none; 24 | } 25 | #field-location { 26 | width: 190px; 27 | } 28 | .select2-results .select2-no-results { 29 | padding: 3px 6px; 30 | } 31 | #dataset-map-edit { 32 | margin: 5px 8px; 33 | } 34 | #dataset-map-edit-buttons { 35 | display: none; 36 | } 37 | .leaflet-touch .leaflet-draw-toolbar a.leaflet-draw-draw-rectangle { 38 | background-image: url("../img/pencil.png"); 39 | background-repeat: no-repeat; 40 | background-position: 50% 50%; 41 | background-size: 12px 12px; 42 | border-radius: 4px; 43 | } 44 | .leaflet-draw-actions li { 45 | display: none; 46 | } 47 | 48 | #draw-map-container { 49 | width: 870px; 50 | height: 384px; 51 | background-color: white; 52 | border: 1px solid #CCC; 53 | margin: 0; 54 | } 55 | 56 | .modal-spatial-query { 57 | max-width: 900px; 58 | } 59 | -------------------------------------------------------------------------------- /ckanext/spatial/public/img/marker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/public/img/marker.png -------------------------------------------------------------------------------- /ckanext/spatial/public/img/pencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/public/img/pencil.png -------------------------------------------------------------------------------- /ckanext/spatial/public/js/dataset_map.js: -------------------------------------------------------------------------------- 1 | // Dataset map module 2 | this.ckan.module('dataset-map', function (jQuery, _) { 3 | 4 | return { 5 | options: { 6 | i18n: { 7 | }, 8 | styles: { 9 | point:{ 10 | iconUrl: '/img/marker.png', 11 | iconSize: [14, 25], 12 | iconAnchor: [7, 25] 13 | }, 14 | default_:{ 15 | color: '#B52', 16 | weight: 2, 17 | opacity: 1, 18 | fillColor: '#FCF6CF', 19 | fillOpacity: 0.4 20 | } 21 | } 22 | }, 23 | 24 | initialize: function () { 25 | 26 | this.extent = this.el.data('extent'); 27 | 28 | // fix bbox when w-long is positive while e-long is negative. 29 | // assuming coordinate sequence is west to east (left to right) 30 | if (this.extent.type == 'Polygon' 31 | && this.extent.coordinates[0].length == 5) { 32 | _coordinates = this.extent.coordinates[0] 33 | w = _coordinates[0][0]; 34 | e = _coordinates[2][0]; 35 | if (w >= 0 && e < 0) { 36 | w_new = w 37 | while (w_new > e) w_new -=360 38 | for (var i = 0; i < _coordinates.length; i++) { 39 | if (_coordinates[i][0] == w) { 40 | _coordinates[i][0] = w_new 41 | }; 42 | }; 43 | this.extent.coordinates[0] = _coordinates 44 | }; 45 | }; 46 | 47 | // hack to make leaflet use a particular location to look for images 48 | L.Icon.Default.imagePath = this.options.site_url + 'js/vendor/leaflet/images'; 49 | 50 | jQuery.proxyAll(this, /_on/); 51 | this.el.ready(this._onReady); 52 | 53 | }, 54 | 55 | _onReady: function(){ 56 | 57 | var map, backgroundLayer, extentLayer, ckanIcon; 58 | 59 | if (!this.extent) { 60 | return false; 61 | } 62 | 63 | map = ckan.commonLeafletMap('dataset-map-container', this.options.map_config, {attributionControl: false}); 64 | 65 | var ckanIcon = L.Icon.extend({options: this.options.styles.point}); 66 | 67 | var extentLayer = L.geoJson(this.extent, { 68 | style: this.options.styles.default_, 69 | pointToLayer: function (feature, latLng) { 70 | return new L.Marker(latLng, {icon: new ckanIcon}) 71 | }}); 72 | extentLayer.addTo(map); 73 | 74 | if (this.extent.type == 'Point'){ 75 | map.setView(L.latLng(this.extent.coordinates[1], this.extent.coordinates[0]), 9); 76 | } else { 77 | map.fitBounds(extentLayer.getBounds()); 78 | } 79 | } 80 | } 81 | }); 82 | -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet.draw/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet.draw/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | ################# 3 | ## Eclipse 4 | ################# 5 | 6 | *.pydevproject 7 | .project 8 | .metadata 9 | bin/** 10 | tmp/** 11 | tmp/**/* 12 | *.tmp 13 | *.bak 14 | *.swp 15 | *~.nib 16 | local.properties 17 | .classpath 18 | .settings/ 19 | .loadpath 20 | 21 | # External tool builders 22 | .externalToolBuilders/ 23 | 24 | # Locally stored "Eclipse launch configurations" 25 | *.launch 26 | 27 | # CDT-specific 28 | .cproject 29 | 30 | # PDT-specific 31 | .buildpath 32 | 33 | 34 | ################# 35 | ## Visual Studio 36 | ################# 37 | 38 | ## Ignore Visual Studio temporary files, build results, and 39 | ## files generated by popular Visual Studio add-ons. 40 | 41 | # User-specific files 42 | *.suo 43 | *.user 44 | *.sln.docstates 45 | 46 | # Build results 47 | **/[Dd]ebug/ 48 | **/[Rr]elease/ 49 | *_i.c 50 | *_p.c 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.vspscc 65 | .builds 66 | **/*.dotCover 67 | 68 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 69 | #**/packages/ 70 | 71 | # Visual C++ cache files 72 | ipch/ 73 | *.aps 74 | *.ncb 75 | *.opensdf 76 | *.sdf 77 | 78 | # Visual Studio profiler 79 | *.psess 80 | *.vsp 81 | 82 | # ReSharper is a .NET coding add-in 83 | _ReSharper* 84 | 85 | # Installshield output folder 86 | [Ee]xpress 87 | 88 | # DocProject is a documentation generator add-in 89 | DocProject/buildhelp/ 90 | DocProject/Help/*.HxT 91 | DocProject/Help/*.HxC 92 | DocProject/Help/*.hhc 93 | DocProject/Help/*.hhk 94 | DocProject/Help/*.hhp 95 | DocProject/Help/Html2 96 | DocProject/Help/html 97 | 98 | # Click-Once directory 99 | publish 100 | 101 | # Others 102 | [Bb]in 103 | [Oo]bj 104 | sql 105 | TestResults 106 | *.Cache 107 | ClientBin 108 | stylecop.* 109 | ~$* 110 | *.dbmdl 111 | Generated_Code #added for RIA/Silverlight projects 112 | 113 | # Backup & report files from converting an old project file to a newer 114 | # Visual Studio version. Backup files are not needed, because we have git ;-) 115 | _UpgradeReport_Files/ 116 | Backup*/ 117 | UpgradeLog*.XML 118 | 119 | 120 | 121 | ############ 122 | ## Windows 123 | ############ 124 | 125 | # Windows image file caches 126 | Thumbs.db 127 | 128 | # Folder config file 129 | Desktop.ini 130 | 131 | # Node modules used during build 132 | node_modules/ 133 | 134 | ############# 135 | ## Python 136 | ############# 137 | 138 | *.py[co] 139 | 140 | # Packages 141 | *.egg 142 | *.egg-info 143 | #dist 144 | #build 145 | eggs 146 | parts 147 | bin 148 | var 149 | sdist 150 | develop-eggs 151 | .installed.cfg 152 | 153 | # Installer logs 154 | pip-log.txt 155 | 156 | # Unit test / coverage reports 157 | .coverage 158 | .tox 159 | 160 | #Translations 161 | *.mo 162 | 163 | #Mr Developer 164 | .mr.developer.cfg 165 | 166 | #Intellij 167 | .idea 168 | 169 | # Mac crap 170 | .DS_Store 171 | -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet.draw/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.12" 4 | - "0.11" 5 | - "0.10" 6 | - "0.8" 7 | - "0.6" 8 | - "iojs" 9 | - "iojs-v1.0.4" 10 | matrix: 11 | allow_failures: 12 | - node_js: "0.8" 13 | - node_js: "0.6" 14 | before_script: 15 | - npm install -g jake -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet.draw/0.4.14/MIT-LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2012-2017 Jon West, Jacob Toye, and Leaflet 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet.draw/0.4.14/images/layers-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/public/js/vendor/leaflet.draw/0.4.14/images/layers-2x.png -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet.draw/0.4.14/images/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/public/js/vendor/leaflet.draw/0.4.14/images/layers.png -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet.draw/0.4.14/images/marker-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/public/js/vendor/leaflet.draw/0.4.14/images/marker-icon-2x.png -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet.draw/0.4.14/images/marker-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/public/js/vendor/leaflet.draw/0.4.14/images/marker-icon.png -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet.draw/0.4.14/images/marker-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/public/js/vendor/leaflet.draw/0.4.14/images/marker-shadow.png -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet.draw/0.4.14/images/spritesheet-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/public/js/vendor/leaflet.draw/0.4.14/images/spritesheet-2x.png -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet.draw/0.4.14/images/spritesheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/public/js/vendor/leaflet.draw/0.4.14/images/spritesheet.png -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | tmp/**/* 4 | .idea 5 | .idea/**/* 6 | *.iml 7 | *.sublime-* 8 | _site 9 | dist/*.js 10 | coverage/ 11 | *.js.html 12 | index.html 13 | .mailmap 14 | bower.json 15 | component.json -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | tmp/**/* 4 | .idea 5 | .idea/**/* 6 | *.iml 7 | *.sublime-* 8 | _site 9 | coverage/ 10 | -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 0.12 4 | addons: 5 | artifacts: 6 | paths: 7 | - dist 8 | target_paths: 9 | - content/leaflet/${NAME} 10 | env: 11 | global: 12 | - ARTIFACTS_BUCKET=leafletjs-cdn 13 | - ARTIFACTS_PERMISSIONS=public-read 14 | - secure: |- 15 | JlC1rD7WryxlUbWmD3NWVX9E60XB/+ss7+j0OaY3WqWziGUWDCuoVkOMGXnp 16 | Ev27O8qhlmRkeyiimUN64UzK0yeZ139DcZMY6r4A5E2kwHYRAO/H/zl5RAGo 17 | Yd9GUPwZfr3xV8WhH2GFy/L/mRjkGwue2o6ZxdsqBOKfYaF9Ryg= 18 | - secure: |- 19 | XW1hzORAtSpTgTKkQwel5gRMDy6SotzeSRsVV2jQCn46VIMx8G/J5nOI+ImL 20 | yeoH12PhCR0h39dM7mq8TYJo5DHwvbotI5nQhpMruSt8eMFbym8nGiqQh806 21 | fSJXkxmQ4MAjUdNFDIirBHhdZme8q3PueFzJ+5odFMvPGn/aITQ= 22 | after_success: 23 | - npm run build 24 | - cd dist && zip -x .DS_Store -r leaflet.zip . && cd .. 25 | - NAME=$TRAVIS_BRANCH 26 | - '[[ $TRAVIS_PULL_REQUEST != ''false'' ]] && NAME=$TRAVIS_PULL_REQUEST' 27 | - '[[ -n $TRAVIS_TAG ]] && NAME=$TRAVIS_TAG' 28 | -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet/1.9.3/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2010-2022, Volodymyr Agafonkin 4 | Copyright (c) 2010-2011, CloudMade 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet/1.9.3/images/layers-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/public/js/vendor/leaflet/1.9.3/images/layers-2x.png -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet/1.9.3/images/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/public/js/vendor/leaflet/1.9.3/images/layers.png -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet/1.9.3/images/marker-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/public/js/vendor/leaflet/1.9.3/images/marker-icon-2x.png -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet/1.9.3/images/marker-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/public/js/vendor/leaflet/1.9.3/images/marker-icon.png -------------------------------------------------------------------------------- /ckanext/spatial/public/js/vendor/leaflet/1.9.3/images/marker-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/public/js/vendor/leaflet/1.9.3/images/marker-shadow.png -------------------------------------------------------------------------------- /ckanext/spatial/public/resource.config: -------------------------------------------------------------------------------- 1 | [depends] 2 | 3 | main = base/main 4 | 5 | [groups] 6 | 7 | dataset_map = 8 | 9 | js/vendor/leaflet/1.9.3/leaflet.js 10 | js/common_map.js 11 | js/dataset_map.js 12 | 13 | js/vendor/leaflet/1.9.3/leaflet.css 14 | css/dataset_map.css 15 | 16 | spatial_query = 17 | 18 | js/vendor/leaflet/1.9.3/leaflet.js 19 | js/vendor/leaflet.draw/0.4.14/leaflet.draw.js 20 | js/common_map.js 21 | js/spatial_query.js 22 | 23 | js/vendor/leaflet/1.9.3/leaflet.css 24 | js/vendor/leaflet.draw/0.4.14/leaflet.draw.css 25 | css/spatial_query.css 26 | -------------------------------------------------------------------------------- /ckanext/spatial/public/webassets.yml: -------------------------------------------------------------------------------- 1 | dataset_map_js: 2 | filter: rjsmin 3 | output: ckanext-spatial/%(version)s_dataset_map.js 4 | extra: 5 | preload: 6 | - base/main 7 | contents: 8 | - js/vendor/leaflet/1.9.3/leaflet.js 9 | - js/vendor/leaflet-providers.js 10 | - js/common_map.js 11 | - js/dataset_map.js 12 | 13 | dataset_map_css: 14 | filters: cssrewrite 15 | output: ckanext-spatial/%(version)s_dataset_map.css 16 | contents: 17 | - js/vendor/leaflet/1.9.3/leaflet.css 18 | - css/common_map.css 19 | - css/dataset_map.css 20 | 21 | spatial_query_js: 22 | filter: rjsmin 23 | output: ckanext-spatial/%(version)s_spatial_query.js 24 | extra: 25 | preload: 26 | - base/main 27 | contents: 28 | - js/vendor/leaflet/1.9.3/leaflet.js 29 | - js/vendor/leaflet.draw/0.4.14/leaflet.draw.js 30 | - js/vendor/leaflet-providers.js 31 | - js/common_map.js 32 | - js/spatial_query.js 33 | 34 | spatial_query_css: 35 | filters: cssrewrite 36 | output: ckanext-spatial/%(version)s_spatial_query.css 37 | contents: 38 | - js/vendor/leaflet/1.9.3/leaflet.css 39 | - js/vendor/leaflet.draw/0.4.14/leaflet.draw.css 40 | - css/common_map.css 41 | - css/spatial_query.css 42 | -------------------------------------------------------------------------------- /ckanext/spatial/templates/spatial/snippets/dataset_map.html: -------------------------------------------------------------------------------- 1 | {# 2 | Displays a map showing the dataset extent on the dataset page main body 3 | 4 | extent 5 | GeoJSON representation of the geometry to draw (ie the value of the 6 | 'spatial' extra) 7 | 8 | e.g. 9 | {% set dataset_extent = h.get_pkg_dict_extra(c.pkg_dict, 'spatial', '') %} 10 | {% if dataset_extent %} 11 | {% snippet "spatial/snippets/dataset_map.html", extent=dataset_extent %} 12 | {% endif %} 13 | 14 | #} 15 | 16 |
17 |

{{ _('Dataset extent') }}

18 | {% snippet "spatial/snippets/dataset_map_base.html", extent=extent %} 19 |
20 | -------------------------------------------------------------------------------- /ckanext/spatial/templates/spatial/snippets/dataset_map_asset.html: -------------------------------------------------------------------------------- 1 | {% asset 'ckanext-spatial/dataset_map_js' %} 2 | {% asset 'ckanext-spatial/dataset_map_css' %} 3 | -------------------------------------------------------------------------------- /ckanext/spatial/templates/spatial/snippets/dataset_map_base.html: -------------------------------------------------------------------------------- 1 | {# 2 | Displays a map showing the dataset extent on the dataset page sidebar 3 | 4 | extent 5 | GeoJSON representation of the geometry to draw (ie the value of the 6 | 'spatial' extra) 7 | 8 | e.g. 9 | {% snippet "spatial/snippets/dataset_map_base.html", extent=extent %} 10 | 11 | #} 12 | 13 | {% set map_config = h.get_common_map_config() %} 14 |
15 |
16 |
17 | 18 | {% set type = 'asset' if h.ckan_version().split('.')[1] | int >= 9 else 'resource' %} 19 | {% include 'spatial/snippets/dataset_map_' ~ type ~ '.html' %} 20 | -------------------------------------------------------------------------------- /ckanext/spatial/templates/spatial/snippets/dataset_map_resource.html: -------------------------------------------------------------------------------- 1 | {% resource 'ckanext-spatial/dataset_map' %} 2 | -------------------------------------------------------------------------------- /ckanext/spatial/templates/spatial/snippets/dataset_map_sidebar.html: -------------------------------------------------------------------------------- 1 | {# 2 | Displays a map showing the dataset extent on the dataset page sidebar 3 | 4 | extent 5 | GeoJSON representation of the geometry to draw (ie the value of the 6 | 'spatial' extra) 7 | 8 | e.g. 9 | {% set dataset_extent = h.get_pkg_dict_extra(c.pkg_dict, 'spatial', '') %} 10 | {% if dataset_extent %} 11 | {% snippet "spatial/snippets/dataset_map_sidebar.html", extent=dataset_extent %} 12 | {% endif %} 13 | 14 | #} 15 | 16 |
17 |

{{ _('Dataset extent') }}

18 | {% snippet "spatial/snippets/dataset_map_base.html", extent=extent %} 19 |
20 | -------------------------------------------------------------------------------- /ckanext/spatial/templates/spatial/snippets/map_attribution.html: -------------------------------------------------------------------------------- 1 | {% if map_config.type == 'custom' %} 2 |
{{ map_config.attribution|safe }}
3 | {% elif map_config.type == 'wms' %} 4 |
{{ map_config['wms.attribution']|safe }}
5 | {% else %} 6 |
Map data © OpenStreetMap contributors
7 | {% if map_config.type == 'mapbox' %} 8 |
Tiles by MapBox
9 | {% else %} 10 | 11 | {% endif %} 12 | {% endif %} 13 | 14 | -------------------------------------------------------------------------------- /ckanext/spatial/templates/spatial/snippets/spatial_query.html: -------------------------------------------------------------------------------- 1 | {# 2 | Displays a map widget to define a spatial filter on the dataset search page sidebar 3 | 4 | default_extent 5 | Initial map extent (Optional, defaults to the whole world). It can be defined 6 | either as a pair of coordinates or as a GeoJSON bounding box. 7 | 8 | e.g. 9 | {% snippet "spatial/snippets/spatial_query.html", default_extent=[[15.62, -139.21], [64.92, -61.87]] %} 10 | 11 | {% snippet "spatial/snippets/spatial_query.html", default_extent="{ \"type\": \"Polygon\", \"coordinates\": [[[74.89, 29.39],[74.89, 38.45], [60.50, 38.45], [60.50, 29.39], [74.89, 29.39]]]}" %} 12 | 13 | #} 14 | 15 |
16 |

17 | 18 | {{ _('Filter by location') }} 19 | {{ _('Clear') }} 20 |

21 | {% set map_config = h.get_common_map_config() %} 22 |
23 |
24 |
25 |
26 | 27 | {% set type = 'asset' if h.ckan_version().split('.')[1] | int >= 9 else 'resource' %} 28 | {% include 'spatial/snippets/spatial_query_' ~ type ~ '.html' %} 29 | -------------------------------------------------------------------------------- /ckanext/spatial/templates/spatial/snippets/spatial_query_asset.html: -------------------------------------------------------------------------------- 1 | {% asset 'ckanext-spatial/spatial_query_js' %} 2 | {% asset 'ckanext-spatial/spatial_query_css' %} 3 | -------------------------------------------------------------------------------- /ckanext/spatial/templates/spatial/snippets/spatial_query_resource.html: -------------------------------------------------------------------------------- 1 | {% resource 'ckanext-spatial/spatial_query' %} 2 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # this is a namespace package 2 | try: 3 | import pkg_resources 4 | 5 | pkg_resources.declare_namespace(__name__) 6 | except ImportError: 7 | import pkgutil 8 | 9 | __path__ = pkgutil.extend_path(__path__, __name__) 10 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/base.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import os 4 | 5 | geojson_examples = { 6 | "point": '{"type":"Point","coordinates":[100.0,2.0]}', 7 | "point_2": '{"type":"Point","coordinates":[20,10]}', 8 | "line": '{"type":"LineString","coordinates":[[100.0,0.0],[101.0,1.0]]}', 9 | "polygon": '{"type":"Polygon","coordinates":[[[100.0,0.0],[101.0,0.0],' 10 | '[101.0,1.0],[100.0,1.0],[100.0,0.0]]]}', 11 | "polygon_holes": '{"type":"Polygon","coordinates":[[[100.0,0.0],' 12 | '[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],[[100.2,0.2],' 13 | '[100.8,0.2],[100.8,0.8],[100.2,0.8],[100.2,0.2]]]}', 14 | "multipoint": '{"type":"MultiPoint","coordinates":' 15 | '[[100.0,0.0],[101.0,1.0]]}', 16 | "multiline": '{"type":"MultiLineString","coordinates":[[[100.0,0.0],' 17 | '[101.0,1.0]],[[102.0,2.0],[103.0,3.0]]]}', 18 | "multipolygon": '{"type":"MultiPolygon","coordinates":[[[[102.0,2.0],' 19 | '[103.0,2.0],[103.0,3.0],[102.0,3.0],[102.0,2.0]]],[[[100.0,0.0],' 20 | '[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]],[[100.2,0.2],' 21 | '[100.8,0.2],[100.8,0.8],[100.2,0.8],[100.2,0.2]]]]}', 22 | } 23 | 24 | 25 | class SpatialTestBase(object): 26 | db_srid = 4326 27 | geojson_examples = geojson_examples 28 | 29 | def read_file(self, path): 30 | 31 | file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), path) 32 | 33 | with open(file_path, "r") as f: 34 | return f.read() 35 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/ckan_setup.py: -------------------------------------------------------------------------------- 1 | try: 2 | from ckan.tests.pytest_ckan.ckan_setup import * 3 | except ImportError: 4 | from ckan.config.middleware import make_app 5 | from ckan.common import config 6 | 7 | import pkg_resources 8 | from paste.deploy import loadapp 9 | import sys 10 | import os 11 | 12 | import pylons 13 | from pylons.i18n.translation import _get_translator 14 | 15 | def pytest_addoption(parser): 16 | """Allow using custom config file during tests. 17 | """ 18 | parser.addoption(u"--ckan-ini", action=u"store") 19 | 20 | def pytest_sessionstart(session): 21 | """Initialize CKAN environment. 22 | """ 23 | global pylonsapp 24 | path = os.getcwd() 25 | sys.path.insert(0, path) 26 | pkg_resources.working_set.add_entry(path) 27 | pylonsapp = loadapp( 28 | "config:" + session.config.option.ckan_ini, relative_to=path, 29 | ) 30 | 31 | # Initialize a translator for tests that utilize i18n 32 | translator = _get_translator(pylons.config.get("lang")) 33 | pylons.translator._push_object(translator) 34 | 35 | class FakeResponse: 36 | headers = {} # because render wants to delete Pragma 37 | 38 | pylons.response._push_object(FakeResponse) 39 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/functional/__init__.py: -------------------------------------------------------------------------------- 1 | # this is a namespace package 2 | try: 3 | import pkg_resources 4 | 5 | pkg_resources.declare_namespace(__name__) 6 | except ImportError: 7 | import pkgutil 8 | 9 | __path__ = pkgutil.extend_path(__path__, __name__) 10 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/functional/test_package.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | import ckantoolkit as tk 4 | import ckan.tests.factories as factories 5 | from ckanext.spatial.tests.base import SpatialTestBase 6 | import ckan.tests.helpers as helpers 7 | 8 | 9 | @pytest.fixture 10 | def sysadmin_env(): 11 | try: 12 | from ckan.tests.factories import SysadminWithToken 13 | user = SysadminWithToken() 14 | return {'Authorization': user['token']} 15 | except ImportError: 16 | # ckan <= 2.9 17 | from ckan.tests.factories import Sysadmin 18 | user = Sysadmin() 19 | return {"REMOTE_USER": user["name"].encode("ascii")} 20 | 21 | 22 | 23 | def _post_data(app, url, data, env): 24 | 25 | if tk.check_ckan_version(min_version="2.11.0a0"): 26 | res = app.post(url, headers=env, data=data, follow_redirects=False) 27 | else: 28 | res = app.post( 29 | url, environ_overrides=env, data=data, follow_redirects=False 30 | ) 31 | return res 32 | 33 | 34 | @pytest.mark.usefixtures("with_plugins", "clean_db", "clean_index") 35 | @pytest.mark.ckan_config("ckan.plugins", "spatial_metadata spatial_query") 36 | class TestSpatialExtra(SpatialTestBase): 37 | def test_spatial_extra_base(self, app, sysadmin_env): 38 | 39 | dataset = factories.Dataset() 40 | 41 | url = tk.url_for("dataset.edit", id=dataset["id"]) 42 | 43 | data = { 44 | "name": dataset["name"], 45 | "extras__0__key": "spatial", 46 | "extras__0__value": self.geojson_examples["point"], 47 | } 48 | 49 | res = _post_data(app, url, data, sysadmin_env) 50 | 51 | assert "Error" not in res, res 52 | 53 | dataset_dict = tk.get_action("package_show")({}, {"id": dataset["id"]}) 54 | 55 | assert dataset_dict["extras"][0]["key"] == "spatial" 56 | assert dataset_dict["extras"][0]["value"] == self.geojson_examples["point"] 57 | 58 | def test_spatial_extra_bad_json(self, app, sysadmin_env): 59 | 60 | dataset = factories.Dataset() 61 | 62 | url = tk.url_for("dataset.edit", id=dataset["id"]) 63 | 64 | data = { 65 | "name": dataset["name"], 66 | "extras__0__key": u"spatial", 67 | "extras__0__value": u'{"Type":Bad Json]', 68 | } 69 | 70 | res = _post_data(app, url, data, sysadmin_env) 71 | 72 | assert "Error" in res, res 73 | assert "Spatial" in res 74 | assert "Error decoding JSON object" in res 75 | 76 | def test_spatial_extra_bad_geojson(self, app, sysadmin_env): 77 | 78 | dataset = factories.Dataset() 79 | 80 | url = tk.url_for("dataset.edit", id=dataset["id"]) 81 | 82 | data = { 83 | "name": dataset["name"], 84 | "extras__0__key": u"spatial", 85 | "extras__0__value": u'{"Type":"Bad_GeoJSON","a":2}', 86 | } 87 | 88 | res = _post_data(app, url, data, sysadmin_env) 89 | 90 | assert "Error" in res, res 91 | assert "Spatial" in res 92 | assert "Wrong GeoJSON object" in res 93 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/functional/test_widgets.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from ckanext.spatial.tests.base import SpatialTestBase 4 | 5 | from ckan.tests import factories 6 | 7 | import ckan.plugins.toolkit as tk 8 | 9 | 10 | @pytest.mark.usefixtures("with_plugins", "clean_db", "clean_index") 11 | @pytest.mark.ckan_config( 12 | "ckan.plugins", "test_spatial_plugin spatial_metadata spatial_query") 13 | class TestSpatialWidgets(SpatialTestBase): 14 | def test_dataset_map(self, app): 15 | dataset = factories.Dataset( 16 | extras=[{"key": "spatial", "value": self.geojson_examples["point"]}], 17 | ) 18 | if tk.check_ckan_version(min_version="2.9"): 19 | offset = tk.url_for("dataset.read", id=dataset["id"]) 20 | else: 21 | offset = tk.url_for(controller="package", action="read", id=dataset["id"]) 22 | res = app.get(offset) 23 | 24 | assert 'data-module="dataset-map"' in res 25 | assert "dataset_map.js" in res 26 | 27 | def test_spatial_search_widget(self, app): 28 | if tk.check_ckan_version(min_version="2.9"): 29 | offset = tk.url_for("dataset.search") 30 | else: 31 | offset = tk.url_for(controller="package", action="search") 32 | res = app.get(offset) 33 | 34 | assert 'data-module="spatial-query"' in res 35 | assert "spatial_query.js" in res 36 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/lib/test_spatial.py: -------------------------------------------------------------------------------- 1 | from ckanext.spatial.lib import normalize_bbox, fit_bbox 2 | 3 | 4 | bbox_dict = {"minx": -4.96, "miny": 55.70, "maxx": -3.78, "maxy": 56.43} 5 | 6 | 7 | def test_string(): 8 | res = normalize_bbox("-4.96,55.70,-3.78,56.43") 9 | assert res == bbox_dict 10 | 11 | 12 | def test_list(): 13 | res = normalize_bbox([-4.96, 55.70, -3.78, 56.43]) 14 | assert res == bbox_dict 15 | 16 | 17 | def test_list_of_strings(): 18 | res = normalize_bbox(["-4.96", "55.70", "-3.78", "56.43"]) 19 | assert res == bbox_dict 20 | 21 | 22 | def test_bad(): 23 | res = normalize_bbox([-4.96, 55.70, -3.78]) 24 | assert res is None 25 | 26 | 27 | def test_bad_2(): 28 | res = normalize_bbox("random") 29 | assert res is None 30 | 31 | 32 | def test_fit_within_bounds(): 33 | 34 | assert fit_bbox(bbox_dict) == bbox_dict 35 | 36 | 37 | def test_fit_out_of_bounds(): 38 | 39 | bbox_dict = {"minx": -185, "miny": -95, "maxx": 195, "maxy": 95} 40 | assert fit_bbox(bbox_dict) == { 41 | "minx": 175, 42 | "miny": 85, 43 | "maxx": -165, 44 | "maxy": -85, 45 | } 46 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/model/__init__.py: -------------------------------------------------------------------------------- 1 | # this is a namespace package 2 | try: 3 | import pkg_resources 4 | 5 | pkg_resources.declare_namespace(__name__) 6 | except ImportError: 7 | import pkgutil 8 | 9 | __path__ = pkgutil.extend_path(__path__, __name__) 10 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/test_api.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from ckan.model import Session 4 | 5 | from ckanext.spatial.tests.base import SpatialTestBase 6 | 7 | 8 | @pytest.mark.usefixtures( 9 | "with_plugins", 10 | "clean_db", 11 | "clean_index", 12 | ) 13 | @pytest.mark.ckan_config("ckan.plugins", "harvest spatial_metadata spatial_query spatial_harvest_metadata_api") 14 | class TestHarvestedMetadataAPI(SpatialTestBase): 15 | def test_api(self, app, migrate_db_for): 16 | 17 | migrate_db_for("harvest") 18 | 19 | try: 20 | from ckanext.harvest.model import ( 21 | HarvestObject, 22 | HarvestJob, 23 | HarvestSource, 24 | HarvestObjectExtra, 25 | ) 26 | except ImportError: 27 | raise pytest.skip("The harvester extension is needed for these tests") 28 | 29 | content1 = "Content 1" 30 | ho1 = HarvestObject( 31 | guid="test-ho-1", 32 | job=HarvestJob(source=HarvestSource(url="http://", type="xx")), 33 | content=content1, 34 | ) 35 | 36 | content2 = "Content 2" 37 | original_content2 = "Original Content 2" 38 | ho2 = HarvestObject( 39 | guid="test-ho-2", 40 | job=HarvestJob(source=HarvestSource(url="http://", type="xx")), 41 | content=content2, 42 | ) 43 | 44 | hoe = HarvestObjectExtra( 45 | key="original_document", value=original_content2, object=ho2 46 | ) 47 | 48 | Session.add(ho1) 49 | Session.add(ho2) 50 | Session.add(hoe) 51 | Session.commit() 52 | 53 | object_id_1 = ho1.id 54 | object_id_2 = ho2.id 55 | 56 | # Access object content 57 | url = "/harvest/object/{0}".format(object_id_1) 58 | r = app.get(url, status=200) 59 | assert r.headers["Content-Type"] == "application/xml; charset=utf-8" 60 | assert r.body == '\nContent 1' 61 | 62 | # Access human-readable view of content 63 | url = "/harvest/object/{0}/html".format(object_id_1) 64 | r = app.get(url, status=200) 65 | assert( 66 | r.headers["Content-Type"] == "text/html; charset=utf-8" 67 | ) 68 | 69 | # Access original content in object extra (if present) 70 | url = "/harvest/object/{0}/original".format(object_id_1) 71 | r = app.get(url, status=404) 72 | 73 | url = "/harvest/object/{0}/original".format(object_id_2) 74 | r = app.get(url, status=200) 75 | assert r.headers["Content-Type"] == "application/xml; charset=utf-8" 76 | assert ( 77 | r.body 78 | == '\n' 79 | + "Original Content 2" 80 | ) 81 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/test_plugin/__init__.py: -------------------------------------------------------------------------------- 1 | # this is a namespace package 2 | try: 3 | import pkg_resources 4 | 5 | pkg_resources.declare_namespace(__name__) 6 | except ImportError: 7 | import pkgutil 8 | 9 | __path__ = pkgutil.extend_path(__path__, __name__) 10 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/test_plugin/plugin.py: -------------------------------------------------------------------------------- 1 | import json 2 | import shapely 3 | from ckan import plugins as p 4 | 5 | 6 | class TestSpatialPlugin(p.SingletonPlugin): 7 | 8 | p.implements(p.IConfigurer, inherit=True) 9 | 10 | p.implements(p.IPackageController, inherit=True) 11 | 12 | def update_config(self, config): 13 | p.toolkit.add_template_directory(config, "templates") 14 | 15 | def before_index(self, pkg_dict): 16 | return self.before_dataset_index(pkg_dict) 17 | 18 | def before_dataset_index(self, pkg_dict): 19 | 20 | if not pkg_dict.get("my_geoms"): 21 | return pkg_dict 22 | 23 | pkg_dict["spatial_geom"] = [] 24 | 25 | my_geoms = json.loads(pkg_dict["my_geoms"]) 26 | 27 | if not isinstance(my_geoms, list): 28 | my_geoms = [my_geoms] 29 | 30 | for geom in my_geoms: 31 | 32 | shape = shapely.geometry.shape(geom) 33 | 34 | pkg_dict["spatial_geom"].append(shape.wkt) 35 | 36 | return pkg_dict 37 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/test_plugin/templates/package/read_base.html: -------------------------------------------------------------------------------- 1 | {% ckan_extends %} 2 | 3 | {% block secondary_content %} 4 | {{ super() }} 5 | 6 | {% set dataset_extent = h.get_pkg_dict_extra(c.pkg_dict, 'spatial', '') %} 7 | {% if dataset_extent %} 8 | {% snippet "spatial/snippets/dataset_map_sidebar.html", extent=dataset_extent %} 9 | {% endif %} 10 | 11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/test_plugin/templates/package/search.html: -------------------------------------------------------------------------------- 1 | {% ckan_extends %} 2 | 3 | {% block secondary_content %} 4 | 5 | {% snippet "spatial/snippets/spatial_query.html" %} 6 | 7 | {{ super() }} 8 | 9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/waf_extract/html_files/apache-folder.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Index of /apache-folder 6 | 7 | 8 |

Index of /apache-folder

9 |
      Name                    Last modified      Size  Description
Parent Directory - 10 | record-1.xml 2024-11-07 15:00 356K 11 | subfolder/ 2024-11-12 15:00 - 12 |
13 | 14 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/waf_extract/html_files/apache-subfolder.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Index of /apache-folder/subfolder 6 | 7 | 8 |

Index of /apache-folder/subfolder

9 |
      Name                    Last modified      Size  Description
Parent Directory - 10 | record-2.xml 2024-11-07 16:59 182K 11 |
12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/waf_extract/html_files/iis-folder.html: -------------------------------------------------------------------------------- 1 | iis.server - /iis-folder/

iis.server - /iis-folder/


2 | 3 |
[To Parent Directory]

11/7/2024 7:20 AM <dir> subfolder
11/7/2024 3:00 PM 168 record-1.xml

4 | 5 | 6 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/waf_extract/html_files/iis-subfolder.html: -------------------------------------------------------------------------------- 1 | iis.server - /iis-folder/subfolder/

iis.server - /iis-folder/subfolder/


2 | 3 |
[To Parent Directory]

11/7/2024 4:59 PM 8958 record-2.xml

-------------------------------------------------------------------------------- /ckanext/spatial/tests/waf_extract/html_files/nginx-folder.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Index of /nginx/ 4 | 5 |

Index of /nginx/


../
 6 | subfolder/                                               07-Nov-2024 15:00                   -
 7 | record-1.xml                                       07-Nov-2024 15:00              364868
 8 | 

9 | 10 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/waf_extract/html_files/nginx-subfolder.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Index of /nginx/subfoler/ 4 | 5 |

Index of /nginx/subfolder/


../
6 | record-2.xml                                       07-Nov-2024 16:59              186150
7 | 

8 | 9 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/waf_extract/test_waf_scraper.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from ckanext.spatial.harvesters.waf import _extract_waf 4 | 5 | TEST_DIR = os.path.dirname(os.path.abspath(__file__)) 6 | HTML_DIR = os.path.join(TEST_DIR, "html_files") 7 | 8 | def test_extract_iis(httpserver): 9 | 10 | # feed http response with these static html content 11 | with \ 12 | open(f"{HTML_DIR}/iis-folder.html", "r") as iis_folder, \ 13 | open(f"{HTML_DIR}/nginx-folder.html", "r") as nginx_folder, \ 14 | open(f"{HTML_DIR}/apache-folder.html", "r") as apache_folder, \ 15 | open(f"{HTML_DIR}/iis-subfolder.html", "r") as iis_subfolder, \ 16 | open(f"{HTML_DIR}/nginx-subfolder.html", "r") as nginx_subfolder, \ 17 | open(f"{HTML_DIR}/apache-subfolder.html", "r") as apache_subfolder: 18 | iis_folder_content = iis_folder.read() 19 | nginx_folder_content = nginx_folder.read() 20 | apache_folder_content = apache_folder.read() 21 | iis_subfolder_content = iis_subfolder.read() 22 | nginx_subfolder_content = nginx_subfolder.read() 23 | apache_subfolder_content = apache_subfolder.read() 24 | 25 | # feed static content when it traverses the subfolder 26 | httpserver.expect_request("/iis-folder/subfolder/").respond_with_data(iis_subfolder_content) 27 | httpserver.expect_request("/nginx-folder/subfolder/").respond_with_data(nginx_subfolder_content) 28 | httpserver.expect_request("/apache-folder/subfolder/").respond_with_data(apache_subfolder_content) 29 | 30 | # let it scape, traverse and extract the content 31 | iis_results = _extract_waf( 32 | iis_folder_content, 33 | httpserver.url_for("/iis-folder/"), 34 | "iis" 35 | ) 36 | 37 | nginx_results = _extract_waf( 38 | nginx_folder_content, 39 | httpserver.url_for("/nginx-folder/"), 40 | "nginx" 41 | ) 42 | 43 | apache_results = _extract_waf( 44 | apache_folder_content, 45 | httpserver.url_for("/apache-folder/"), 46 | "apache" 47 | ) 48 | 49 | records_expected = [('record-1.xml', '2024-11-07 15:00:00'), ('record-2.xml', '2024-11-07 16:59:00')] 50 | 51 | assert records_expected == sorted([(os.path.basename(r[0]), r[1]) for r in iis_results]) 52 | assert records_expected == sorted([(os.path.basename(r[0]), r[1]) for r in nginx_results]) 53 | assert records_expected == sorted([(os.path.basename(r[0]), r[1]) for r in apache_results]) 54 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/xml/gemini2.1-waf/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Index of /waf 5 | 6 | 7 |

Index of /waf

8 | wales1.xml 9 | wales2.xml 10 | 11 | 12 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/xml/gemini2.1/error_bad_xml.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | test-error-bad-xml-1 5 | 6 | 7 | eng 8 | 9 | 10 | service 11 | 12 | 13 | Service 14 | 15 | 16 | -------------------------------------------------------------------------------- /ckanext/spatial/tests/xml_file_server.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | 3 | import os 4 | 5 | try: 6 | from http.server import SimpleHTTPRequestHandler 7 | from socketserver import TCPServer 8 | except ImportError: 9 | from SimpleHTTPServer import SimpleHTTPRequestHandler 10 | from SocketServer import TCPServer 11 | 12 | from threading import Thread 13 | 14 | 15 | PORT = 8999 16 | 17 | 18 | def serve(port=PORT): 19 | """Serves test XML files over HTTP""" 20 | 21 | # Make sure we serve from the tests' XML directory 22 | os.chdir(os.path.join(os.path.dirname(os.path.abspath(__file__)), "xml")) 23 | 24 | Handler = SimpleHTTPRequestHandler 25 | 26 | class TestServer(TCPServer): 27 | allow_reuse_address = True 28 | 29 | httpd = TestServer(("", PORT), Handler) 30 | 31 | print("Serving test HTTP server at port", PORT) 32 | 33 | httpd_thread = Thread(target=httpd.serve_forever) 34 | httpd_thread.setDaemon(True) 35 | httpd_thread.start() 36 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | # this is a namespace package 3 | try: 4 | import pkg_resources 5 | pkg_resources.declare_namespace(__name__) 6 | except ImportError: 7 | import pkgutil 8 | __path__ = pkgutil.extend_path(__path__, __name__) 9 | 10 | from .validation import * 11 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/fgdc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Index of /schemas/metadata 5 | 6 | 7 |

Index of /schemas/metadata

8 | 23 | 24 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/19139-GML_readme.txt: -------------------------------------------------------------------------------- 1 | For the sake of convenience, GML 3.2 XML schemas (version 19136 DIS - 2005 november) are (temporarily) provided with the 19139 set of schemas. The following changes were applied to the GML schemas to enable locale referencing: 2 | 3 | -1- "referenceSystems.xsd" : 4 | 5 | a)replace 6 | 7 | with 8 | 9 | 10 | b) replace 11 | xmlns:gmd="http://www.isotc211.org/schemas/2005/gmd" 12 | with 13 | xmlns:gmd="http://www.isotc211.org/2005/gmd" 14 | 15 | 16 | 17 | -2- "coordinateOperations.xsd" : 18 | 19 | a) replace 20 | 21 | with 22 | 23 | 24 | b) replace 25 | xmlns:gmd="http://www.isotc211.org/schemas/2005/gmd" 26 | with 27 | xmlns:gmd="http://www.isotc211.org/2005/gmd" -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/Version.txt: -------------------------------------------------------------------------------- 1 | 19139 XSchemas TS RC (2006 May 4) 2 | ----------------------------------------------- 3 | 4 | GML version => 19136 XSchemas DIS (2005 november) 5 | 6 | 7 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/gco/gco.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:00:06 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/gmd/applicationSchema.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:40:03 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Information about the application schema used to build the dataset 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/gmd/gmd.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:40:04 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/gmd/portrayalCatalogue.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:40:03 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Information identifing the portrayal catalogue used 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/gml/gml.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | gml.xsd 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/gmx/gmx.xsd: -------------------------------------------------------------------------------- 1 |  2 | This file was generated from ISO TC/211 UML class diagrams == 03-18-2005 11:12:17 ====== -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/gsr/gsr.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:24:48 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/gsr/spatialReferencing.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:24:48 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/gss/gss.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:14:37 ====== This package contains the normative (Geometry and Topology) parts of the model for ISO 19107. This document should be referred to as the official description of the Model. If there are any differences, then ISO 19107 takes precedence. - - This packages also contains example (informative) of applications of 19107. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/gts/gts.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:18:09 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/gts/temporalObjects.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:18:09 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/readme.rst: -------------------------------------------------------------------------------- 1 | This is the ISO 19139 XSD Schema, for validating spatial metadata. It was downloaded from:: 2 | 3 | http://www.isotc211.org/2005/ 4 | 5 | It is assumed that copyright for the rest of the files in this directory and sub directories rests with ISO. 6 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/resources/example/fr-fr.xml: -------------------------------------------------------------------------------- 1 | France-France French FR UTF 8 2005-03-18 création 2006-02-03 révision french translation team auteur Résumé succint du contenu du jeu de données -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/resources/uom/gmxUom.xml: -------------------------------------------------------------------------------- 1 | gmxUom units of measure dictionary compliant with SI definitions ISO/TC 211 GMX (and imported) namespace 0.0 2005-03-18 The metre is the length of the path travelled by ligth in vaccum during a time interval of 1/299 792 458 of a second metre length m Measure of angle equal to Pi/180 radians, widely used in geography degree angle 1.74532925199433E-02 Radian is an unit of angle measure. It is defined as the ratio of arc length to the radius of the circle. radian plane angle rad -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139/xlink/version.txt: -------------------------------------------------------------------------------- 1 | XML Linking Language (XLink) Version 1.0 - W3C Recommendation 27 June 2001 - XML Schema document 2 | 3 | This file is a local copy (W3C does not provide a version of the schema document). 4 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Validated with XSV 2.10, Xerces J 2.7.1 and XML Spy 2009 (2009-03-02, IGN / France - Nicolas Lesage / Marcellin Prudham) 3 | 4 | Includes following packages: 5 | 6 | .gco (ISO 19103 concepts); 7 | .gmx (ISO 19139 concepts); 8 | .gmd (ISO 19115 concepts); 9 | .gmi (ISO 19115-2 concepts); 10 | .gml (ISO 19136 concepts); 11 | .gsr (ISO 19111 concepts); 12 | .gss (ISO 19107 concepts); 13 | .gts (ISO 19108 concepts); 14 | .srv (ISO 19119 concepts); 15 | .resources (Codelist, crs, example, uom) 16 | 17 | See X\ReadMe.txt for details of lineage and modification of the package X -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gco/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Validated with XSV 2.10, Xerces J 2.7.1 and XML Spy 2009 (2009-03-02, IGN / France - Nicolas Lesage / Marcellin Prudham) 3 | 4 | 5 | ************************** 6 | 7 | Package gco from Eden repository (http://eden.ign.fr/xsd) 2008-06-26 full release of ISO/TC211 schemas modified as follows : 8 | 9 | - basicTypes.xsd line2: 10 | xmlns:gml="http://www.opengis.net/gml" 11 | replaced by 12 | xmlns:gml="http://www.opengis.net/gml/3.2" 13 | 14 | - basicTypes.xsd line8: 15 | namespace="http://www.opengis.net/gml" 16 | replaced by 17 | namespace="http://www.opengis.net/gml/3.2" 18 | 19 | - gcoBase.xsd line2: 20 | xmlns:gml="http://www.opengis.net/gml" 21 | replaced by 22 | xmlns:gml="http://www.opengis.net/gml/3.2" 23 | 24 | - gcoBase.xsd line11: 25 | namespace="http://www.opengis.net/gml" 26 | replaced by 27 | namespace="http://www.opengis.net/gml/3.2" 28 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gco/gco.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:00:06 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gfc/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Validated with XSV 2.10, Xerces J 2.7.1 and XML Spy 2009 (2009-02-26, IGN / France - Nicolas Lesage / Marcellin Prudham) 3 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gfc/gfc.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 03-09-2009 14:09:38 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gmd/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Validated with XSV 2.10, Xerces J 2.7.1 and XML Spy 2009 (2009-03-02, IGN / France - Nicolas Lesage / Marcellin Prudham) 3 | 4 | 5 | ************************** 6 | 7 | Package gmd from Eden repository (http://eden.ign.fr/xsd) 2008-06-26 full release of ISO/TC211 schemas without any modification -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gmd/applicationSchema.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:40:03 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Information about the application schema used to build the dataset 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gmd/gmd.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:40:04 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gmd/portrayalCatalogue.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:40:03 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Information identifing the portrayal catalogue used 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gmi/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Validated with XSV 2.10, Xerces J 2.7.1 and XML Spy 2009 (2009-03-02, IGN / France - Nicolas Lesage / Marcellin Prudham) 3 | 4 | 5 | ************************** 6 | 7 | Package gmi from Eden repository (http://eden.ign.fr/xsd) 2008-06-26 full release of ISO/TC211 schemas modified as follows : 8 | 9 | - spatialRepresentationInformation.xsd line3: 10 | xmlns:gml="http://www.opengis.net/gml" 11 | replaced by 12 | xmlns:gml="http://www.opengis.net/gml/3.2" 13 | 14 | - spatialRepresentationInformation.xsd line11: 15 | namespace="http://www.opengis.net/gml" 16 | replaced by 17 | namespace="http://www.opengis.net/gml/3.2" 18 | 19 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gmi/gmi.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | This file was generated from ISO TC/211 UML class diagrams == 04-04-2008 17:12:49 ====== 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gmi/metadataEntitySet.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | This file was generated from ISO TC/211 UML class diagrams == 04-04-2008 17:12:49 ====== 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Description: Root entity that defines information about imagery or gridded data - shortName: IMetadata 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gml/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Validated with XSV 2.10, Xerces J 2.7.1 and XML Spy 2009 (2009-03-02, IGN / France - Nicolas Lesage / Marcellin Prudham) 3 | 4 | 5 | ************************** 6 | 7 | Package gml from the OGC published GML 3.2.1 schemas from OGC 07-036 (schemas repository http://schemas.opengis.net/) modified as follows : 8 | 9 | - gmlBase.xsd line14: 10 | schemaLocation="../../xlink/1.0.0/xlinks.xsd" 11 | replaced by 12 | schemaLocation="../xlink/xlinks.xsd" 13 | 14 | - referenceSystems.xsd line12: 15 | schemaLocation="../../iso/19139/20070417/gmd/gmd.xsd" 16 | replaced by 17 | schemaLocation="../gmd/gmd.xsd" 18 | 19 | - coordinateOperations.xsd line16: 20 | schemaLocation="../../iso/19139/20070417/gmd/gmd.xsd" 21 | replaced by 22 | schemaLocation="../gmd/gmd.xsd" -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gml/gml.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | gml.xsd 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gml/measures.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | measures.xsd 5 | See ISO/DIS 19136 17.3. 6 | gml:MeasureType is defined in the basicTypes schema. The measure types defined here correspond with a set of convenience measure types described in ISO/TS 19103. The XML implementation is based on the XML Schema simple type "double" which supports both decimal and scientific notation, and includes an XML attribute "uom" which refers to the units of measure for the value. Note that, there is no requirement to store values using any particular format, and applications receiving elements of this type may choose to coerce the data to any other type as convenient. 7 | 8 | 9 | 10 | 11 | 12 | The value of a physical quantity, together with its unit. 13 | 14 | 15 | 16 | 17 | This is a prototypical definition for a specific measure type defined as a vacuous extension (i.e. aliases) of gml:MeasureType. In this case, the content model supports the description of a length (or distance) quantity, with its units. The unit of measure referenced by uom shall be suitable for a length, such as metres or feet. 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | The gml:angle property element is used to record the value of an angle quantity as a single number, with its units. 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gmx/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Validated with XSV 2.10, Xerces J 2.7.1 and XML Spy 2009 (2009-03-02, IGN / France - Nicolas Lesage / Marcellin Prudham) 3 | 4 | 5 | ************************** 6 | 7 | Package gmx from Eden repository (http://eden.ign.fr/xsd) 2008-06-26 full release of ISO/TC211 schemas modified as follows : 8 | 9 | - uomItem.xsd line2: 10 | xmlns:gml="http://www.opengis.net/gml" 11 | replaced by 12 | xmlns:gml="http://www.opengis.net/gml/3.2" 13 | 14 | - uomItem.xsd line9: 15 | namespace="http://www.opengis.net/gml" 16 | replaced by 17 | namespace="http://www.opengis.net/gml/3.2" 18 | 19 | - codelistItem.xsd line2: 20 | xmlns:gml="http://www.opengis.net/gml" 21 | replaced by 22 | xmlns:gml="http://www.opengis.net/gml/3.2" 23 | 24 | - codelistItem.xsd line9: 25 | namespace="http://www.opengis.net/gml" 26 | replaced by 27 | namespace="http://www.opengis.net/gml/3.2" 28 | 29 | - crsItem.xsd line2: 30 | xmlns:gml="http://www.opengis.net/gml" 31 | replaced by 32 | xmlns:gml="http://www.opengis.net/gml/3.2" 33 | 34 | - crsItem.xsd line8: 35 | namespace="http://www.opengis.net/gml" 36 | replaced by 37 | namespace="http://www.opengis.net/gml/3.2" -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gmx/gmx.xsd: -------------------------------------------------------------------------------- 1 |  2 | This file was generated from ISO TC/211 UML class diagrams == 03-18-2005 11:12:17 ====== -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gmx_and_srv.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This amalgamates gmx and srv schemas, for service validation 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gsr/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Validated with XSV 2.10, Xerces J 2.7.1 and XML Spy 2009 (2009-03-02, IGN / France - Nicolas Lesage / Marcellin Prudham) 3 | 4 | 5 | ************************** 6 | 7 | Package gsr from Eden repository (http://eden.ign.fr/xsd) 2008-06-26 full release of ISO/TC211 schemas modified as follows : 8 | 9 | - spatialReferencing.xsd line2: 10 | xmlns:gml="http://www.opengis.net/gml" 11 | replaced by 12 | xmlns:gml="http://www.opengis.net/gml/3.2" 13 | 14 | - spatialReferencing.xsd line9: 15 | namespace="http://www.opengis.net/gml" 16 | replaced by 17 | namespace="http://www.opengis.net/gml/3.2" -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gsr/gsr.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:24:48 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gsr/spatialReferencing.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:24:48 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gss/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Validated with XSV 2.10, Xerces J 2.7.1 and XML Spy 2009 (2009-03-02, IGN / France - Nicolas Lesage / Marcellin Prudham) 3 | 4 | 5 | ************************** 6 | 7 | Package gco from Eden repository (http://eden.ign.fr/xsd) 2008-06-26 full release of ISO/TC211 schemas modified as follows : 8 | 9 | - geometry.xsd line2: 10 | xmlns:gml="http://www.opengis.net/gml" 11 | replaced by 12 | xmlns:gml="http://www.opengis.net/gml/3.2" 13 | 14 | - geometry.xsd line8: 15 | namespace="http://www.opengis.net/gml" 16 | replaced by 17 | namespace="http://www.opengis.net/gml/3.2" 18 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gss/gss.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:14:37 ====== This package contains the normative (Geometry and Topology) parts of the model for ISO 19107. This document should be referred to as the official description of the Model. If there are any differences, then ISO 19107 takes precedence. - - This packages also contains example (informative) of applications of 19107. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gts/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Validated with XSV 2.10, Xerces J 2.7.1 and XML Spy 2009 (2009-03-02, IGN / France - Nicolas Lesage / Marcellin Prudham) 3 | 4 | 5 | ************************** 6 | 7 | Package gts from Eden repository (http://eden.ign.fr/xsd) 2008-06-26 full release of ISO/TC211 schemas modified as follows : 8 | 9 | - temporalObjects.xsd line2: 10 | xmlns:gml="http://www.opengis.net/gml" 11 | replaced by 12 | xmlns:gml="http://www.opengis.net/gml/3.2" 13 | 14 | - temporalObjects.xsd line8: 15 | namespace="http://www.opengis.net/gml" 16 | replaced by 17 | namespace="http://www.opengis.net/gml/3.2" 18 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gts/gts.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:18:09 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/gts/temporalObjects.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:18:09 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/readme.rst: -------------------------------------------------------------------------------- 1 | This is the EDEN version of the ISO 19139 XSD Schema, for validating spatial metadata. It was downloaded from:: 2 | 3 | http://eden.ign.fr/xsd/isotc211/isofull/20090316 4 | http://eden.ign.fr/xsd/isotc211/iso19119/20090316/ISO19139schemas-20090316.zip/view 5 | 6 | It is assumed that copyright for the rest of the files in this directory and sub directories rests with ISO and EDEN. 7 | 8 | Notes about this release from EDEN web page: 9 | 10 | ISO/TS 19139 based XML Schemas, i.e. consistent grouping of ISO/TS 19139 based XML Schema implementations of the ISO/TC 211 standards. 11 | 12 | 2009-03-16 release includes the XML Schema implementation of ISO 19115 (2009-03-16), ISO 19119 (2009-03-16), ISO 19115-2 (2009-03-16) and ISO 19110 (2009-03-16). It does not include ISO 19126 XML Schema Implementation. Note that all 2009-03-16 releases are conformant with OGC published GML 3.2.1 schemas from OGC 07-036 (schemas repository http://schemas.opengis.net/). 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/resources/Codelist/tcCodelists.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | tcCodelists 6 | 7 | 8 | Codelists used in the type catalogue schema 9 | 10 | 11 | Type catalogues 12 | 13 | 14 | 0.1 15 | 16 | 17 | 2007-06-14 18 | 19 | 20 | 21 | 22 | 23 | 24 | specifies aggregation semantics: specifies whether the value of each property is a single value ("noAggregation") which is the default case or if a single property instance has an aggregate value in which case the value specifies the aggregation type ("bag", "set", "sequence"). Note that this value is independent from the cardinality. 25 | TC_AggregationType 26 | 27 | 28 | single value - no aggregation (default) 29 | noAggregation 30 | 31 | 32 | 33 | 34 | aggregation semantics: bag 35 | bag 36 | 37 | 38 | 39 | 40 | aggregation semantics: set 41 | set 42 | 43 | 44 | 45 | 46 | aggregation semantics: sequence (ordered bag) 47 | sequence 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/resources/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Validated with XSV 2.10, Xerces J 2.7.1 and XML Spy 2009 (2009-03-02, IGN / France - Nicolas Lesage / Marcellin Prudham) 3 | 4 | 5 | ************************** 6 | 7 | Package "resources" from the ISO repository (http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/) 8 | downloaded 2009-03-02 and modified as follows: 9 | 10 | schemaLocation http://www.opengis.net/gml/3.2 ../../../ISO_19136_Schemas/gml.xsd 11 | AND http://www.w3.org/1999/xlink http://schemas.opengis.net/xlink/1.0.0/xlinks.xsd 12 | replaced everywhere by 13 | http://www.opengis.net/gml/3.2 ../../gml/gml.xsd 14 | AND http://www.w3.org/1999/xlink ../../xlink/xlinks.xsd 15 | 16 | 17 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/resources/uom/gmxUom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | gmxUom 6 | 7 | 8 | units of measure dictionary compliant with SI definitions 9 | 10 | 11 | ISO/TC 211 GMX (and imported) namespace 12 | 13 | 14 | 0.0 15 | 16 | 17 | 2005-03-18 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | The metre is the length of the path travelled by ligth in vaccum during a time interval of 1/299 792 458 of a second 26 | metre 27 | length 28 | m 29 | 30 | 31 | 32 | 33 | 34 | 35 | Measure of angle equal to Pi/180 radians, widely used in geography 36 | degree 37 | angle 38 | 39 | 1.74532925199433E-02 40 | 41 | 42 | 43 | 44 | 45 | 46 | Radian is an unit of angle measure. It is defined as the ratio of arc length to the radius of the circle. 47 | radian 48 | plane angle 49 | rad 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/srv/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Validated with XSV 2.10, Xerces J 2.7.1 and XML Spy 2009 (2009-03-02, IGN / France - Nicolas Lesage / Marcellin Prudham) 3 | 4 | 5 | ************************** 6 | 7 | Package srv from Eden repository (http://eden.ign.fr/xsd/isotc211/iso19119/20071126) modified as follows : 8 | 9 | - serviceMetadata.xsd line75/76: 10 | 11 | 12 | REPLACED BY: 13 | 14 | 15 | 16 | - serviceMetadata.xsd line141: 17 | 18 | 19 | 20 | 21 | REPLACED BY: 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/srv/srv.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | This file was generated from ISO TC/211 UML class diagrams == 10-13-2006 11:14:05 ====== 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139eden/xlink/version.txt: -------------------------------------------------------------------------------- 1 | XML Linking Language (XLink) Version 1.0 - W3C Recommendation 27 June 2001 - XML Schema document 2 | 3 | This file is a local copy (W3C does not provide a version of the schema document). 4 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/19139.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/validation/xml/iso19139ngdc/19139.zip -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/CLASS/SST50_Auxiliary.xsd: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/EML/eml-2.1.0/eml-documentation.xsd: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 11 | 12 | '$RCSfile: eml-documentation.xsd,v $' 13 | Copyright: 1997-2002 Regents of the University of California, 14 | University of New Mexico, and 15 | Arizona State University 16 | Sponsors: National Center for Ecological Analysis and Synthesis and 17 | Partnership for Interdisciplinary Studies of Coastal Oceans, 18 | University of California Santa Barbara 19 | Long-Term Ecological Research Network Office, 20 | University of New Mexico 21 | Center for Environmental Studies, Arizona State University 22 | Other funding: National Science Foundation (see README for details) 23 | The David and Lucile Packard Foundation 24 | For Details: http://knb.ecoinformatics.org/ 25 | 26 | '$Author: obrien $' 27 | '$Date: 2008/08/27 21:30:04 $' 28 | '$Revision: 1.27 $' 29 | 30 | This program is free software; you can redistribute it and/or modify 31 | it under the terms of the GNU General Public License as published by 32 | the Free Software Foundation; either version 2 of the License, or 33 | (at your option) any later version. 34 | 35 | This program is distributed in the hope that it will be useful, 36 | but WITHOUT ANY WARRANTY; without even the implied warranty of 37 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 38 | GNU General Public License for more details. 39 | 40 | You should have received a copy of the GNU General Public License 41 | along with this program; if not, write to the Free Software 42 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/ngdcSchema/fgdc-std-012-2002/fgdc-std-012-2002-plmiinfo.xsd: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | Element: Platform and Mission Information Description: Descriptive 9 | information about the platform from which the measurements that produced the data 10 | and about the program of which the data collection was a part. 11 | 12 | Platform and Mission Information 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/ngdcSchema/schema.xsd: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema.xsd: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gco/gco.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:00:06 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gfc/gfc.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 03-09-2009 14:09:38 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gmd/applicationSchema.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:40:03 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Information about the application schema used to build the dataset 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gmd/gmd.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:40:04 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gmd/portrayalCatalogue.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:40:03 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Information identifing the portrayal catalogue used 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gmi/gmi.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | This file was generated from ISO TC/211 UML class diagrams == 04-04-2008 17:12:49 ====== 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gmi/metadataEntitySet.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | This file was generated from ISO TC/211 UML class diagrams == 04-04-2008 17:12:49 ====== 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Description: Root entity that defines information about imagery or gridded data - shortName: IMetadata 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gml/gml.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | gml.xsd 5 | 6 | GML is an OGC Standard. 7 | Copyright (c) 2007,2010 Open Geospatial Consortium, Inc. All Rights Reserved. 8 | To obtain additional rights of use, visit http://www.opengeospatial.org/legal/ . 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gml/gml_3_2_1-ReadMe.txt: -------------------------------------------------------------------------------- 1 | OpenGIS(r) GML schema version 3.2.1 / ISO 19136 - ReadMe.txt 2 | 3 | The root document of the GML schema is file "gml.xsd" 4 | 5 | The schema has been validated with Xerces-J, Xerces C++ and XSV. 6 | 7 | GML 3.2.1 (ISO 19136) 8 | 9 | * Published GML 3.2.1 schemas from OGC 07-036 10 | * validated with oXygen 8.2 (xerces-J 2.9.0) - Kevin Stegemoller 11 | * validated with Xerces-J, Xerces-C++ and XSV - Clemens Portele 12 | 13 | -- 2007-09-06 14 | 15 | Changes made to these GML 3.2.1 / ISO 19136 schemas: 16 | * added ReadMe.txt 17 | * changed gmd.xsd references to "../../iso/19139/20070417/gmd/gmd.xsd" 18 | * changed xlink references to be relative to /xlink/1.0.0/xlinks.xsd 19 | available from http://schemas.opengis.net/xlink/1.0.0/xlinks.xsd . 20 | * removed xlinks schema and directory 21 | 22 | Changes made to these ISO 19139 schemas by OGC: 23 | * added ReadMe.txt 24 | * changed ISO_19136 path to /gml/3.2.1/ 25 | * changed xlink references to be relative to /xlink/1.0.0/xlinks.xsd 26 | available from http://schemas.opengis.net/xlink/1.0.0/xlinks.xsd . 27 | * removed xlinks schema and directory 28 | 29 | OGC GML 3.2.1 / ISO 19136 schemas files will be published at: 30 | - http://schemas.opengis.net/gml/3.2.1/ 31 | - http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19136_Schemas/ 32 | 33 | Files in the folder "ISO/19139/20070417" are also published at 34 | - http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/ 35 | 36 | -- 2007-08-17 37 | 38 | The Open Geospatial Consortium, Inc. official schema repository is at 39 | http://schemas.opengis.net/ . 40 | Policies, Procedures, Terms, and Conditions of OGC(r) are available 41 | http://www.opengeospatial.org/ogc/policies/ . 42 | Additional rights of use are described at 43 | http://www.opengeospatial.org/legal/ . 44 | 45 | Copyright (c) 2007 Open Geospatial Consortium, Inc. All Rights Reserved. 46 | 47 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gml/readme.txt: -------------------------------------------------------------------------------- 1 | OpenGIS(r) GML schema ReadMe.txt 2 | ----------------------------------------------------------------------- 3 | 4 | OpenGIS Geography Markup Language (GML) Encoding Standard 5 | 6 | More information on the OGC GML standard may be found at 7 | http://www.opengeospatial.org/standards/gml 8 | 9 | The most current schema are available at http://schemas.opengis.net/ . 10 | 11 | ----------------------------------------------------------------------- 12 | 13 | Note: The root document of the GML 3.x schema is the file "gml.xsd". 14 | 15 | 2010-01-28 Kevin Stegemoller 16 | * v1.0-v3.2: update/verify copyright (06-135r7 s#3.2) 17 | * v1.0-v3.2: update relative schema imports to absolute URLs (06-135r7 s#15) 18 | * v1.0-v3.2: updated xsd:schema:@version attribute (06-135r7 s#13.4) 19 | * v1.0-v3.2: add archives (.zip) files of previous versions 20 | * v1.0-v3.2: create/update ReadMe.txt (06-135r7 s#17) 21 | 22 | 2007-09-06 Kevin Stegemoller 23 | 24 | * v3.2.1: Posted GML 3.2.1 (ISO 19136) schemas from OGC 07-036 25 | See http://schemas.opengis.net/gml/3.2.1/gml_3_2_1-ReadMe.txt 26 | 27 | NOTICE: GML 2.1.2 will link to the newest version of GML 2.1.2.x . As 28 | of 5 September 2007, the contents of 2.1.2 contain GML 2.1.2.1 per OGC 29 | 06-189. If you have questions, please contact the webmaster (at) 30 | opengeospatial.org. -- 2007-09-05 Kevin Stegemoller 31 | 32 | 2007-08-27 Chris Holmes 33 | 34 | * v2.1.2: update 2.1.2.1 and ReadMe.txt changes 35 | * v2.1.2.0: Contains previous version of GML 2.1.2 (pre- 5 Sep 2007) 36 | * v2.1.2.1: Contains Corrigendum 1 for GML 2.1.2 schema fix (OGC 06-189). 37 | * v2.1.2.1: Corrigendum 1 for GML 2.1.2 schema fix (OGC 06-189) includes: 38 | + Official schema location is now http://schemas.opengis.net 39 | + replace xlink import schema location with ../../xlink/1.0.0/xlinks.xsd 40 | + remove gml/2.1.2/xlinks.xsd (optional, as is now unused). 41 | + geometry.xsd: fixed so will now validate by conformant processors by: 42 | + geometry.xsd: moving minOccurs/maxOccurs cardinality indicators from 43 | declarations to their containing elements in the 44 | context of the GML property pattern. -- SJDC 2006-12-07 45 | + gml:Coord is suppressed. -- SJDC 2006-12-07 46 | 47 | 2005-11-22 Arliss Whiteside 48 | 49 | * GML versions 2.0.0 through 3.1.1: The sets of XML Schema Documents for 50 | OpenGIS GML Versions 2.0.0 through 3.1.1 have been edited to reflect the 51 | corrigenda to all those OGC documents that is based on the change requests: 52 | OGC 05-068r1 "Store xlinks.xsd file at a fixed location" 53 | OGC 05-081r2 "Change to use relative paths" 54 | OGC 05-105 "Remove description and copyright tags from XML schema documents" 55 | 56 | * Note: check each OGC numbered document for detailed changes. 57 | 58 | ----------------------------------------------------------------------- 59 | 60 | Policies, Procedures, Terms, and Conditions of OGC(r) are available 61 | http://www.opengeospatial.org/ogc/legal/ . 62 | 63 | Copyright (c) 2010 Open Geospatial Consortium, Inc. All Rights Reserved. 64 | 65 | ----------------------------------------------------------------------- 66 | 67 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gmx/gmx.xsd: -------------------------------------------------------------------------------- 1 |  2 | This file was generated from ISO TC/211 UML class diagrams == 03-18-2005 11:12:17 ====== -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gsr/gsr.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:24:48 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gsr/spatialReferencing.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:24:48 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gss/gss.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:14:37 ====== This package contains the normative (Geometry and Topology) parts of the model for ISO 19107. This document should be referred to as the official description of the Model. If there are any differences, then ISO 19107 takes precedence. - - This packages also contains example (informative) of applications of 19107. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gts/gts.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:18:09 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/gts/temporalObjects.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This file was generated from ISO TC/211 UML class diagrams == 01-26-2005 12:18:09 ====== 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/mf/coverageType.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/mf/metafor.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | This file was generated from ISO TC/211 UML class diagrams == 06-18-2005 15:21:56 ====== 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/resources/example/fr-fr.xml: -------------------------------------------------------------------------------- 1 | France-France French FR UTF 8 2005-03-18 création 2006-02-03 révision french translation team auteur Résumé succint du contenu du jeu de données -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/resources/uom/gmxUom.xml: -------------------------------------------------------------------------------- 1 | gmxUom units of measure dictionary compliant with SI definitions ISO/TC 211 GMX (and imported) namespace 0.0 2005-03-18 The metre is the length of the path travelled by ligth in vaccum during a time interval of 1/299 792 458 of a second metre length m Measure of angle equal to Pi/180 radians, widely used in geography degree angle 1.74532925199433E-02 Radian is an unit of angle measure. It is defined as the ratio of arc length to the radius of the circle. radian plane angle rad -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/srv/srv.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | This file was generated from ISO TC/211 UML class diagrams == 10-13-2006 11:14:05 ====== 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schema/xlink/version.txt: -------------------------------------------------------------------------------- 1 | XML Linking Language (XLink) Version 1.0 - W3C Recommendation 27 June 2001 - XML Schema document 2 | 3 | This file is a local copy (W3C does not provide a version of the schema document). 4 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schematron/asciiValidationForFGDC.sch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Report weird characters 8 | 9 | [1]Replace the “ smart quotes. 10 | [1]Replace the ” smart quotes. 11 | [1]Replace the ‘ smart quote. 12 | [1]Replace the ’ smart quote. 13 | [1]Replace the – dash. 14 | [1]Replace the — em dash entity. 15 | [1]Replace the ® registred trademark symbol. 16 | [1]Replace the ° degree symbol. 17 | [1]Replace the © symbol. 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schematron/asciiValidationForISO.sch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Report weird characters 16 | 17 | [1]Replace the “ smart quotes. 18 | [1]Replace the ” smart quotes. 19 | [1]Replace the ‘ smart quote. 20 | [1]Replace the ’ smart quote. 21 | [1]Replace the – dash. 22 | [1]Replace the — em dash entity. 23 | [1]Replace the ® registred trademark symbol. 24 | [1]Replace the ° degree symbol. 25 | [1]Replace the © symbol. 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schematron/codeListValidation.sch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 25 | 26 | Check that the codeList exists and that the codeListValue is in that codeList 27 | 28 | 29 | 30 | 31 | 32 | Unable to find the specified codeList document or CodeListDictionary node. 33 | codeListValue is not in the specified codeList. 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schematron/schematronOutput.css: -------------------------------------------------------------------------------- 1 | schematron-output { 2 | display : block; 3 | margin : 1em; 4 | } 5 | 6 | schematron-output:before { 7 | display : block; 8 | content : "Schematron Error Report"; 9 | border-bottom : 0.1em solid navy; 10 | padding : 0.3em; 11 | font-size : large; 12 | font-weight : bold; 13 | color : navy; 14 | background-color : inherit; 15 | } 16 | 17 | active-pattern{ 18 | display: none; 19 | } 20 | 21 | failed-assert:before { 22 | font-weight : bold; 23 | content: "Error found at Xpath :" attr(location); 24 | } 25 | successful-report:before { 26 | font-weight : bold; 27 | content: "Non-ASCII character found at XPath: " attr(location); 28 | } 29 | 30 | text{ 31 | display: block; 32 | } 33 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/iso19139ngdc/schematron/schematronOutputWMO.css: -------------------------------------------------------------------------------- 1 | schematron-output { 2 | display : block; 3 | margin : 1em; 4 | } 5 | 6 | schematron-output:before { 7 | display : block; 8 | content : "WMO Profile - Schematron Error Report"; 9 | /*border-bottom : 0.1em solid navy;*/ 10 | padding-bottom : 0.5em; 11 | font-size : large; 12 | font-weight : bold; 13 | color : navy; 14 | background-color : inherit; 15 | } 16 | 17 | active-pattern{ 18 | display: none; 19 | } 20 | 21 | failed-assert:before { 22 | display:block; 23 | font-weight : bold; 24 | color: black; 25 | padding-top : 0.5em; 26 | content : "Error found at Xpath: " 27 | } 28 | 29 | xpath { 30 | display: block; 31 | font-weight : normal; 32 | color: black; 33 | } 34 | 35 | text { 36 | display: block; 37 | font-weight: bold; 38 | color: red; 39 | padding-bottom : 0.5em; 40 | border-bottom : 0.1em solid navy; 41 | } 42 | 43 | successful-report:after { 44 | font-weight : bold; 45 | color: green; 46 | content: "Non-ASCII character found at XPath: " attr(test); 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/medin/MedinMetadataProfile_v1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/ckanext/spatial/validation/xml/medin/MedinMetadataProfile_v1.0.pdf -------------------------------------------------------------------------------- /ckanext/spatial/validation/xml/schematron/iso_schematron_message.xsl: -------------------------------------------------------------------------------- 1 | 2 | 25 | 26 | 27 | 28 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 | 46 | 47 | 48 | 49 | ( 51 | / 52 | ) 53 | 54 | 55 | -------------------------------------------------------------------------------- /ckanext/spatial/views.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import logging 4 | 5 | from flask import Blueprint, make_response 6 | 7 | import ckan.lib.helpers as h 8 | import ckan.plugins.toolkit as tk 9 | 10 | from ckanext.spatial import util 11 | 12 | 13 | log = logging.getLogger(__name__) 14 | 15 | 16 | harvest_metadata = Blueprint("spatial_harvest_metadata", __name__) 17 | 18 | 19 | def harvest_object_redirect_xml(id): 20 | return h.redirect_to("/harvest/object/{}".format(id)) 21 | 22 | 23 | def harvest_object_redirect_html(id): 24 | return h.redirect_to("/harvest/object/{}/html".format(id)) 25 | 26 | 27 | def display_xml_original(id): 28 | content = util.get_harvest_object_original_content(id) 29 | 30 | if not content: 31 | return tk.abort(404) 32 | 33 | headers = {"Content-Type": "application/xml; charset=utf-8"} 34 | 35 | if "\n' + content 37 | return make_response((content, 200, headers)) 38 | 39 | 40 | def display_html(id): 41 | content = util.get_harvest_object_content(id) 42 | 43 | if not content: 44 | return tk.abort(404) 45 | headers = {"Content-Type": "text/html; charset=utf-8"} 46 | 47 | xslt_package, xslt_path = util.get_xslt() 48 | content = util.transform_to_html(content, xslt_package, xslt_path) 49 | return make_response((content, 200, headers)) 50 | 51 | 52 | def display_html_original(id): 53 | content = util.get_harvest_object_original_content(id) 54 | 55 | if content is None: 56 | return tk.abort(404) 57 | headers = {"Content-Type": "text/html; charset=utf-8"} 58 | 59 | xslt_package, xslt_path = util.get_xslt(original=True) 60 | content = util.transform_to_html(content, xslt_package, xslt_path) 61 | return make_response((content, 200, headers)) 62 | 63 | 64 | harvest_metadata.add_url_rule( 65 | "/api/2/rest/harvestobject//xml", view_func=harvest_object_redirect_xml 66 | ) 67 | harvest_metadata.add_url_rule( 68 | "/api/2/rest/harvestobject//html", view_func=harvest_object_redirect_html 69 | ) 70 | 71 | harvest_metadata.add_url_rule( 72 | "/harvest/object//original", view_func=display_xml_original 73 | ) 74 | harvest_metadata.add_url_rule("/harvest/object//html", view_func=display_html) 75 | harvest_metadata.add_url_rule( 76 | "/harvest/object//html/original", view_func=display_html_original 77 | ) 78 | -------------------------------------------------------------------------------- /dev-requirements.txt: -------------------------------------------------------------------------------- 1 | pytest-ckan 2 | pytest-httpserver == 1.0.2; python_version < '3.10' 3 | pytest-httpserver; python_version >= '3.10' 4 | -------------------------------------------------------------------------------- /doc/_assets/ckan.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/doc/_assets/ckan.ico -------------------------------------------------------------------------------- /doc/_assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/doc/_assets/logo.png -------------------------------------------------------------------------------- /doc/_css/extra.css: -------------------------------------------------------------------------------- 1 | [data-md-color-scheme="ckan"] { 2 | --md-primary-fg-color: #2980b9; 3 | --md-primary-fg-color--light: #ECB7B7; 4 | --md-primary-fg-color--dark: #90030C; 5 | } 6 | 7 | [data-md-color-scheme="slate"] { 8 | --md-primary-fg-color: #2980b9; 9 | --md-primary-fg-color--light: #ECB7B7; 10 | --md-primary-fg-color--dark: #90030C; 11 | --md-hue: 210; 12 | } 13 | 14 | 15 | [data-md-toggle="search"]:not(:checked) ~ .md-header .md-search__form::after { 16 | position: absolute; 17 | top: .3rem; 18 | right: .3rem; 19 | display: block; 20 | padding: .1rem .4rem; 21 | color: var(--md-default-bg-color); 22 | font-weight: bold; 23 | font-size: .8rem; 24 | border: .05rem solid var(--md-default-bg-color--lighter); 25 | border-radius: .1rem; 26 | content: "/"; 27 | } 28 | -------------------------------------------------------------------------------- /doc/_static/base-map-stamen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/doc/_static/base-map-stamen.png -------------------------------------------------------------------------------- /doc/_static/dataset-extent-map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/doc/_static/dataset-extent-map.png -------------------------------------------------------------------------------- /doc/_static/index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/doc/_static/index.png -------------------------------------------------------------------------------- /doc/_static/no-map-provider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/doc/_static/no-map-provider.png -------------------------------------------------------------------------------- /doc/_static/spatial-search-widget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/doc/_static/spatial-search-widget.png -------------------------------------------------------------------------------- /doc/_static/stamen-map-provider-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ckan/ckanext-spatial/1e109aa296f3d89a66bd23831943b7770fff177b/doc/_static/stamen-map-provider-error.png -------------------------------------------------------------------------------- /doc/changelog.md: -------------------------------------------------------------------------------- 1 | --8<-- "CHANGELOG.md" 2 | -------------------------------------------------------------------------------- /doc/index.md: -------------------------------------------------------------------------------- 1 | # ckanext-spatial - Geo related plugins for CKAN 2 | 3 | [![Tests](https://github.com/ckan/ckanext-spatial/workflows/Tests/badge.svg?branch=master)](https://github.com/ckan/ckanext-spatial/actions) 4 | 5 | This extension contains plugins that add geospatial capabilities to 6 | [CKAN](http://ckan.org). 7 | 8 | You should have a CKAN instance installed before adding these plugins. 9 | Head to the [CKAN documentation](http://docs.ckan.org) for information 10 | on how to set up CKAN. 11 | 12 | The extension allows to perform spatial queries and display the dataset 13 | extent on the frontend. It also provides harvesters to import geospatial 14 | metadata into CKAN from other sources, as well as commands to support 15 | the OGC CSW standard via [pycsw](http://pycsw.org). 16 | 17 | 18 | ![Spatial search](_static/index.png) 19 | -------------------------------------------------------------------------------- /doc/previews.md: -------------------------------------------------------------------------------- 1 | # Previews for Spatial Formats 2 | 3 | !!! Note 4 | The view plugins for rendering spatial formats can be found in 5 | [ckanext-geoview](https://github.com/ckan/ckanext-geoview), which 6 | contains view plugins based on [OpenLayers](http://openlayers.org) and 7 | [Leaflet](http://leafletjs.org) to display several geospatial files and 8 | services in CKAN. 9 | -------------------------------------------------------------------------------- /doc/requirements.txt: -------------------------------------------------------------------------------- 1 | mkdocs-material 2 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: ckanext-spatial 2 | #site_url: https://docs.ckan.org/projects/ckanext-spatial 3 | site_url: http://localhost:8000 4 | 5 | site_description: >- 6 | The documentation of ckanext-spatial, a CKAN extension that 7 | improves CKAN geospatial capabilities. 8 | 9 | 10 | repo_name: ckan/ckanext-spatial 11 | repo_url: https://github.com/ckan/ckanext-spatial 12 | 13 | docs_dir: doc 14 | 15 | theme: 16 | name: material 17 | palette: 18 | 19 | # Palette toggle for light mode 20 | - media: "(prefers-color-scheme: light)" 21 | scheme: ckan 22 | toggle: 23 | icon: material/toggle-switch 24 | name: Switch to dark mode 25 | 26 | # Palette toggle for dark mode 27 | - media: "(prefers-color-scheme: dark)" 28 | scheme: slate 29 | toggle: 30 | icon: material/toggle-switch-off 31 | name: Switch to light mode 32 | 33 | logo: _assets/logo.png 34 | favicon: _assets/ckan.ico 35 | features: 36 | - navigation.expand 37 | - navigation.footer 38 | - navigation.instant 39 | - navigation.instant.progress 40 | - search.suggest 41 | - search.highlight 42 | - toc.integrate 43 | - content.code.copy 44 | 45 | plugins: 46 | - search 47 | 48 | markdown_extensions: 49 | - toc: 50 | permalink: true 51 | - admonition 52 | - pymdownx.highlight: 53 | anchor_linenums: true 54 | line_spans: __span 55 | pygments_lang_class: true 56 | - pymdownx.inlinehilite 57 | - pymdownx.superfences 58 | - pymdownx.tabbed: 59 | alternate_style: true 60 | - pymdownx.snippets 61 | 62 | 63 | extra_css: 64 | - _css/extra.css 65 | 66 | nav: 67 | - Home: 'index.md' 68 | - Installation and setup: 'install.md' 69 | - Spatial search: 'spatial-search.md' 70 | - Spatial harvesters: 'harvesters.md' 71 | - Other features: 72 | - CSW: 'csw.md' 73 | - Previews of spatial formats: 'previews.md' 74 | - Common base layer for map widgets: 'map-widgets.md' 75 | - CHANGELOG: 'changelog.md' 76 | -------------------------------------------------------------------------------- /pip-requirements.txt: -------------------------------------------------------------------------------- 1 | requirements.txt -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "ckanext-spatial" 7 | description = "Geo-related plugins for CKAN" 8 | keywords = [""] 9 | readme = "README.rst" 10 | authors = [ 11 | {name = "CKAN Tech Team", email = "ckan-dev@ckan.org"}, 12 | ] 13 | classifiers = [ 14 | "Development Status :: 5 - Production/Stable", 15 | "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", 16 | "Programming Language :: Python", 17 | "Programming Language :: Python :: 3.10", 18 | "Programming Language :: Python :: 3.11", 19 | "Programming Language :: Python :: 3.12", 20 | "Programming Language :: Python :: 3.9", 21 | ] 22 | dependencies = [] 23 | license = {text = "AGPL"} 24 | requires-python = ">=3.9" 25 | 26 | dynamic = ["version"] 27 | 28 | [project.entry-points."ckan.plugins"] 29 | spatial_metadata = "ckanext.spatial.plugin:SpatialMetadata" 30 | spatial_query = "ckanext.spatial.plugin:SpatialQuery" 31 | spatial_harvest_metadata_api = "ckanext.spatial.plugin:HarvestMetadataApi" 32 | 33 | csw_harvester = "ckanext.spatial.harvesters:CSWHarvester" 34 | waf_harvester = "ckanext.spatial.harvesters:WAFHarvester" 35 | doc_harvester = "ckanext.spatial.harvesters:DocHarvester" 36 | 37 | # Legacy harvesters 38 | gemini_csw_harvester = "ckanext.spatial.harvesters.gemini:GeminiCswHarvester" 39 | gemini_doc_harvester = "ckanext.spatial.harvesters.gemini:GeminiDocHarvester" 40 | gemini_waf_harvester = "ckanext.spatial.harvesters.gemini:GeminiWafHarvester" 41 | 42 | 43 | [project.entry-points."ckan.test_plugins"] 44 | test_spatial_plugin = "ckanext.spatial.tests.test_plugin.plugin:TestSpatialPlugin" 45 | 46 | 47 | [project.urls] 48 | Homepage = "http://okfn.org" 49 | 50 | 51 | [tool.setuptools.dynamic] 52 | version = {attr = "ckanext.spatial.__version__"} 53 | 54 | 55 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | ckantoolkit 2 | lxml>=2.3 3 | argparse 4 | pyparsing>=2.1.10 5 | requests>=1.1.0 6 | cython==0.29.36; python_version < '3.9' 7 | 8 | pyproj==2.6.1; python_version < '3.9' 9 | pyproj==3.6.1; python_version >= '3.9' 10 | 11 | OWSLib==0.31.0; python_version < '3.10' 12 | OWSLib==0.32.0; python_version >= '3.10' 13 | 14 | Shapely==2.0.7 15 | geojson==3.1.0 16 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [tool:pytest] 2 | norecursedirs=ckanext/spatial/tests/nose 3 | 4 | filterwarnings = 5 | ignore::sqlalchemy.exc.SADeprecationWarning 6 | ignore::sqlalchemy.exc.SAWarning 7 | ignore::DeprecationWarning 8 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup() 4 | -------------------------------------------------------------------------------- /test.ini: -------------------------------------------------------------------------------- 1 | [DEFAULT] 2 | debug = false 3 | # Uncomment and replace with the address which should receive any error reports 4 | #email_to = you@yourdomain.com 5 | smtp_server = localhost 6 | error_email_from = paste@localhost 7 | 8 | [server:main] 9 | use = egg:Paste#http 10 | host = 0.0.0.0 11 | port = 5000 12 | 13 | 14 | [app:main] 15 | use = config:../ckan/test-core.ini 16 | ckan.legacy_templates = false 17 | ckan.plugins = spatial_metadata spatial_query 18 | ckan.spatial.srid = 4326 19 | ckan.spatial.default_map_extent=-6.88,49.74,0.50,59.2 20 | ckan.spatial.testing = true 21 | ckan.spatial.validator.profiles = iso19139,constraints,gemini2 22 | ckan.harvest.mq.type = redis 23 | 24 | # Logging configuration 25 | [loggers] 26 | keys = root, ckan, sqlalchemy 27 | 28 | [handlers] 29 | keys = console 30 | 31 | [formatters] 32 | keys = generic 33 | 34 | [logger_root] 35 | level = WARN 36 | handlers = console 37 | 38 | [logger_ckan] 39 | qualname = ckan 40 | handlers = 41 | level = INFO 42 | 43 | [logger_sqlalchemy] 44 | handlers = 45 | qualname = sqlalchemy.engine 46 | level = WARN 47 | 48 | [handler_console] 49 | class = StreamHandler 50 | args = (sys.stdout,) 51 | level = NOTSET 52 | formatter = generic 53 | 54 | [formatter_generic] 55 | format = %(asctime)s %(levelname)-5.5s [%(name)s] %(message)s 56 | --------------------------------------------------------------------------------