[postgis-users] More Semantics: SRID Matching

Paragon Corporation lr at pcorp.us
Thu Jan 29 14:54:18 PST 2009


Martin,

I'm thinking about the case when all your geometries are TAGGED with an
srid, but you are doing an adhoc query say a web query which is the common
use case for Paul's example.  As I understand it, he wants that adhoc
geometry to not have to have an SRID.

Its not always the same people writing the web query as the people managing
the database.

In the case of -1 you don't need a set srid anyway if your geometries are -1
as I recall. 

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Martin
Davis
Sent: Thursday, January 29, 2009 5:22 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] More Semantics: SRID Matching

But then you should have tagged all your geometries with 4326 in the first
place, no?  So then things *would* break, as required.

I'm with Paul on this - if a user hasn't taken the trouble to properly set
the SRID, then PostGIS should just carry out the computation.  
Otherwise, you might as well insist that all geometries carry a valid 
SRID (not -1).   But being able to use -1 is useful shorthand for quick 
computation.

Paragon Corporation wrote:
> I'm afraid I agree with Jan on this.  Like Brent said you'd want to 
> know about the assumption being made, but I'd just assume not have 
> warnings and without warnings things like this where there is no match 
> are just too hard to debug.  And code running in lalala land is not 
> going to be looking at warnings.
>
> Say your table had a projection of 4326 once and then later your 
> change it to 2249 or whatever and had no idea there was code lying 
> around thinking it was working with 4326.  Your code would 
> mysteriously just stop producing results or odd results.
>
> I'd rather it just break than do the logically wrong thing.
>
> -1
>
> Thanks,
> Regina
>
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of 
> Jan Hartmann
> Sent: Thursday, January 29, 2009 4:52 PM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] More Semantics: SRID Matching
>
> I wouldn't do that. My experience is that you'll run into errors that 
> are very hard to detect when you allow this sort of "default" behavior.
> What's wrong whith an extra setsrid or so?
>
> Jan
>
> Paul Ramsey wrote:
>   
>> I just did this:
>>
>> aggtest=# select name from tm_world_2 where st_dwithin(the_geom,
>> 'POINT(32.4122 -21.2178)', 0.0001);
>> ERROR:  Operation on two geometries with different SRIDs
>>
>> And you know what, that seems a bit harsh to me. Given an operation 
>> where one SRID is known (st_srid(the_geom) == 4326), and the other is 
>> unknown (-1), can we not simply assume that everything is in the 
>> known SRID?
>>
>> Comments?
>>
>> P
>> _______________________________________________
>> 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
>
>   

--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

_______________________________________________
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