Vanity package for geopython projects
pip install geopython
>>> import geopython
pycsw is an OGC CSW server implementation written in Python. pycsw fully implements the OpenGIS Catalogue Service Implementation Specification [Catalogue Service for the Web]. Initial development started in 2010 (more formally announced in 2011). The project is certified OGC Compliant, and is an OGC Reference Implementation. pycsw allows for the publishing and discovery of geospatial metadata via numerous APIs (CSW 2/CSW 3, OpenSearch, OAI-PMH, SRU). Existing repositories of geospatial metadata can also be exposed, providing a standards-based metadata and catalogue component of spatial data infrastructures. pycsw is Open Source, released under an MIT license, and runs on all major platforms (Windows, Linux, Mac OS X). Please read the docs at https://pycsw.org/docs for more information.
Home Page: https://pycsw.org
License: MIT License
Vanity package for geopython projects
pip install geopython
>>> import geopython
Extending #6, add MySQL specific support.
Per OWS Common 1.0.0 subclause 7.3.4.
For Windows installs, when server.profiles is set, running any CSW request results in the following:
{{{
Traceback (most recent call last):
File "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/pycsw/csw.py", line 37, in <module>
CSW = server.Csw('./default.cfg')
File "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pycsw\server\server.py", line 110, in init
self.config.get('server', 'profiles'))
File "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pycsw\server\profile.py", line 137, in load_profiles
look_for_subclass(modulename)
File "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pycsw\server\profile.py", line 110, in look_for_subclass
module = import(modulename)
ImportError: Import by filename is not supported.
}}}
The following patch solves the issue:
{{{
--- profile.py (revision 310)
+++ profile.py (working copy)
@@ -103,10 +103,12 @@
def look_for_subclass(modulename):
module = imp.load_source(modulename, path)
Will apply to trunk once tested on Linux.
Move {{{server/profiles}}} to {{{server/plugins/profiles}}} so the plugin architecture can be abstracted to take on more than just CSW profiles.
Since this could also apply to JSON output (per #33), apply this to any output.
{{{typenames}}} is a required parameter in !GetRecords. The codebase checks for this post mode by way of validating the XML request, but the same check is missing in GET mode.
For releases, a stable version owslib should be used. This will prevent older releases from pulling owslib svn trunk, which may cause errors.
To allow for specifying alternate configurations via environment variable (i.e. Apache !SetEnvIf)
!GetRecords resulttype=hits should return an empty result set, with an empty {{{csw:SearchResults}}} element/attributes.
Ideally, this would be a subclass of ISO AP (see #2).
Process axis order accordingly, when:
This will include intelligence for CRS handling and axis order.
Enhance codebase to operate via Jython
Currently, we allow for the user to map column names to queryables in config.
While we originally implemented this with maximum flexibility in mind, given our tie to SQLite3 (registered functions, etc.), we are (at this point) bound to the underlying data model. As well, the chances of a user having a custom defined SQLite3 database of metadata are not common.
Most CSW implementations provide a core data repository to which users import their metadata into, as opposed to allowing further flexibility.
Pulling these configuration options into the code will make configuration much easier for the end user.
Rename geometry column to wkt_geometry to be more OGR friendly.
Add the ability to dump a repository to a directory of XML documents.
update config parsing scripts in {{{sbin/}}} ({{{config.get_config}}} is now obsolete).
The recent update to use !ConfigParser directly results in a 500 error for INSPIRE-enabled requests.
Create an installer for OSGeoLive and Ubuntu distributions
!DescribeRecord, !GetRecords, and !GetRecordById allow for specifying an {{{outputFormat}}} parameter. This should be a valid MIME type.
This is independent of the model of the metadata ({{{outputSchema}}}).
We currently support {{{application/xml}}} as the default {{{outputFormat}}}.
Steps to implement JSON as an {{{outputFormat}}}:
Currently, the !GetDomain operation outputs !csw:ListOfValues.
Add the ability to allow for a range of values (min/max) if specified. Default behaviour shall be list for backward compatibility.
the current approach of querying via !GetRecords results in performance improvements when metadata repositories have > 8000 records. Factors:
After many rounds of testing, it was found that deconstructing the data model (parse out XML and store in db columns) to eliminate the (expensive) xpath queries against the db in realtime and implementing paging makes performance results more than acceptable.
Support online resources in data model, allowing for multiplicity, where link has the following properties: url, protocol, name, description.
!GetRecords and Harvest allow a {{{csw:ResponseHandler}}} to be specified (subclause 10.8.4.14) for asynchronous processing.
Enhance current support to cover both operations (asynchronously) as well as additional protocols.
Add the ability for pycsw to operate against repositories using the Django ORM.
This will require abstraction so to as support both django and sqlalchemy (which is default).
Currently, the codebase is a simple download and configure approach. Add support for installation via setup.py. This will add support for properly referencing dependencies, and generating various templates/etc., at install time.
Refactor scripts in {{{sbin}}} into a central admin utility.
{{{geometry.exterior.bounds}}} fails for the test case of a POLYGON with 0 area (i.e. {{{POLYGON ((10 10, 10 10, 10 10, 10 10, 10 10))}}}). !GetRecords handling fails when trying to write out geometry constructs of records.
When {{{elementsetname=full}}}, the codebase always returns the contents of the {{{xml}}} column verbatim. When the metadata is in a given format, and requested in a different {{{outputSchema}}}, the native format is returned.
Fix each supported {{{outputSchema}}}, ensure that {{{full}}} metadata is as per the {{{outputSchema}}} requested.
per http://gcmd.nasa.gov/User/difguide/difman.html. Even though there is no official profile (it's a format), we will implement as such to be able to have queryables and returnables.
!GetRecords requests with spatial filters allow for a given geometry to be passed with {{{@srsName}}}, a projection identifier.
The pycsw native geometry model (WKT) is always 4326, with an xy axis order.
Support the ability to convert from a non 4326 geometry for accurate spatial filtering. Taking advantage of changes implemented as per #35.
Update !ExceptionReport/@Version to fixed string of '1.2.0' per spec.
Currently bound to SQLite3, extend to support other DB's (SQLAlchemy gives us this abstraction, but the Python SQLite3 bindings are tied to custom functions).
Add support for language-specific messaging (for ows:ExceptionReport
and debugging messages) using gettext.
Add the ability for OGC filters to accept ogc:Function's. This includes:
FYI non-aggregate queries only (aggregate functions are not supporting by OGC Filter).
Sphinx 1.1.2 now supports internationalization. Upgrade documentation to take on this approach.
When [metadata:main] options are not set/commented out, pycsw returns 500.
Implement an approach to safeguard these outputs by setting default values.
Currently, this is accomplished by the client passing an HTTP header ({{{PYCSW_CONFIG}}}), and is used for the tester.
Passing the configuration as part of the base URL will allow for pycsw to advertise multiple configurations without the client having prior knowledge of {{{PYCSW_CONFIG}}} values/configurations.
This will also make the tester framework more straightforward.
Adding functionality for [http://en.wikipedia.org/wiki/Web_Server_Gateway_Interface WSGI] will improve performance, as well as integration with other applications.
As per http://portal.opengeospatial.org/files/?artifact_id=20555, 07-006r1, subclause 8.4
Currently the codebase binds to the underlying database by way of configuration in {{{server/config.py}}}, and each of the profile queryable models, by way of mapping queryables (i.e. {{{apiso:Title}}}) to database column names. There is then a reverse mapping to {{{csw:Record}}}, of only queryable names, so as to transform to/from metadata formats.
This presents an issue when trying to setup pycsw against an existing, different metadata model. In this case, the user must override the mappings in each model to the underlying db columns.
Implementing a core abstract model, where all other models map to, would alleviate this issue such that users can override the mappings only in the core abstract model, either in the codebase, or by allowing a mapping file specified in, say {{{repository.model=path/to/model.py}}}, or configuration file {{{repository.model=path/to/model.cfg}}}, or inline in the main configuration.
per subject. Implementation notes:
pycsw currently [wiki:OGCCITECompliance utilizes] the OGC CITE tests as a means of testing functionality.
There are features and use cases which OGC CITE does not test, but are valuable to pycsw testing (more exhaustive HTTP GET requests, error handling, etc.).
The proposed pycsw testsuite will be developed in the spirit of the [http://trac.osgeo.org/mapserver/browser/trunk/msautotest/wxs MapServer msautotest] tests. The test suite should allow for testing various configurations and profiles. Test data should be part of the testsuite, as well as various config files ({{{default.cfg}}}).
The test suite should be integrated with the {{{tester/}}} application, to maximize tests between the tester as well as local testing.
Currently, pycsw splits metadata XML (the core queryables) into the data model.
The attached patch (so I don't lose the work) enables the use of pycsw with a simpler repository. Notes:
Benefits
The patch passes OGC CITE 103/103. APISO has not been updated yet. This is a break from the previous approach and a significant change.
In !GetRecords requests, when an invalid !SortBy !PropertyName is specified, the CSW should return an !ExceptionReport. Currently returns a 500. The following request reproduces the error:
{{{
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:ogc="http://www.opengis.net/ogc" service="CSW" version="2.0.2" resultType="results" startPosition="1" maxRecords="5" outputFormat="application/xml" outputSchema="http://www.opengis.net/cat/csw/2.0.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd" xmlns:gml="http://www.opengis.net/gml">
<csw:Query typeNames="csw:Record">
csw:ElementSetNamebrief/csw:ElementSetName
<csw:Constraint version="1.1.0">
ogc:Filter
ogc:BBOX
ogc:PropertyNameows:BoundingBox/ogc:PropertyName
gml:Envelope
gml:lowerCorner47 -5/gml:lowerCorner
gml:upperCorner55 20/gml:upperCorner
/gml:Envelope
/ogc:BBOX
/ogc:Filter
/csw:Constraint
ogc:SortBy
ogc:SortProperty
ogc:PropertyNamedc:foo/ogc:PropertyName
ogc:SortOrderDESC/ogc:SortOrder
/ogc:SortProperty
/ogc:SortBy
/csw:Query
/csw:GetRecords
}}}
TODO for 0.1:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.