[mapserver-users] Scripted geoprocessing

pcreso at pcreso.com pcreso at pcreso.com
Tue Jun 5 11:09:58 PDT 2012


Hi Sam,

Define "simpler" :-)

I could do it in Postgis with a few lines of script, but you'd need to install Postgis.

Postgis essentially has the code already written, you just need to deploy it. Other approaches may require less in the way of installation & more in the way of writing your own code...

On a Linux box, especially a mainstream distro, Postgis is trivial to install & manage, so it would be hard to be simpler. If you need to compile, etc, then there are other ways that could be simpler.

Cheers,

  Brent

--- On Wed, 6/6/12, Lime, Steve D (DNR) <Steve.Lime at state.mn.us> wrote:

From: Lime, Steve D (DNR) <Steve.Lime at state.mn.us>
Subject: Re: [mapserver-users] Scripted geoprocessing
To: "Sam Skinner" <sam at planyukon.ca>, "mapserver-users at lists.osgeo.org" <mapserver-users at lists.osgeo.org>
Date: Wednesday, June 6, 2012, 5:01 AM

Hi Sam: MapScript does have GEOS functions built into it so you might be able to use just those. I remember doing something along these line using Perl MapScript. I don't have the script handy but I think I used a hash of shapes based on the attribute value in question. For each shape you simple add all the parts to the right hash element. Could either use the Union operator or just add the parts. Then once you have processed every feature in the shapefile(s) you do a buffer(0) on each of the hash elements with I think effectively does a dissolve. Of course you need to save the dissolved shape someplace too. In Perl this is not a very long script: a loop to build the hash of shapes and another loop to process the hash.

Steve 

-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Sam Skinner
Sent: Friday, June 01, 2012 6:34 PM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] Scripted geoprocessing

Hi all,
I am writing a python script that will (weekly) download and extract data (shapefiles) from an organization without a WMS or WFS. This script will reside on my linux-based mapserver (5.6). I am looking for a way for this script to dissolve polygons with a common attribute. This will help rendering speed and ease of visualization. Any ideas on how I could do this? From what I understand (which isn't much!), I could import the data into PostGIS, then run some query there. Is there a simpler way? Is anyone familiar with Sextante, and would that work?

Thanks!

--
Sam Skinner (Mapserver admin and newbie) Yukon Land Use Planning Council


_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120605/c45b41ec/attachment-0001.html>


More information about the mapserver-users mailing list