[mapserver-users] Clipping
José María Michia
jose.maria.michia at gmail.com
Mon Dec 22 17:04:14 PST 2008
2008/12/22 Joshua Hevenor <jhevenor at rogers.com>:
> Good morning list,
> I'm looking for a function and/or method to clip a polygon. In general, I
> need to limit a polygon to the map boundary for export (export as shapefile
> from a web map)...so if I had a 20x20 square that was overlapping
> the visible map by 10 units, the exported result would be a 10x20
> rectangle. PHP MapScript is my weapon of choice. I'd also welcome opinions
> on the approach or suggestions for alternatives.
>
> Thanks for your assistance,
>
> Josh
>
> PS. Sorry for the re-post...forgot the subject
I don't know how to make this using only PHP, but combining with
postgis, you can clip geometries using something like:
SELECT intersection(the_Geom, <box3d>) FROM <table> WHERE the_Geom && <box3d>;
Saludos
José María
More information about the MapServer-users
mailing list