[postgis-users] Is possible to make this?

Robert W. Burgholzer rburgholzer at maptech-inc.com
Thu Aug 19 06:57:14 PDT 2004


Alberto,
I use the following to get an a percentage of area overlapping between two 
polygons from different tables in order to get a weighted precipitation 
input for a hydrologic model:

select a.watershed_id, b.precip_id, round( 
(area2d(intersection(geometryn(a.the_geom,0),geometryn(b.the_geom,0)))/area2d(a.the_geom))::numeric 
,4) as weight from watershedtab as a,precip_shapes as b where (a.the_geom 
&& b. the_geom) and 
area2d(intersection(geometryn(a.the_geom,0),geometryn(b.the_geom,0))) > 0;

The geometryn call is needed because my shapes are considered 
multipolygons. Your mileage may vary.

The result here yields the id column for my watershed, the id column for 
each overlapping precipitation polygon and the fraction of area that is 
overlapped by each for each watershed in my theme.

hope this helps,
r.b.

At 03:32 PM 8/19/2004 +0200, you wrote:
>On Thu, Aug 19, 2004 at 02:51:21PM +0200, Alberto Cavalli wrote:
> > Hi, I'm a newbye of postgis and I don't Know the potentiality of it.
> > I'm going to make a project where I've 10 layers: one of parcels and the
> > others are a simple polygon.
> > When I make a query on a parcel, that intersect a portion of one polygon
> > (one of the other 9 layers) is possible to obtain the amount of area of
> > parcel that is in common with the polygon?
> > I hope that someone can answer to my question and can tell to me the right
> > way to do this.
> > thaks in advance
> > Alberto
>
>_______________________________________________
>postgis-users mailing list
>postgis-users at postgis.refractions.net
>http://postgis.refractions.net/mailman/listinfo/postgis-users

Robert Burgholzer
Environmental Engineer
MapTech Inc.
http://www.maptech-inc.com/ 




More information about the postgis-users mailing list