[postgis-users] Patch for casting geometry to geography

Paragon Corporation lr at pcorp.us
Thu Jan 20 15:07:23 PST 2011


Steve,

It would help if you posted this issue as a bug ticket and then attach the
patch to it.  
http://trac.osgeo.org/postgis/newticket

That way it will get on our list on items.



Since it doesn't require an external function addition, I think it can be
slated for PostGIS 1.5.3

Thanks,
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
Marshall, Steve
Sent: Thursday, January 20, 2011 3:29 PM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] Patch for casting geometry to geography

Related to an earlier post by Radu Ilie, I have a patch for casting from
geometry to geography that solves his problem.  In particular, it will
transform coordinates into the desired range for geography objects (-90 to
90 lat, -180 to 180 lon).  The previous version detected this problem, but
simply issued an error if it occurred.

The attached files add one new external function to the the postgis library
(lwgeom_force_geodetic) and uses it in the function that casts geometry
objects to geography objects (Datum geography_in).  The logic is a very
simple clone of the lwgeom_check_geodetic function, except it fixes any
descrepancies it finds.

I hope this could be included in a future PostGIS release.  If necessary, I
can post this to a different list.

Steve Marshall





More information about the postgis-users mailing list