[postgis-users] How do I parse postGIS types in my app code?
Paragon Corporation
lr at pcorp.us
Sun Feb 27 08:49:51 PST 2011
Matt,
If you are using Python, you might want to take a look at Shapely. Although
it was designed for doing PostGIS like operations without PostGIS, its built
on GEOS and I think has functions for importing wkb and hexwkb format.
ST_AsBinary(geog)
The output of geometry/geography are hexewkb, which shapely might understand
alone or you might have to do geog::geometry.
Perhaps someone on the list who actually has experience with shapely can
testify to its fit for your particular use case.
http://gispython.org/shapely/docs/1.2/manual.html#well-known-formats
Hope that helps,
Regina
http://www.postgis.us
-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of W.
Matthew Wilson
Sent: Sunday, February 27, 2011 10:48 AM
To: PostGIS Users Discussion
Subject: [postgis-users] How do I parse postGIS types in my app code?
I have a column with type geography('point').
When I load the contents of that column into python, I get something like
this:
'0101000020E6100000D0A39872F4E955C0D66EBBD05CF94440'
I know how to use the ST_X and ST_Y functions in order to extract latitude
and longitude (thanks to this list, BTW) but sometimes I would like to not
have to do that in SQL.
Any ideas?
Matt
--
W. Matthew Wilson
matt at tplus1.com
http://tplus1.com
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list