Compute partial polygon area

Gregory S. Williamson gsw at GLOBEXPLORER.COM
Sat Dec 31 17:36:57 PST 2005


According to Refractions download page (<http://postgis.refractions.net/download/>) there are windows binaries at <http://www.webbased.co.uk/mca>, although they say on that page that postGIS is included in the latest release of postgres itself.

The postgres downloads can be found at <http://www.postgresql.org/download/> and then follow the links for ftp or bitTorrent, depending.

I haven't used the windows variant and then a 8.0 version) for anything but prototyping and light weight stuff; we're strictly a linux/solaris shop as far as databases go, so I don't have much useful advice on the windows stuff.

HTH,

Greg Williamson
DBA
GlobeXplorer LLC


-----Original Message-----
From:	UMN MapServer Users List on behalf of Krung Saengpole
Sent:	Sat 12/31/2005 5:16 PM
To:	MAPSERVER-USERS at LISTS.UMN.EDU
Cc:	
Subject:	Re: [UMN_MAPSERVER-USERS] Compute partial polygon area
Hi Steve,
   
  Thank you for your reply. I'll try it but may take so long time. I used to try postGIS, but grant problem came to me. Could you please pointing me to the right place to start playing with postGIS on Windows?

  Thank you again.
  Krung

  Stephen Woodbridge <woodbri at swoodbridge.com> wrote:
  Krung Saengpole wrote:
> Hi all,
> 
> 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?

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);

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.

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.

-Steve
  


		
---------------------------------
Yahoo! for Good - Make a difference this year. 

!DSPAM:43b72d7f146601303620397!



More information about the MapServer-users mailing list