[GRASS-dev] improving v.in.wms

Hamish hamish_b at yahoo.com
Sun Sep 16 01:16:49 PDT 2012


Luca wrote:
> For me +1 to use OWSlib,i already thought to use it for wms/wfs client.
> if we add this dependency we could also add others clients (wcs,sos etc)
> in a easy way.


Hi,

since it is just a couple characters to += onto the URL to support data
layer names, bounding boxes, etc. I stuck with the current method for now.
Added functionality in r53180:

New flags:
  -l   Download server capabilities to 'wms_capabilities.xml' in the current directory and exit
  -r   Restrict fetch to features which touch the current region

New/changed parameters:
               url   Base URL starting with 'http' and ending in '?'
              name   Comma separated names of data layers to download
               srs   Specify alternate spatial reference system (example: EPSG:4326)
                      The given code must be supported by the server, consult the capabilities file
  maximum_features   Maximum number of features to download
                      (default: unlimited)
       start_index   Skip earlier feature IDs and start downloading at this one
                      (default: start with the first feature)


There is still lots of room for improvement and better methods, I just
went with the quick solution. (But it works) Please do improve it further
if you like..


Since the data layer Name is not always very meaningful as the Title, and
the xml capabilities file is often hard to browse, even with xml2 parsing,
I was thinking perhaps to put the OWSlib magic for WFS into an owslib
based interactive GUI browser tool, somewhat similar to QGIS 1.8.0's nice
qbrowser* but with a search/filter function as the grass location wizard
has, allow to limit by current g.region bounds, etc.

[*] qgis 1.8.0's main WFS add layer dialog seems like it is still under
construction; the qbrowser side of things worked a bit better for me.


.. I'm not too worried since WFS is a lot cleaner than WMS data to deal
with, just trying to think of how not to fall into the same traps as we
did for the grass 6 r.in.wms, where the low-level module tried to do too
much itself.


Hamish

ps- the Hannover grass user map wfs in the module's example returns a 404.


More information about the grass-dev mailing list