[mapserver-users] Intersect and Union with mapserver

Brent Wood pcreso at pcreso.com
Sun Dec 29 17:40:38 PST 2013


I'm not sure if the unioning desired is dynamic & user driven or not. Robert's WPS solution will work if such a dynamic union is required - carried out at runtime as requested by the user and driven by user supplied parameters.

Another possibility, which mapserver is quite capable of serving, can be achieved using Postgis - a data management tool rather than simple shapefiles. Load each shapefile into a Postgis database and use the database for the required data processing.

As a relational database, the Postgis "layer" served as WMS or WMS can be the result of a query which unions the two layers - also at runtime - but as directed by the server (actually the SQL statement in mapserver that defines the layer being served).

This approach abstracts (separates) the delivery of the spatial data by mapserver from the underlying data manipulation (UNIONING) in Postgis.

For example, the data layer served by mapserver is defined by a Postgis SQL on two tables (shapefiles) a & b - (a) being properties &(b) waterfalls:

"select distinct a.id,
        a.name,
        a.owner as owner_name,
        b.name as waterfall_name,

        ST_Union(a.geom, b.geom) as geomunion
where ST_Intersects(a.geom, b.geom);"


The output is the geometric union of each waterfall with the each property it interects spatially, along with attributes from both tables. This is admittedly simplistic, and probably needs some refinement to be robust in the real world, but hopefully it illustrates how this sort of union can perhaps be served by mapserver without a WPS.

Also, note that the SQL can be modified on the fly, using either OGC filter encoding or mapserver variable substitution, to accept an additional where clause so that the user can select a waterfall name or property owner name as a filter, & just return the matching records, which also provides some of the user control of parameters that a more sophisticated WPS can provide.


Given the layer is defined by a join on two tables which is carried out at runtime - the result will always be current - so results may change between requests as the contents of the underlying tables change.


Cheers

Brent Wood



________________________________
 From: Robert Sanson <Robert.Sanson at asurequality.com>
To: mapserver-users at lists.osgeo.org; saka royban <sakaroyban at yahoo.com> 
Sent: Monday, December 30, 2013 9:44 AM
Subject: Re: [mapserver-users] Intersect and Union with mapserver
 

What you need is a Web Processing Service (WPS). The client app needs to allow the user to select the two layers to UNION or Intersect, then pass the request to the WPS which performs the task, and passes the resulting layer back to the client for display. I don't believe Mapserver can do this yet, although it could participate in the selection process and the display of the result. 

regards,

Robert

>>> saka royban <sakaroyban at yahoo.com> 30/12/2013 6:21 a.m. >>>
Thanks steve.
Because i'm kind of ArcGIS-oriented guy, i should explain what i see there
and loonking for that here.
Supppose that 2 verctor layers as input, Union analysis produces another
vector layer with attributes of both input layers while features of input
layers are UNIONED.
I hope i have explained well what i have in my mind.

(and sorry for my english, as well).

Regards



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Intersect-and-Union-with-mapserver-tp5095717p5095731.html 
Sent from the Mapserver - User mailing list archive at Nabble.com.
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org 
http://lists.osgeo.org/mailman/listinfo/mapserver-users



This email and any attachments are confidential and intended solely for the addressee(s). If you are not the intended recipient, please notify us immediately and then delete this email from your system.

This message has been scanned for Malware and Viruses by Websense Hosted Security.
www.websense.com
_______________________________________________
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/20131229/2b6a713c/attachment.htm>


More information about the MapServer-users mailing list