[owslib-users] parsing of coordinate systems in owslib

Tom Kralidis tomkralidis at hotmail.com
Fri Dec 9 13:49:04 PST 2011




> Date: Fri, 9 Dec 2011 22:39:49 +0100
> From: jachym.cepicky at gmail.com
> To: owslib-users at lists.sourceforge.net
> Subject: [owslib-users] parsing of coordinate systems in owslib
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi,
> 
> is there some generic coordinate reference system parser, which would
> parse the "authority:...:number" string (usually something like
> "EPSG:4326" and convert it into e.g. pyproj.Proj or
> osgeo.osr.SpatialReference (not sure, which one would be better).
> 
> To identify the epsg, as used in WCS or WMS is in general no problem,
> but WFS uses much more complicated syntax:
> 
> (WFS 1.1.0, page 36)
> 
> * EPSG:<EPSG code>
> * http://www.opengis.net/gml/srs/epsg.xml#<EPSG code>
> * urn:EPSG:geographicCRC:<epsg code>
> 
> So, is there some SCRS parser in OWSLib?
> 
> Thanks
> 
> Jachym

Hi Jachym: thanks for the info.  Timely enough, this has been added to trunk recently (see http://sourceforge.net/apps/trac/owslib/ticket/19).

So typical usage would be:

from owslib import crs

c=crs.Crs('EPSG:4326')

All three types of CRS definitions are handled, as well as axis order for CRS URNs.  owslib/crs.py just parses the definition, and leaves it up to the caller to init a given projection library.

You can see how this is implemented in pycsw (http://sourceforge.net/apps/trac/pycsw/browser/trunk/server/gml.py#L57 and http://sourceforge.net/apps/trac/pycsw/browser/trunk/server/gml.py#L162).

Let us know if this works for you.

..Tom

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/owslib-users/attachments/20111209/c94090c1/attachment.html>


More information about the Owslib-users mailing list