Hi Steve,
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)?
TIA
Krung
>> I'd like to compute partial area of polygon that intersects with
another
> polygon. Is there a way to do with PHPMapscript? For example, I want
to
>> know how many square kilometers of forests that reside in the area of
>> 50km-radius circled area. Or where can I get to the example?
another
> polygon. Is there a way to do with PHPMapscript? For example, I want
to
>> know how many square kilometers of forests that reside in the area of
>> 50km-radius circled area. Or where can I get to the example?
>If you use PostGIS this is a straight forward SQL query like:
>select polyid, area2d(intersection(the_geom, circleAsPolygon(point(x,
y), radius, npoints)) as area from mytable where the_geom &&
expand(point(x, y), radius);
y), radius, npoints)) as area from mytable where the_geom &&
expand(point(x, y), radius);
>where the_geom is the geometry column for the polygons
and x,y is the center of your circle radius = 50000
>and npoints is the number of points to generate for the polygonal
circle.
and x,y is the center of your circle radius = 50000
>and npoints is the number of points to generate for the polygonal
circle.
>you would need to write a function circleAsPolygon() in pgsql, but that
is pretty trivial and most of us that would with PostGIS could post
>that
>if you needed us to.
is pretty trivial and most of us that would with PostGIS could post
>that
>if you needed us to.
>-Steve
Yahoo! Photos
Got holiday prints? See all the ways to get quality prints in your hands ASAP.
