geonode-pycsw 3.0.0b2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- geonode_pycsw-3.0.0b2.dist-info/METADATA +73 -0
- geonode_pycsw-3.0.0b2.dist-info/RECORD +382 -0
- geonode_pycsw-3.0.0b2.dist-info/WHEEL +5 -0
- geonode_pycsw-3.0.0b2.dist-info/entry_points.txt +2 -0
- geonode_pycsw-3.0.0b2.dist-info/licenses/LICENSE.txt +26 -0
- geonode_pycsw-3.0.0b2.dist-info/top_level.txt +1 -0
- pycsw/__init__.py +33 -0
- pycsw/core/__init__.py +29 -0
- pycsw/core/admin.py +703 -0
- pycsw/core/config.py +621 -0
- pycsw/core/etree.py +43 -0
- pycsw/core/formats/__init__.py +29 -0
- pycsw/core/formats/fmt_json.py +69 -0
- pycsw/core/log.py +71 -0
- pycsw/core/metadata.py +1996 -0
- pycsw/core/pygeofilter_evaluate.py +83 -0
- pycsw/core/repository.py +941 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/_wrapper.xsd +14 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswAll.xsd +33 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswCommon.xsd +71 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswGetCapabilities.xsd +80 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswGetDomain.xsd +146 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswGetRecordById.xsd +58 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswGetRecords.xsd +391 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswHarvest.xsd +95 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswTransaction.xsd +187 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/cswUnHarvest.xsd +77 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/rec-dcmes.xsd +245 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/rec-dcterms.xsd +101 -0
- pycsw/core/schemas/ogc/cat/csw/3.0/record.xsd +170 -0
- pycsw/core/schemas/ogc/csw/2.0.2/CSW-discovery.xsd +494 -0
- pycsw/core/schemas/ogc/csw/2.0.2/CSW-publication.xsd +242 -0
- pycsw/core/schemas/ogc/csw/2.0.2/rec-dcmes.xsd +199 -0
- pycsw/core/schemas/ogc/csw/2.0.2/rec-dcterms.xsd +94 -0
- pycsw/core/schemas/ogc/csw/2.0.2/record.xsd +138 -0
- pycsw/core/schemas/ogc/filter/1.1.0/expr.xsd +67 -0
- pycsw/core/schemas/ogc/filter/1.1.0/filter.xsd +265 -0
- pycsw/core/schemas/ogc/filter/1.1.0/filterCapabilities.xsd +171 -0
- pycsw/core/schemas/ogc/filter/1.1.0/sort.xsd +46 -0
- pycsw/core/schemas/ogc/filter/2.0/_wrapper.xsd +5 -0
- pycsw/core/schemas/ogc/filter/2.0/expr.xsd +44 -0
- pycsw/core/schemas/ogc/filter/2.0/filter.xsd +396 -0
- pycsw/core/schemas/ogc/filter/2.0/filterAll.xsd +23 -0
- pycsw/core/schemas/ogc/filter/2.0/filterCapabilities.xsd +286 -0
- pycsw/core/schemas/ogc/filter/2.0/query.xsd +70 -0
- pycsw/core/schemas/ogc/filter/2.0/sort.xsd +49 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/basicTypes.xsd +278 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/coordinateOperations.xsd +789 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/coordinateReferenceSystems.xsd +429 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/coordinateSystems.xsd +408 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/coverage.xsd +451 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/dataQuality.xsd +129 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/datums.xsd +484 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/defaultStyle.xsd +454 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/dictionary.xsd +137 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/direction.xsd +72 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/dynamicFeature.xsd +115 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/feature.xsd +199 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/geometryAggregates.xsd +430 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/geometryBasic0d1d.xsd +602 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/geometryBasic2d.xsd +213 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/geometryComplexes.xsd +141 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/geometryPrimitives.xsd +1609 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/gml.xsd +22 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/gmlBase.xsd +294 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/grids.xsd +76 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/measures.xsd +200 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/observation.xsd +96 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/referenceSystems.xsd +211 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/temporal.xsd +332 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/temporalReferenceSystems.xsd +251 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/temporalTopology.xsd +186 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/topology.xsd +459 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/units.xsd +170 -0
- pycsw/core/schemas/ogc/gml/3.1.1/base/valueObjects.xsd +361 -0
- pycsw/core/schemas/ogc/gml/3.1.1/smil/smil20-language.xsd +117 -0
- pycsw/core/schemas/ogc/gml/3.1.1/smil/smil20.xsd +234 -0
- pycsw/core/schemas/ogc/gml/3.2.1/basicTypes.xsd +268 -0
- pycsw/core/schemas/ogc/gml/3.2.1/coordinateOperations.xsd +525 -0
- pycsw/core/schemas/ogc/gml/3.2.1/coordinateReferenceSystems.xsd +373 -0
- pycsw/core/schemas/ogc/gml/3.2.1/coordinateSystems.xsd +297 -0
- pycsw/core/schemas/ogc/gml/3.2.1/coverage.xsd +292 -0
- pycsw/core/schemas/ogc/gml/3.2.1/datums.xsd +287 -0
- pycsw/core/schemas/ogc/gml/3.2.1/defaultStyle.xsd +453 -0
- pycsw/core/schemas/ogc/gml/3.2.1/deprecatedTypes.xsd +1133 -0
- pycsw/core/schemas/ogc/gml/3.2.1/dictionary.xsd +90 -0
- pycsw/core/schemas/ogc/gml/3.2.1/direction.xsd +84 -0
- pycsw/core/schemas/ogc/gml/3.2.1/dynamicFeature.xsd +109 -0
- pycsw/core/schemas/ogc/gml/3.2.1/feature.xsd +94 -0
- pycsw/core/schemas/ogc/gml/3.2.1/geometryAggregates.xsd +197 -0
- pycsw/core/schemas/ogc/gml/3.2.1/geometryBasic0d1d.xsd +277 -0
- pycsw/core/schemas/ogc/gml/3.2.1/geometryBasic2d.xsd +124 -0
- pycsw/core/schemas/ogc/gml/3.2.1/geometryComplexes.xsd +95 -0
- pycsw/core/schemas/ogc/gml/3.2.1/geometryPrimitives.xsd +846 -0
- pycsw/core/schemas/ogc/gml/3.2.1/gml.xsd +20 -0
- pycsw/core/schemas/ogc/gml/3.2.1/gmlBase.xsd +185 -0
- pycsw/core/schemas/ogc/gml/3.2.1/grids.xsd +64 -0
- pycsw/core/schemas/ogc/gml/3.2.1/measures.xsd +68 -0
- pycsw/core/schemas/ogc/gml/3.2.1/observation.xsd +95 -0
- pycsw/core/schemas/ogc/gml/3.2.1/referenceSystems.xsd +70 -0
- pycsw/core/schemas/ogc/gml/3.2.1/temporal.xsd +269 -0
- pycsw/core/schemas/ogc/gml/3.2.1/temporalReferenceSystems.xsd +189 -0
- pycsw/core/schemas/ogc/gml/3.2.1/temporalTopology.xsd +119 -0
- pycsw/core/schemas/ogc/gml/3.2.1/topology.xsd +386 -0
- pycsw/core/schemas/ogc/gml/3.2.1/units.xsd +162 -0
- pycsw/core/schemas/ogc/gml/3.2.1/valueObjects.xsd +205 -0
- pycsw/core/schemas/ogc/ogcapi/records/part1/1.0/ogcapi-records-1.yaml +932 -0
- pycsw/core/schemas/ogc/ows/1.0.0/ows19115subset.xsd +222 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsAll.xsd +20 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsCommon.xsd +155 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsDataIdentification.xsd +112 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsExceptionReport.xsd +67 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsGetCapabilities.xsd +108 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsOperationsMetadata.xsd +161 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsServiceIdentification.xsd +55 -0
- pycsw/core/schemas/ogc/ows/1.0.0/owsServiceProvider.xsd +46 -0
- pycsw/core/schemas/ogc/ows/1.1.0/ows19115subset.xsd +236 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsAll.xsd +23 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsCommon.xsd +158 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsContents.xsd +87 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsDataIdentification.xsd +128 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsDomainType.xsd +280 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsExceptionReport.xsd +77 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsGetCapabilities.xsd +113 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsGetResourceByID.xsd +52 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsInputOutputData.xsd +60 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsManifest.xsd +125 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsOperationsMetadata.xsd +141 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsServiceIdentification.xsd +61 -0
- pycsw/core/schemas/ogc/ows/1.1.0/owsServiceProvider.xsd +48 -0
- pycsw/core/schemas/ogc/ows/2.0/ows19115subset.xsd +364 -0
- pycsw/core/schemas/ogc/ows/2.0/owsAdditionalParameters.xsd +114 -0
- pycsw/core/schemas/ogc/ows/2.0/owsAll.xsd +29 -0
- pycsw/core/schemas/ogc/ows/2.0/owsCommon.xsd +275 -0
- pycsw/core/schemas/ogc/ows/2.0/owsContents.xsd +163 -0
- pycsw/core/schemas/ogc/ows/2.0/owsDataIdentification.xsd +202 -0
- pycsw/core/schemas/ogc/ows/2.0/owsDomainType.xsd +388 -0
- pycsw/core/schemas/ogc/ows/2.0/owsExceptionReport.xsd +126 -0
- pycsw/core/schemas/ogc/ows/2.0/owsGetCapabilities.xsd +220 -0
- pycsw/core/schemas/ogc/ows/2.0/owsGetResourceByID.xsd +83 -0
- pycsw/core/schemas/ogc/ows/2.0/owsInputOutputData.xsd +98 -0
- pycsw/core/schemas/ogc/ows/2.0/owsManifest.xsd +181 -0
- pycsw/core/schemas/ogc/ows/2.0/owsOperationsMetadata.xsd +234 -0
- pycsw/core/schemas/ogc/ows/2.0/owsServiceIdentification.xsd +98 -0
- pycsw/core/schemas/ogc/ows/2.0/owsServiceProvider.xsd +64 -0
- pycsw/core/schemas/w3c/1999/xlink.xsd +271 -0
- pycsw/core/schemas/w3c/2001/xml.xsd +287 -0
- pycsw/core/util.py +552 -0
- pycsw/oaipmh.py +311 -0
- pycsw/ogc/__init__.py +29 -0
- pycsw/ogc/api/__init__.py +28 -0
- pycsw/ogc/api/oapi.py +558 -0
- pycsw/ogc/api/records.py +1414 -0
- pycsw/ogc/api/templates/_base.html +76 -0
- pycsw/ogc/api/templates/collection.html +44 -0
- pycsw/ogc/api/templates/collections.html +45 -0
- pycsw/ogc/api/templates/conformance.html +21 -0
- pycsw/ogc/api/templates/exception.html +8 -0
- pycsw/ogc/api/templates/item.html +228 -0
- pycsw/ogc/api/templates/items.html +337 -0
- pycsw/ogc/api/templates/landing_page.html +27 -0
- pycsw/ogc/api/templates/openapi.html +58 -0
- pycsw/ogc/api/templates/queryables.html +50 -0
- pycsw/ogc/api/templates/stac_items.html +173 -0
- pycsw/ogc/api/templates/static/favicon.ico +0 -0
- pycsw/ogc/api/templates/static/logo-horizontal.png +0 -0
- pycsw/ogc/api/templates/static/logo-vertical-darkbg.png +0 -0
- pycsw/ogc/api/util.py +252 -0
- pycsw/ogc/csw/__init__.py +29 -0
- pycsw/ogc/csw/cql.py +133 -0
- pycsw/ogc/csw/csw2.py +2042 -0
- pycsw/ogc/csw/csw3.py +2193 -0
- pycsw/ogc/fes/__init__.py +29 -0
- pycsw/ogc/fes/fes1.py +433 -0
- pycsw/ogc/fes/fes2.py +451 -0
- pycsw/ogc/gml/__init__.py +29 -0
- pycsw/ogc/gml/gml3.py +240 -0
- pycsw/ogc/gml/gml32.py +243 -0
- pycsw/opensearch.py +857 -0
- pycsw/plugins/__init__.py +29 -0
- pycsw/plugins/outputschemas/__init__.py +31 -0
- pycsw/plugins/outputschemas/atom.py +143 -0
- pycsw/plugins/outputschemas/datacite.py +375 -0
- pycsw/plugins/outputschemas/dif.py +213 -0
- pycsw/plugins/outputschemas/fgdc.py +180 -0
- pycsw/plugins/outputschemas/gm03.py +240 -0
- pycsw/plugins/profiles/__init__.py +29 -0
- pycsw/plugins/profiles/apiso/__init__.py +29 -0
- pycsw/plugins/profiles/apiso/apiso.py +757 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd +13 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gco/basicTypes.xsd +429 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gco/gco.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gco/gcoBase.xsd +61 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/applicationSchema.xsd +42 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/citation.xsd +275 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/constraints.xsd +106 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/content.xsd +188 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/dataQuality.xsd +554 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/distribution.xsd +202 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/extent.xsd +205 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/freeText.xsd +122 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/gmd.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/identification.xsd +348 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/maintenance.xsd +86 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/metadataApplication.xsd +175 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/metadataEntity.xsd +70 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/metadataExtension.xsd +99 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/portrayalCatalogue.xsd +36 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/referenceSystem.xsd +100 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmd/spatialRepresentation.xsd +237 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/basicTypes.xsd +267 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/coordinateOperations.xsd +639 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/coordinateReferenceSystems.xsd +526 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/coordinateSystems.xsd +401 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/coverage.xsd +462 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/datums.xsd +342 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/dictionary.xsd +129 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/direction.xsd +80 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/dynamicFeature.xsd +142 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/feature.xsd +215 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/geometryAggregates.xsd +216 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/geometryBasic0d1d.xsd +304 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/geometryBasic2d.xsd +123 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/geometryComplexes.xsd +89 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/geometryPrimitives.xsd +892 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/gml.xsd +14 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/gmlBase.xsd +305 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/grids.xsd +58 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/measures.xsd +167 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/observation.xsd +90 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/referenceSystems.xsd +69 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/temporal.xsd +263 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/temporalReferenceSystems.xsd +183 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/temporalTopology.xsd +124 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/topology.xsd +372 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/units.xsd +156 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gml/valueObjects.xsd +212 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/catalogues.xsd +112 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/codelistItem.xsd +168 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/crsItem.xsd +1030 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/extendedTypes.xsd +75 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/gmx.xsd +2 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/gmxUsage.xsd +127 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gmx/uomItem.xsd +162 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gsr/gsr.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gsr/spatialReferencing.xsd +24 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gss/geometry.xsd +35 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gss/gss.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gts/gts.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/gts/temporalObjects.xsd +34 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/srv/serviceMetadata.xsd +197 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/srv/serviceModel.xsd +220 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20060504/srv/srv.xsd +13 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gco/basicTypes.xsd +431 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gco/gco.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gco/gcoBase.xsd +63 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/applicationSchema.xsd +43 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/citation.xsd +276 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/constraints.xsd +107 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/content.xsd +190 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/dataQuality.xsd +556 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/distribution.xsd +203 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/extent.xsd +206 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/freeText.xsd +123 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/gmd.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/identification.xsd +349 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/maintenance.xsd +87 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/metadataApplication.xsd +176 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/metadataEntity.xsd +71 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/metadataExtension.xsd +100 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/portrayalCatalogue.xsd +37 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/referenceSystem.xsd +101 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmd/spatialRepresentation.xsd +238 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/catalogues.xsd +113 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/codelistItem.xsd +169 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/crsItem.xsd +1031 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/extendedTypes.xsd +76 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/gmx.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/gmxUsage.xsd +128 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gmx/uomItem.xsd +163 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gsr/gsr.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gsr/spatialReferencing.xsd +25 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gss/geometry.xsd +36 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gss/gss.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gts/gts.xsd +12 -0
- pycsw/plugins/profiles/apiso/schemas/ogc/iso/19139/20070417/gts/temporalObjects.xsd +35 -0
- pycsw/plugins/profiles/ebrim/__init__.py +29 -0
- pycsw/plugins/profiles/ebrim/ebrim.py +174 -0
- pycsw/plugins/profiles/ebrim/schemas/ogc/csw/2.0.2/profiles/ebrim/1.0/csw-ebrim-iri.xsd +146 -0
- pycsw/plugins/profiles/ebrim/schemas/ogc/csw/2.0.2/profiles/ebrim/1.0/csw-ebrim.xsd +104 -0
- pycsw/plugins/profiles/iso19115p3/__init__.py +29 -0
- pycsw/plugins/profiles/iso19115p3/iso19115p3.py +854 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cat/1.0/cat.xsd +13 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cat/1.0/catalogues.xsd +53 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cat/1.0/codelistItem.xsd +54 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cat/1.0/crsItem.xsd +181 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cat/1.0/uomItem.xsd +38 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cit/1.0/cit.xsd +7 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cit/1.0/citation.xsd +514 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cit/2.0/cit.xsd +10 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/cit/2.0/citation.xsd +523 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gco/1.0/baseTypes2014.xsd +530 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gco/1.0/gco.xsd +16 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gcx/1.0/extendedTypes.xsd +92 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gcx/1.0/extendedTypes_autoFromShapeChange.xsd +60 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gcx/1.0/gcx.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gex/1.0/extent.xsd +241 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gex/1.0/gex.xsd +9 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gmw/1.0/gmlWrapperTypes2014.xsd +159 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/gmw/1.0/gmw.xsd +14 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/lan/1.0/lan.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/lan/1.0/language.xsd +140 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mac/1.0/acquisitionInformationImagery.xsd +622 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mac/1.0/mac.xsd +11 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mac/2.0/acquisitionInformationImagery.xsd +590 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mac/2.0/event.xsd +108 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mac/2.0/mac.xsd +10 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mas/1.0/applicationSchema.xsd +61 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mas/1.0/mas.xsd +9 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mcc/1.0/AbstractCommonClasses.xsd +358 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mcc/1.0/commonClasses.xsd +220 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mcc/1.0/mcc.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mco/1.0/constraints.xsd +188 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mco/1.0/mco.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/md1/1.0/md1.xsd +9 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/md1/1.0/metadataWExtendedType.xsd +4 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/md2/1.0/md2.xsd +15 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/md2/1.0/metadataWithExtensions.xsd +4 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mda/1.0/mda.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mda/1.0/metadataApplication.xsd +200 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdb/1.0/mdb.xsd +14 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdb/1.0/metadataBase.xsd +98 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdb/2.0/mdb.xsd +20 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdb/2.0/metadataBase.xsd +102 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mds/1.0/mds.xsd +22 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mds/1.0/metadataDataServices.xsd +4 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdt/1.0/mdt.xsd +13 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mdt/1.0/metadataTransfer.xsd +111 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mex/1.0/metadataExtension.xsd +156 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mex/1.0/mex.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mmi/1.0/maintenance.xsd +76 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mmi/1.0/mmi.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mpc/1.0/mpc.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mpc/1.0/portrayalCatalogue.xsd +31 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/1.0/content.xsd +416 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/1.0/contentInformationImagery.xsd +185 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/1.0/mrc.xsd +11 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/2.0/content.xsd +419 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/2.0/contentInformationImagery.xsd +171 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrc/2.0/mrc.xsd +11 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrd/1.0/distribution.xsd +267 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrd/1.0/mrd.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mri/1.0/identification.xsd +517 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mri/1.0/mri.xsd +9 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/1.0/lineage.xsd +147 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/1.0/lineageImagery.xsd +236 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/1.0/mrl.xsd +9 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/2.0/lineage.xsd +147 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/2.0/lineageImagery.xsd +312 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrl/2.0/mrl.xsd +11 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrs/1.0/mrs.xsd +8 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/mrs/1.0/referenceSystem.xsd +47 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/1.0/msr.xsd +10 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/1.0/spatialRepresentation.xsd +375 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/1.0/spatialRepresentationImagery.xsd +119 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/2.0/msr.xsd +15 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/2.0/spatialRepresentation.xsd +381 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/msr/2.0/spatialRepresentationImagery.xsd +120 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/srv/2.0/serviceInformation.xsd +272 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/srv/2.0/srv.xsd +6 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/srv/2.1/serviceInformation.xsd +278 -0
- pycsw/plugins/profiles/iso19115p3/schemas/ogc/iso/iso19115-3/srv/2.1/srv.xsd +6 -0
- pycsw/plugins/profiles/profile.py +141 -0
- pycsw/plugins/repository/__init__.py +29 -0
- pycsw/plugins/repository/odc/__init__.py +29 -0
- pycsw/plugins/repository/odc/odc.py +153 -0
- pycsw/server.py +938 -0
- pycsw/sru.py +217 -0
- pycsw/stac/__init__.py +29 -0
- pycsw/stac/api.py +571 -0
- pycsw/wsgi.py +233 -0
- pycsw/wsgi_flask.py +345 -0
pycsw/ogc/gml/gml3.py
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# =================================================================
|
|
3
|
+
#
|
|
4
|
+
# Authors: Tom Kralidis <tomkralidis@gmail.com>
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2024 Tom Kralidis
|
|
7
|
+
#
|
|
8
|
+
# Permission is hereby granted, free of charge, to any person
|
|
9
|
+
# obtaining a copy of this software and associated documentation
|
|
10
|
+
# files (the "Software"), to deal in the Software without
|
|
11
|
+
# restriction, including without limitation the rights to use,
|
|
12
|
+
# copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
# copies of the Software, and to permit persons to whom the
|
|
14
|
+
# Software is furnished to do so, subject to the following
|
|
15
|
+
# conditions:
|
|
16
|
+
#
|
|
17
|
+
# The above copyright notice and this permission notice shall be
|
|
18
|
+
# included in all copies or substantial portions of the Software.
|
|
19
|
+
#
|
|
20
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
21
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
22
|
+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
23
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
24
|
+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
25
|
+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
26
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
27
|
+
# OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
+
#
|
|
29
|
+
# =================================================================
|
|
30
|
+
|
|
31
|
+
import logging
|
|
32
|
+
from owslib import crs
|
|
33
|
+
|
|
34
|
+
from pycsw.core import util
|
|
35
|
+
from pycsw.core.etree import etree
|
|
36
|
+
|
|
37
|
+
LOGGER = logging.getLogger(__name__)
|
|
38
|
+
|
|
39
|
+
TYPES = ['gml:Point', 'gml:LineString', 'gml:Polygon', 'gml:Envelope']
|
|
40
|
+
|
|
41
|
+
DEFAULT_SRS = crs.Crs('urn:x-ogc:def:crs:EPSG:6.11:4326')
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _poslist2wkt(poslist, axisorder, geomtype):
|
|
45
|
+
"""Repurpose gml:posList into WKT aware list"""
|
|
46
|
+
|
|
47
|
+
tmp = poslist.split()
|
|
48
|
+
poslist2 = []
|
|
49
|
+
|
|
50
|
+
if geomtype == 'polygon':
|
|
51
|
+
len_ = 8
|
|
52
|
+
elif geomtype == 'line':
|
|
53
|
+
len_ = 4
|
|
54
|
+
|
|
55
|
+
if len(tmp) < len_:
|
|
56
|
+
msg = 'Invalid number of coordinates in geometry'
|
|
57
|
+
LOGGER.error(msg)
|
|
58
|
+
raise RuntimeError(msg)
|
|
59
|
+
|
|
60
|
+
xlist = tmp[::2]
|
|
61
|
+
ylist = tmp[1::2]
|
|
62
|
+
|
|
63
|
+
if axisorder == 'yx':
|
|
64
|
+
for i, j in zip(ylist, xlist):
|
|
65
|
+
poslist2.append('%s %s' % (i, j))
|
|
66
|
+
else:
|
|
67
|
+
for i, j in zip(xlist, ylist):
|
|
68
|
+
poslist2.append('%s %s' % (i, j))
|
|
69
|
+
|
|
70
|
+
return ', '.join(poslist2)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class Geometry(object):
|
|
74
|
+
"""base geometry class"""
|
|
75
|
+
|
|
76
|
+
def __init__(self, element, nsmap):
|
|
77
|
+
"""initialize geometry parser"""
|
|
78
|
+
|
|
79
|
+
self.nsmap = nsmap
|
|
80
|
+
self.type = None
|
|
81
|
+
self.wkt = None
|
|
82
|
+
self.crs = None
|
|
83
|
+
self._exml = element
|
|
84
|
+
|
|
85
|
+
# return OGC WKT for GML geometry
|
|
86
|
+
|
|
87
|
+
operand = element.xpath(
|
|
88
|
+
'|'.join(TYPES),
|
|
89
|
+
namespaces={'gml': 'http://www.opengis.net/gml'})[0]
|
|
90
|
+
|
|
91
|
+
if 'srsName' in operand.attrib:
|
|
92
|
+
LOGGER.debug('geometry srsName detected')
|
|
93
|
+
self.crs = crs.Crs(operand.attrib['srsName'])
|
|
94
|
+
else:
|
|
95
|
+
LOGGER.debug('setting default geometry srsName %s', DEFAULT_SRS)
|
|
96
|
+
self.crs = DEFAULT_SRS
|
|
97
|
+
|
|
98
|
+
self.type = etree.QName(operand).localname
|
|
99
|
+
|
|
100
|
+
if self.type == 'Point':
|
|
101
|
+
self._get_point()
|
|
102
|
+
elif self.type == 'LineString':
|
|
103
|
+
self._get_linestring()
|
|
104
|
+
elif self.type == 'Polygon':
|
|
105
|
+
self._get_polygon()
|
|
106
|
+
elif self.type == 'Envelope':
|
|
107
|
+
self._get_envelope()
|
|
108
|
+
else:
|
|
109
|
+
raise RuntimeError('Unsupported geometry type (Must be one of %s)'
|
|
110
|
+
% ','.join(TYPES))
|
|
111
|
+
|
|
112
|
+
# reproject data if needed
|
|
113
|
+
if self.crs is not None and self.crs.code not in [4326, 'CRS84']:
|
|
114
|
+
LOGGER.info('transforming geometry to 4326')
|
|
115
|
+
try:
|
|
116
|
+
self.wkt = self.transform(self.crs.code, DEFAULT_SRS.code)
|
|
117
|
+
except Exception as err:
|
|
118
|
+
LOGGER.exception('Coordinate transformation error')
|
|
119
|
+
raise RuntimeError('Reprojection error: Invalid srsName')
|
|
120
|
+
|
|
121
|
+
def _get_point(self):
|
|
122
|
+
"""Parse gml:Point"""
|
|
123
|
+
|
|
124
|
+
tmp = self._exml.find(util.nspath_eval('gml:Point/gml:pos',
|
|
125
|
+
self.nsmap))
|
|
126
|
+
|
|
127
|
+
if tmp is None:
|
|
128
|
+
raise RuntimeError('Invalid gml:Point geometry. Missing gml:pos')
|
|
129
|
+
else:
|
|
130
|
+
xypoint = tmp.text.split()
|
|
131
|
+
if self.crs.axisorder == 'yx':
|
|
132
|
+
self.wkt = 'POINT(%s %s)' % (xypoint[1], xypoint[0])
|
|
133
|
+
else:
|
|
134
|
+
self.wkt = 'POINT(%s %s)' % (xypoint[0], xypoint[1])
|
|
135
|
+
|
|
136
|
+
def _get_linestring(self):
|
|
137
|
+
"""Parse gml:LineString"""
|
|
138
|
+
|
|
139
|
+
tmp = self._exml.find(util.nspath_eval('gml:LineString/gml:posList',
|
|
140
|
+
self.nsmap))
|
|
141
|
+
|
|
142
|
+
if tmp is None:
|
|
143
|
+
raise RuntimeError('Invalid gml:LineString geometry.\
|
|
144
|
+
Missing gml:posList')
|
|
145
|
+
else:
|
|
146
|
+
self.wkt = 'LINESTRING(%s)' % _poslist2wkt(tmp.text,
|
|
147
|
+
self.crs.axisorder,
|
|
148
|
+
'line')
|
|
149
|
+
|
|
150
|
+
def _get_polygon(self):
|
|
151
|
+
"""Parse gml:Polygon"""
|
|
152
|
+
|
|
153
|
+
tmp = self._exml.find('.//%s' % util.nspath_eval('gml:posList',
|
|
154
|
+
self.nsmap))
|
|
155
|
+
|
|
156
|
+
if tmp is None:
|
|
157
|
+
raise RuntimeError('Invalid gml:LineString geometry.\
|
|
158
|
+
Missing gml:posList')
|
|
159
|
+
else:
|
|
160
|
+
self.wkt = 'POLYGON((%s))' % _poslist2wkt(tmp.text,
|
|
161
|
+
self.crs.axisorder,
|
|
162
|
+
'polygon')
|
|
163
|
+
|
|
164
|
+
def _get_envelope(self):
|
|
165
|
+
"""Parse gml:Envelope"""
|
|
166
|
+
|
|
167
|
+
tmp = self._exml.find(util.nspath_eval('gml:Envelope/gml:lowerCorner',
|
|
168
|
+
self.nsmap))
|
|
169
|
+
if tmp is None:
|
|
170
|
+
raise RuntimeError('Invalid gml:Envelope geometry.\
|
|
171
|
+
Missing gml:lowerCorner')
|
|
172
|
+
else:
|
|
173
|
+
lower_left = tmp.text
|
|
174
|
+
|
|
175
|
+
tmp = self._exml.find(util.nspath_eval('gml:Envelope/gml:upperCorner',
|
|
176
|
+
self.nsmap))
|
|
177
|
+
if tmp is None:
|
|
178
|
+
raise RuntimeError('Invalid gml:Envelope geometry.\
|
|
179
|
+
Missing gml:upperCorner')
|
|
180
|
+
else:
|
|
181
|
+
upper_right = tmp.text
|
|
182
|
+
|
|
183
|
+
llmin = lower_left.split()
|
|
184
|
+
urmax = upper_right.split()
|
|
185
|
+
|
|
186
|
+
if len(llmin) < 2 or len(urmax) < 2:
|
|
187
|
+
raise RuntimeError('Invalid gml:Envelope geometry. \
|
|
188
|
+
gml:lowerCorner and gml:upperCorner must hold at least x and y')
|
|
189
|
+
|
|
190
|
+
if self.crs.axisorder == 'yx':
|
|
191
|
+
self.wkt = util.bbox2wktpolygon('%s,%s,%s,%s' % (llmin[1],
|
|
192
|
+
llmin[0], urmax[1], urmax[0]))
|
|
193
|
+
else:
|
|
194
|
+
self.wkt = util.bbox2wktpolygon('%s,%s,%s,%s' % (llmin[0],
|
|
195
|
+
llmin[1], urmax[0], urmax[1]))
|
|
196
|
+
|
|
197
|
+
def transform(self, src, dest):
|
|
198
|
+
"""transform coordinates from one CRS to another"""
|
|
199
|
+
|
|
200
|
+
from pyproj import Transformer
|
|
201
|
+
from shapely.geometry import Point, LineString, Polygon
|
|
202
|
+
from shapely.wkt import loads
|
|
203
|
+
|
|
204
|
+
LOGGER.info('Transforming geometry from %s to %s', src, dest)
|
|
205
|
+
|
|
206
|
+
vertices = []
|
|
207
|
+
|
|
208
|
+
try:
|
|
209
|
+
proj_src = 'epsg:%s' % src
|
|
210
|
+
proj_dst = 'epsg:%s' % dest
|
|
211
|
+
transformer = Transformer.from_crs(proj_src, proj_dst, always_xy=True)
|
|
212
|
+
except Exception as err:
|
|
213
|
+
msg = f'Invalid projection transformation: {err}'
|
|
214
|
+
raise RuntimeError(msg)
|
|
215
|
+
|
|
216
|
+
geom = loads(self.wkt)
|
|
217
|
+
|
|
218
|
+
if geom.geom_type == 'Point':
|
|
219
|
+
newgeom = Point(transformer.transform(geom.x, geom.y))
|
|
220
|
+
wkt2 = newgeom.wkt
|
|
221
|
+
|
|
222
|
+
elif geom.geom_type == 'LineString':
|
|
223
|
+
for vertice in list(geom.coords):
|
|
224
|
+
newgeom = transformer.transform(vertice[0], vertice[1])
|
|
225
|
+
vertices.append(newgeom)
|
|
226
|
+
|
|
227
|
+
linestring = LineString(vertices)
|
|
228
|
+
|
|
229
|
+
wkt2 = linestring.wkt
|
|
230
|
+
|
|
231
|
+
elif geom.geom_type == 'Polygon':
|
|
232
|
+
for vertice in list(geom.exterior.coords):
|
|
233
|
+
newgeom = transformer.transform(vertice[0], vertice[1])
|
|
234
|
+
vertices.append(newgeom)
|
|
235
|
+
|
|
236
|
+
polygon = Polygon(vertices)
|
|
237
|
+
|
|
238
|
+
wkt2 = polygon.wkt
|
|
239
|
+
|
|
240
|
+
return wkt2
|
pycsw/ogc/gml/gml32.py
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# =================================================================
|
|
3
|
+
#
|
|
4
|
+
# Authors: Tom Kralidis <tomkralidis@gmail.com>
|
|
5
|
+
#
|
|
6
|
+
# Copyright (c) 2024 Tom Kralidis
|
|
7
|
+
#
|
|
8
|
+
# Permission is hereby granted, free of charge, to any person
|
|
9
|
+
# obtaining a copy of this software and associated documentation
|
|
10
|
+
# files (the "Software"), to deal in the Software without
|
|
11
|
+
# restriction, including without limitation the rights to use,
|
|
12
|
+
# copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
# copies of the Software, and to permit persons to whom the
|
|
14
|
+
# Software is furnished to do so, subject to the following
|
|
15
|
+
# conditions:
|
|
16
|
+
#
|
|
17
|
+
# The above copyright notice and this permission notice shall be
|
|
18
|
+
# included in all copies or substantial portions of the Software.
|
|
19
|
+
#
|
|
20
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
21
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
22
|
+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
23
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
24
|
+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
25
|
+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
26
|
+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
27
|
+
# OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
+
#
|
|
29
|
+
# =================================================================
|
|
30
|
+
|
|
31
|
+
import logging
|
|
32
|
+
from owslib import crs
|
|
33
|
+
|
|
34
|
+
from pycsw.core import util
|
|
35
|
+
from pycsw.core.etree import etree
|
|
36
|
+
|
|
37
|
+
LOGGER = logging.getLogger(__name__)
|
|
38
|
+
|
|
39
|
+
TYPES = ['gml32:Point', 'gml32:LineString', 'gml32:Polygon', 'gml32:Envelope']
|
|
40
|
+
|
|
41
|
+
DEFAULT_SRS = crs.Crs('urn:x-ogc:def:crs:EPSG:6.11:4326')
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _poslist2wkt(poslist, axisorder, geomtype):
|
|
45
|
+
"""Repurpose gml32:posList into WKT aware list"""
|
|
46
|
+
|
|
47
|
+
tmp = poslist.split()
|
|
48
|
+
poslist2 = []
|
|
49
|
+
|
|
50
|
+
if geomtype == 'polygon':
|
|
51
|
+
len_ = 8
|
|
52
|
+
elif geomtype == 'line':
|
|
53
|
+
len_ = 4
|
|
54
|
+
|
|
55
|
+
if len(tmp) < len_:
|
|
56
|
+
msg = 'Invalid number of coordinates in geometry'
|
|
57
|
+
LOGGER.error(msg)
|
|
58
|
+
raise RuntimeError(msg)
|
|
59
|
+
|
|
60
|
+
xlist = tmp[::2]
|
|
61
|
+
ylist = tmp[1::2]
|
|
62
|
+
|
|
63
|
+
if axisorder == 'yx':
|
|
64
|
+
for i, j in zip(ylist, xlist):
|
|
65
|
+
poslist2.append('%s %s' % (i, j))
|
|
66
|
+
else:
|
|
67
|
+
for i, j in zip(xlist, ylist):
|
|
68
|
+
poslist2.append('%s %s' % (i, j))
|
|
69
|
+
|
|
70
|
+
return ', '.join(poslist2)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class Geometry(object):
|
|
74
|
+
"""base geometry class"""
|
|
75
|
+
|
|
76
|
+
def __init__(self, element, nsmap):
|
|
77
|
+
"""initialize geometry parser"""
|
|
78
|
+
|
|
79
|
+
self.nsmap = nsmap
|
|
80
|
+
self.type = None
|
|
81
|
+
self.wkt = None
|
|
82
|
+
self.crs = None
|
|
83
|
+
self._exml = element
|
|
84
|
+
|
|
85
|
+
# return OGC WKT for GML geometry
|
|
86
|
+
|
|
87
|
+
# self.nsmap['gml'] = 'http://www.opengis.net/gml/3.2'
|
|
88
|
+
|
|
89
|
+
operand = element.xpath(
|
|
90
|
+
'|'.join(TYPES),
|
|
91
|
+
namespaces={'gml32': 'http://www.opengis.net/gml/3.2'})[0]
|
|
92
|
+
|
|
93
|
+
if 'srsName' in operand.attrib:
|
|
94
|
+
LOGGER.debug('geometry srsName detected')
|
|
95
|
+
self.crs = crs.Crs(operand.attrib['srsName'])
|
|
96
|
+
else:
|
|
97
|
+
LOGGER.debug('setting default geometry srsName %s', DEFAULT_SRS)
|
|
98
|
+
self.crs = DEFAULT_SRS
|
|
99
|
+
|
|
100
|
+
self.type = etree.QName(operand).localname
|
|
101
|
+
|
|
102
|
+
if self.type == 'Point':
|
|
103
|
+
self._get_point()
|
|
104
|
+
elif self.type == 'LineString':
|
|
105
|
+
self._get_linestring()
|
|
106
|
+
elif self.type == 'Polygon':
|
|
107
|
+
self._get_polygon()
|
|
108
|
+
elif self.type == 'Envelope':
|
|
109
|
+
self._get_envelope()
|
|
110
|
+
else:
|
|
111
|
+
raise RuntimeError('Unsupported geometry type (Must be one of %s)'
|
|
112
|
+
% ','.join(TYPES))
|
|
113
|
+
|
|
114
|
+
# reproject data if needed
|
|
115
|
+
if self.crs is not None and self.crs.code not in [4326, 'CRS84']:
|
|
116
|
+
LOGGER.info('transforming geometry to 4326')
|
|
117
|
+
try:
|
|
118
|
+
self.wkt = self.transform(self.crs.code, DEFAULT_SRS.code)
|
|
119
|
+
except Exception as err:
|
|
120
|
+
LOGGER.exception('Coordinate transformation error')
|
|
121
|
+
raise RuntimeError('Reprojection error: Invalid srsName')
|
|
122
|
+
|
|
123
|
+
def _get_point(self):
|
|
124
|
+
"""Parse gml32:Point"""
|
|
125
|
+
|
|
126
|
+
tmp = self._exml.find(util.nspath_eval('gml32:Point/gml32:pos',
|
|
127
|
+
self.nsmap))
|
|
128
|
+
|
|
129
|
+
if tmp is None:
|
|
130
|
+
raise RuntimeError('Invalid gml32:Point geometry. Missing gml32:pos')
|
|
131
|
+
else:
|
|
132
|
+
xypoint = tmp.text.split()
|
|
133
|
+
if self.crs.axisorder == 'yx':
|
|
134
|
+
self.wkt = 'POINT(%s %s)' % (xypoint[1], xypoint[0])
|
|
135
|
+
else:
|
|
136
|
+
self.wkt = 'POINT(%s %s)' % (xypoint[0], xypoint[1])
|
|
137
|
+
|
|
138
|
+
def _get_linestring(self):
|
|
139
|
+
"""Parse gml32:LineString"""
|
|
140
|
+
|
|
141
|
+
tmp = self._exml.find(util.nspath_eval('gml32:LineString/gml32:posList',
|
|
142
|
+
self.nsmap))
|
|
143
|
+
|
|
144
|
+
if tmp is None:
|
|
145
|
+
raise RuntimeError('Invalid gml32:LineString geometry.\
|
|
146
|
+
Missing gml32:posList')
|
|
147
|
+
else:
|
|
148
|
+
self.wkt = 'LINESTRING(%s)' % _poslist2wkt(tmp.text,
|
|
149
|
+
self.crs.axisorder,
|
|
150
|
+
'line')
|
|
151
|
+
|
|
152
|
+
def _get_polygon(self):
|
|
153
|
+
"""Parse gml32:Polygon"""
|
|
154
|
+
|
|
155
|
+
tmp = self._exml.find('.//%s' % util.nspath_eval('gml32:posList',
|
|
156
|
+
self.nsmap))
|
|
157
|
+
|
|
158
|
+
if tmp is None:
|
|
159
|
+
raise RuntimeError('Invalid gml32:LineString geometry.\
|
|
160
|
+
Missing gml32:posList')
|
|
161
|
+
else:
|
|
162
|
+
self.wkt = 'POLYGON((%s))' % _poslist2wkt(tmp.text,
|
|
163
|
+
self.crs.axisorder,
|
|
164
|
+
'polygon')
|
|
165
|
+
|
|
166
|
+
def _get_envelope(self):
|
|
167
|
+
"""Parse gml32:Envelope"""
|
|
168
|
+
|
|
169
|
+
tmp = self._exml.find(util.nspath_eval('gml32:Envelope/gml32:lowerCorner',
|
|
170
|
+
self.nsmap))
|
|
171
|
+
|
|
172
|
+
if tmp is None:
|
|
173
|
+
raise RuntimeError('Invalid gml32:Envelope geometry.\
|
|
174
|
+
Missing gml32:lowerCorner')
|
|
175
|
+
else:
|
|
176
|
+
lower_left = tmp.text
|
|
177
|
+
|
|
178
|
+
tmp = self._exml.find(util.nspath_eval('gml32:Envelope/gml32:upperCorner',
|
|
179
|
+
self.nsmap))
|
|
180
|
+
if tmp is None:
|
|
181
|
+
raise RuntimeError('Invalid gml32:Envelope geometry.\
|
|
182
|
+
Missing gml32:upperCorner')
|
|
183
|
+
else:
|
|
184
|
+
upper_right = tmp.text
|
|
185
|
+
|
|
186
|
+
llmin = lower_left.split()
|
|
187
|
+
urmax = upper_right.split()
|
|
188
|
+
|
|
189
|
+
if len(llmin) < 2 or len(urmax) < 2:
|
|
190
|
+
raise RuntimeError('Invalid gml32:Envelope geometry. \
|
|
191
|
+
gml32:lowerCorner and gml32:upperCorner must hold at least x and y')
|
|
192
|
+
|
|
193
|
+
if self.crs.axisorder == 'yx':
|
|
194
|
+
self.wkt = util.bbox2wktpolygon('%s,%s,%s,%s' % (llmin[1],
|
|
195
|
+
llmin[0], urmax[1], urmax[0]))
|
|
196
|
+
else:
|
|
197
|
+
self.wkt = util.bbox2wktpolygon('%s,%s,%s,%s' % (llmin[0],
|
|
198
|
+
llmin[1], urmax[0], urmax[1]))
|
|
199
|
+
|
|
200
|
+
def transform(self, src, dest):
|
|
201
|
+
"""transform coordinates from one CRS to another"""
|
|
202
|
+
|
|
203
|
+
from pyproj import Transformer
|
|
204
|
+
from shapely.geometry import Point, LineString, Polygon
|
|
205
|
+
from shapely.wkt import loads
|
|
206
|
+
|
|
207
|
+
LOGGER.info('Transforming geometry from %s to %s', src, dest)
|
|
208
|
+
|
|
209
|
+
vertices = []
|
|
210
|
+
|
|
211
|
+
try:
|
|
212
|
+
proj_src = 'epsg:%s' % src
|
|
213
|
+
proj_dst = 'epsg:%s' % dest
|
|
214
|
+
transformer = Transformer.from_crs(proj_src, proj_dst, always_xy=True)
|
|
215
|
+
except Exception as err:
|
|
216
|
+
msg = f'Invalid projection transformation: {err}'
|
|
217
|
+
raise RuntimeError(msg)
|
|
218
|
+
|
|
219
|
+
geom = loads(self.wkt)
|
|
220
|
+
|
|
221
|
+
if geom.type == 'Point':
|
|
222
|
+
newgeom = Point(transformer.transform(geom.x, geom.y))
|
|
223
|
+
wkt2 = newgeom.wkt
|
|
224
|
+
|
|
225
|
+
elif geom.type == 'LineString':
|
|
226
|
+
for vertice in list(geom.coords):
|
|
227
|
+
newgeom = transformer.transform(vertice[0], vertice[1])
|
|
228
|
+
vertices.append(newgeom)
|
|
229
|
+
|
|
230
|
+
linestring = LineString(vertices)
|
|
231
|
+
|
|
232
|
+
wkt2 = linestring.wkt
|
|
233
|
+
|
|
234
|
+
elif geom.type == 'Polygon':
|
|
235
|
+
for vertice in list(geom.exterior.coords):
|
|
236
|
+
newgeom = transformer.transform(vertice[0], vertice[1])
|
|
237
|
+
vertices.append(newgeom)
|
|
238
|
+
|
|
239
|
+
polygon = Polygon(vertices)
|
|
240
|
+
|
|
241
|
+
wkt2 = polygon.wkt
|
|
242
|
+
|
|
243
|
+
return wkt2
|