[postgis-users] inconsistent comparison with sql server 2008

Paul Ramsey pramsey at opengeo.org
Thu Oct 27 11:28:10 PDT 2011


The algorithm we use for area on the spheroid is not great, and is sensitive
to the poles and equator.

select st_area('POLYGON((0 0,45 -89.9999,90 0,0 0))'::geography);

An area for future work and/or funding, for sure.

P.

On Wed, Oct 26, 2011 at 1:04 PM, Jon Flitton <jonathan.flitton at pb.com>wrote:

> ** **
>
> Hello everyone****
>
> ** **
>
> I’ve been trying to replicate some data in postgis that I have in sql
> server however the postgis version gives inconsistent results so I’m looking
> for help to see if I have something wrong.****
>
> ** **
>
> So the data I am creating is to segment the globe in to 8 triangles. The
> nodes are then located at the poles and the 4 “corners” of the equator.***
> *
>
> I am using the geography type in both databases and wgs84****
>
> Below I give the text version of the polygons (as they come out of the
> database using STAsText in sqlserver and ST_AsText in postgis)****
>
> Also sown is the area of the polygon which is a simple check on the polys.
> ****
>
> ****
>
> In sql server I have****
>
> Text
> Area****
>
> POLYGON ((0 0, 0 90, -90 0, 0 0))                63758201600773.2****
>
> POLYGON ((-90 0, 0 90, 180 0, -90 0))       63758199375051****
>
> POLYGON ((180 0, 0 90, 90 0, 180 0))        63758199375051****
>
> POLYGON ((90 0, 0 90, 0 0, 90 0))               63758201600773.2****
>
> POLYGON ((0 0, 0 -90, 90 0, 0 0))                63758201600773.2****
>
> POLYGON ((90 0, 0 -90, -180 0, 90 0))       63758208279862.1****
>
> POLYGON ((-180 0, 0 -90, -90 0, -180 0))  63758203826495.3****
>
> POLYGON ((-90 0, 0 -90, 0 0, -90 0))          63758201600773.2****
>
> ** **
>
> In postgis****
>
> POLYGON((0 0,0 90,-90 0,0 0))****
>
> 63758234549478.10****
>
> POLYGON((-90 0,0 90,180 0,-90 0))****
>
> 63758234549482.70****
>
> POLYGON((180 0,0 90,90 0,180 0))****
>
> 63758234549478.20****
>
> POLYGON((90 0,0 90,0 0,90 0))****
>
> 148769213948756.00****
>
> POLYGON((0 0,0 -90,90 0,0 0))****
>
> NaN****
>
> POLYGON((90 0,0 -90,-180 0,90 0))****
>
> NaN****
>
> POLYGON((-180 0,0 -90,-90 0,-180 0))****
>
> NaN****
>
> POLYGON((-90 0,0 -90,0 0,-90 0))****
>
> NaN****
>
> ** **
>
> ** **
>
> So the first three in post gis are similar in area  (I assume a slightly
> different geoid is used) but the 4th one is very different and the
> southern hemisphere are all wrong.****
>
> ** **
>
> Any ideas?****
>
> ** **
>
> ** **
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20111027/98f5d396/attachment.html>


More information about the postgis-users mailing list