[postgis-users] Identity Overlay

Paul Ramsey pramsey at refractions.net
Wed Nov 22 12:06:38 PST 2006


This is such a common performance case, we're going to add some 
automagical code to make Contains() work more efficiently, by 
short-circuiting and Contains(POLYGON, POINT) cases directly to an 
internal postgis PIP algorithm.

P

Stephen Woodbridge wrote:
> Try:
> 
> UPDATE point_layer SET b250k_tag = polygon_layer.b250k_tag WHERE
>   polygon_layer.the_geom && point_layer.the_geom and
>   distance(polygon_layer.the_geom, point_layer.the_geom) < 0.00001;
> 
> It is not good to compare floats with equals due to possible rounding 
> errors.
> 
> -Steve
> 
> Aaron Koning wrote:
>> Hi All,
>>
>> I am trying to perform an identity overlay where each point in a point 
>> layer gets a value from a polygon layer based on what polygon contains 
>> the point. I have come up with the following query which is working 
>> fairly well.
>>      UPDATE point_layer SET b250k_tag = polygon_layer.b250k_tag WHERE 
>> contains(polygon_layer.the_geom, point_layer.the_geom);
>>
>> I am just wondering if other people have performed identity like 
>> overlays in PostGIS and is there a better / more efficient way to 
>> perform them?
>>
>> Thanks,
>> Aaron
>>
>> +-------------------------------------------------
>> |  Aaron Koning
>> |  Information Technologist
>> |  Prince George, BC, Canada.
>> +-------------------------------------------------
>> |  Flexible Internet Spatial Template:
>> |       http://fist-mapping.org
>> +-------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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