[postgis-devel] Spatial relationship functions

Bborie Park bkpark at ucdavis.edu
Fri Jul 20 14:14:22 PDT 2012


On 07/20/2012 02:05 PM, Pierre Racine wrote:
>> If a user needs a spatial relationship test done treating parameters as
>> geometries, they should use...
>>
>> ST_SomeSpatialRelationshipTest(geometry, ST_Polygon(raster))
>>
>> ST_SomeSpatialRelationshipTest(ST_Polygon(raster), geometry)
>>
>> ST_SomeSpatialRelationshipTest(ST_Polygon(raster), ST_Polygon(raster))
> 
> But ST_Polygon(raster) is very slow no? ST_Intersects use a clever approach: It iterates on the pixels and if only one fullfil the condition it returns true. I don't if such an approach can be adopted for the other relationaship...
> 

ST_Intersects is unique of all the spatial relationship tests as it
takes advantage of the grids' lines and seeing where those lines
intersect.  Anything else requires the use of a spatial area, hence
ST_Polygon.

>> Thoughts?  Sadly, I was the one to introduce this "order dictates how
>> the parameters are treated" convention... *sigh*.  Not enough
>> forethought on my part.
> 
> And I warned you... Remember?
> 

Don't remind me...

>>From Regina:
> 
>> I just assume force people to be explicit with how they expect the operation
>> to happen and adds more cluttering functions
>> To confuse people which they should use.
> 
> I agree. There are two ways to explicitly force the space (raster of vector) those functions are performed: one is to change the name, another is to add a 'raster'|'vector' parameter and set one as the default. I think I would prefer the second option.
> 
> Pierre
> 

-- 
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
bkpark at ucdavis.edu





More information about the postgis-devel mailing list