[postgis-users] Patch for casting geometry to geography

Paul Ramsey pramsey at opengeo.org
Fri Jan 21 09:03:26 PST 2011


Note, I originally intended to do a lot of this kind of quiet
helpfulness but -devel persuaded me not to, on the principle that it
was better to fail noisily ("can't deal with these coordinates!") than
to screw up silently (incorrectly "fixing" things that shouldn't be
fixed).
P

On Thu, Jan 20, 2011 at 3:07 PM, Paragon Corporation <lr at pcorp.us> wrote:
> 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
>
>
> _______________________________________________
> 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