[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] How do I parse postGIS types in my app code?
From:       "Paragon Corporation" <lr () pcorp ! us>
Date:       2011-02-27 16:49:51
Message-ID: 4FC7DCA54B2F40B795D27F34014AE19F () J
[Download RAW message or body]

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@postgis.refractions.net
[mailto:postgis-users-bounces@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@tplus1.com
http://tplus1.com
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic