[postgis-users] Coordinates and SRID - bound overflow, ST_Equals

Ilie, Radu rilie at wsi.com
Thu Jan 20 05:32:59 PST 2011


Doug,

 

We do have the same problem. We are in a situation where a central
server has a column of type geometry (SRID 4326) and it has points with
latitude/longitude outside of (-180 -90,180 90). We need to retrieve the
values from this column and insert them into a local server where the
column is of type geography. It doesn't work, we get errors like this:

 

ERROR:  Coordinate values are out of range [-180 -90, 180 90] for
GEOGRAPHY type

 

Our solution for now is to modify the PostGIS code and normalize points
outside of (-180 -90,180 190) during the cast to geography.

 

The solution is cumbersome, because it requires us to build PostGIS from
source under Windows (the local server is Windows 7). And that is a
science project in itself.

 

For reasons outside our control we cannot change the type of the column
on the central server, nor can we move the local server to Linux. Is
there any way to use the existing functions in PostGIS to normalize
points outside the allowed range for geography? We need something that
can be used during an implicit cast.

 

Radu Ilie

 

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Doug_Newcomb at fws.gov
Sent: Thursday, January 20, 2011 8:02 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Coordinates and SRID - bound overflow,
ST_Equals

 


Balint 
Would using the geography data type be more suitable to what you are
trying to accomplish? 

http://postgis.refractions.net/docs/ch04.html#PostGIS_GeographyVSGeometr
y
<http://postgis.refractions.net/docs/ch04.html#PostGIS_GeographyVSGeomet
ry>  
Doug Newcomb             
USFWS
Raleigh, NC
919-856-4520 ext. 14 doug_newcomb at fws.gov
------------------------------------------------------------------------
---------------------------------
The opinions I express are my own and are not representative of the
official policy of the U.S.Fish and Wildlife Service or Dept. of the
Interior.   Life is too short for undocumented, proprietary data
formats. 



Balint Persics <persicsb at gmail.com> 
Sent by: postgis-users-bounces at postgis.refractions.net 

01/20/2011 06:30 AM 

Please respond to
PostGIS Users Discussion <postgis-users at postgis.refractions.net>

To

postgis-users at postgis.refractions.net 

cc

	
Subject

[postgis-users] Coordinates and SRID - bound overflow, ST_Equals

 

		




Hi,

I have a very interesting problem, but I think some of you may have a
solution for that.

When I try to model Russia with EPSG:4326 coordinates, I "run out of
the bounds", e.g.  Russia's extent is so wide, it overlaps the
-180/+180 coordinate range of EPSG:4326, so the most
eastern part is in the western Hemisphere. When inserting points to
the geometry column, PostGIS allows me to insert both (186,45) and
(-174,45) (the former is out of the bounds of the reference, the
latter is okay). When I query the database whether these two points
are equal with ST_Equals, I get a false result , but in reality, they
are the same. I think there should be a version of ST_Equals which
compares the geometries taking into account their SRID.

Thanks,
Balint

-- 
Persics Balint
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
<http://postgis.refractions.net/mailman/listinfo/postgis-users> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110120/771ea4a3/attachment.html>


More information about the postgis-users mailing list