<DIV id=RTEContent>Hi Steve,</DIV> <DIV> </DIV> <DIV>Thank you for your advice. I re-tried postgis again, it worked with a little debug message but not the case. I confused with postgresql and postgis geometry features. Could you please show me circleAsPolygon() function (user-defined)?</DIV> <DIV> </DIV> <DIV>TIA</DIV> <DIV>Krung</DIV> <DIV> </DIV> <DIV>>> I'd like to compute partial area of polygon that intersects with <BR>another <BR>> polygon. Is there a way to do with PHPMapscript? For example, I want <BR>to <BR>>> know how many square kilometers of forests that reside in the area of <BR>>> 50km-radius circled area. Or where can I get to the example?</DIV> <DIV> </DIV> <DIV>>If you use PostGIS this is a straight forward SQL query like:</DIV> <DIV>>select polyid, area2d(intersection(the_geom, circleAsPolygon(point(x, <BR>y), radius, npoints)) as area from mytable where the_geom && <BR>expand(point(x, y),
radius);</DIV> <DIV>>where the_geom is the geometry column for the polygons<BR>and x,y is the center of your circle radius = 50000<BR>>and npoints is the number of points to generate for the polygonal <BR>circle.</DIV> <DIV>>you would need to write a function circleAsPolygon() in pgsql, but that <BR>is pretty trivial and most of us that would with PostGIS could post <BR>>that <BR>>if you needed us to.</DIV> <DIV>>-Steve</DIV><p>
<hr size=1>Yahoo! Photos<br>
Got holiday prints? <a href="http://us.rd.yahoo.com/mail_us/taglines/holidayprints/*http://pa.yahoo.com/*http://us.rd.yahoo.com/mail_us/taglines/photos/evt=38089/*http://pg.photos.yahoo.com/ph//print_splash">See all the ways</a> to get quality prints in your hands ASAP.