[Mapserver-users] Shapelib, GPC, PHP, and polygon clipping
Carl Anderson
carl.anderson at vadose.org
Fri Apr 30 18:40:41 PDT 2004
On 04/30/2004 08:38:04 PM, "Ryan, Adam" wrote:
>
> Steve, Frank, etc...
>
> A while back Steve Lime wrote in response to a request for polygon
> clipping
> code.
>
> http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0201/msg00094.html
>
> He suggested using the GPC library. I checked this out and was able
> to get
> it to work.
>
> Is it worth trying to use GPC with either PHP mapscript or shapelib
> directly
> and write a little routine to grab the shapes in question, convert
> them to
> gpc ascii format, run the clip operation, and convert back to a
> shapefile
> result? In PHP I could build the ASCII files, then call a gpc
> executable,
> and then translate the ASCII result back into a new shapefile.
>
I did that I while back and found that about 0.5% of clipped polygons
were collected wrong from the base shapes. Not a big number but
overtime it builds up....
either JTS (JAVA, http://www.vividsolutions.com/jts/) or GEOS
(C++, http://geos.refractions.net) are a better starting point
C.
More information about the MapServer-users
mailing list