[Geomoose-users] utilize wfs for select service?

Andrew Sheppard asheppard at houstoneng.com
Mon Jul 2 10:20:16 PDT 2012


I have investigated some more and can refine my proposal a bit.  First, the good news: I was able to enable WFS support in select/highlight.map without breaking existing functionality.  Actually, it was already enabled and just needed some additional metadata to work properly.  I then modified select.php to send slightly different layer refresh commands depending on whether the highlight layer is a WFS or Mapserver layer.  This means that users who want selection results to be rendered as vectors will simply need to define the highlight layer as WFS in the mapbook.  The other change I made was to WFS.js, to add support for MapSource.setUrl().

I have attached a work-in-progress patch for review.  I think the changes are minor and useful enough to merit changing the core select service, but this is obviously up for discussion.  If possible I would like to avoid maintaining a custom service that is 98% the same as select.php and only differs in the output format.  Another alternative would be refactoring select.php (and/or other core services) to make it possible to subclass them with extended functionality.  This would of course be simpler if the services were written in Python, but I digress…

This brings me to the bad news: query.php uses a different method for rendering the result highlight layer, and I could not successfully reproduce the changes I had made to select.php.  The issue seems to be that PHP-MapScript does not parse WFS queries generated by OpenLayers (https://github.com/mapserver/mapserver/issues/4330).  In general I think it would be better if select.php and query.php used the same codebase for generating output, so that improvements to one would apply to the other.  Again, subclassing would be one way to accomplish this, or at least both could utilize a shared “output.php”.

Any thoughts are appreciated -

S. Andrew Sheppard

________________________________________
From: Brian Fischer 
Sent: Thursday, June 28, 2012 10:58 AM
To: Dan Little; Andrew Sheppard; GeoMOOSE Users List
Subject: RE: [Geomoose-users] utilize wfs for select service?

I would like to add the use case to this email thread so the mailing list understands what we are trying to accomplish.  I would also like to hear from the mailing list whether this would make for a good candidate to propose adding to the core code and in essence be the standard way GeoMoose would work with selection sets or should this become a documented alternative customization or possibly an extension if possible.  An example of this functionality was developed to work with GM 2.2 using a homegrown vector layer.  We are now trying to port this functionality for use in GM 2.6 using the new vector layer support.  See: http://apps.co.polk.or.us/geomoose2/index.html 

Common Use Case: A user creates a selection results set of features by using the attribute query, select or buffer tools.
Result: The service would return the features to the map as a vector layer to visually show the results and display a query template results in tab.
Follow-up Use: A user would then be able to interact with that vector results set.
Supported Interaction Needs to include:
- Highlight a feature
- Remove a feature from selection set by clicking on icon
- Zoom to feature
- Zoom to all features
- Buffer selection results (likely this would just call the existing service)
- Open features in a table view with their attributes
- Print all results
- Download all results as CSV file
Desired but not a requirement at this point:
o Add or remove a feature to selection results by clicking on the map

Potential implications: Need to Enable layers as WFS in MapServer mapfiles?  Support for selection results as a highlight layer using an image?

Brian Fischer, CFM

________________________________________
From: geomoose-users-bounces at lists.osgeo.org [mailto:geomoose-users-bounces at lists.osgeo.org] On Behalf Of Dan Little
Sent: Thursday, June 28, 2012 8:42 AM
To: Andrew Sheppard; GeoMOOSE Users List
Subject: Re: [Geomoose-users] utilize wfs for select service?

Why change the highlight layer definition, which breaks the built-in services you would still be trying to use (presumably) instead of defining a new Vector layer (as WFS if you'd like) and then have your service return Javascript to manipulate it?

________________________________________
From: Andrew Sheppard <asheppard at houstoneng.com>
To: GeoMOOSE Users List <geomoose-users at lists.osgeo.org> 
Sent: Wednesday, June 27, 2012 5:44 PM
Subject: [Geomoose-users] utilize wfs for select service?

Hi all,
I’m currently working on porting the custom select tool to GeoMOOSE 2.6.  The customizations enable direct interaction by using vector features for the selection result (instead of rendering a raster image).  This makes it possible to e.g. highlight an individual feature by clicking an icon in the result list.  In the old custom code the service sent back commands to create the vectors in the <script> result of the service.  I could replicate this but would like to propose utilizing a WFS layer instead.  This could be done in at least two ways:
 
1.)    We could change the highlight layer in the mapbook to be a read-only WFS layer.  This would also mean altering the highlight.map template in htdocs/php/select/ to enable WFS requests.  select.php would work more or less as it does now (but some of the rendering commands it sent back would be different).
 
2.)    We could try to utilize the OpenLayers GetFeature control which can be used to directly transform interaction with a WMS layer into WFS requests (see http://openlayers.org/dev/examples/getfeature-wfs.html).  This would require the user to enable WFS in the mapfile for each layer they wanted the select service for.  Since WFS supports spatial filters, select.php would not be used (but we would need to a different way to render the HTML).
 
Either of these options would to need be configurable so that the current raster-based approach would still be available (especially when there is a potential for large selection result sets).

S. Andrew Sheppard
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: wfs_highlight.patch.txt
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20120702/d7d12012/attachment-0001.txt>


More information about the Geomoose-users mailing list