[postgis-users] st_within operation not considering sphericaldistortion

Paul Ramsey pramsey at opengeo.org
Mon Mar 8 08:23:31 PST 2010


You'll find that ST_Covers() is available for the geography type in
PostGIS 1.5 and should meet your needs...

select st_covers(st_geogfromtext('POLYGON((0 44, -90 44, -90 46, 0 46,
0 44))'),st_geogfromtext('POINT (-40 44.1)'))

 st_covers
-----------
 f
(1 row)



On Mon, Mar 8, 2010 at 7:06 AM,  <info at georgherdt.de> wrote:
> Hi Ralf,
> thanks for your quick response. I've been looking at 3035 (ETRS89). The
> problem for me with this spatial reference system is, that my geometries are
> spanning over the whole world.
> Maybe you know a srs which covers -180 to 180 and -90 up to 90 ???
>
>
> Cheers
>
> Georg
>
>
>
> Zitat von "Suhr, Ralf" <Ralf.Suhr at itc-halle.de>:
>
>> Yes it's only thinking,
>>
>> select st_within(ST_Transform(st_geomfromtext('POINT (-40
>> 44.1)',4326),3035),ST_Transform(st_geomfromtext('POLYGON((0 44, -90 44, -90
>> 46, 0 46, 0
>> 44))',4326),3035));
>>
>>  st_within
>> -----------
>>  F
>>
>> If you use only EPSG:4326 all coordinates are plain orthogonal and your
>> query is true.
>>
>> Gr Ralf
>>
>> -----Ursprüngliche Nachricht-----
>> Von: postgis-users-bounces at postgis.refractions.net
>> [mailto:postgis-users-bounces at postgis.refractions.net] Im Auftrag von
>> info at georgherdt.de
>> Gesendet: Montag, 8. März 2010 15:49
>> An: postgis-users at postgis.refractions.net
>> Betreff: [postgis-users] st_within operation not considering
>> sphericaldistortion
>>
>> Hi,
>>
>> yet I'm quite new to the list, I'm using postigis for some time.
>> For now I discovered the following behaviour for this query:
>>
>> select st_within(st_geomfromtext('POINT (-40
>> 44.1)',4326),st_geomfromtext('POLYGON((0 44, -90 44, -90 46, 0 46, 0
>> 44))',4326))
>>
>> Stating that the point (-40,44.1) is within the given polygon. But
>> when considering the spherical "distortion" (the connect between the
>> points are arcs not straight lines) on the described polygon this
>> point cannot be within.
>> I've seen that there are some functions for calculating spherical
>> distances but, nothing similar for the st_within function.
>>
>> Can anybody help me whats wrong with that. Maybe its my thinking ;-)
>>
>>
>> Best regards
>>
>> Georg Herdt
>>
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>
>
>
> _______________________________________________
> 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