Looking for suggestions. I’d like to multiply the output of one of the properties of a WFS request, similar to what I’m doing in an SLD to convert meters to feet for my “value” property.
Does this make any sense? It doesn’t appear to work, and reading the WFS spec is not helping.
On Wed, May 28, 2014 at 10:57 AM, Roger Bedell <sylvanascent@anonymised.com>wrote:
Looking for suggestions. I'd like to multiply the output of one of the
properties of a WFS request, similar to what I'm doing in an SLD to convert
meters to feet for my "value" property.
Does this make any sense? It doesn't appear to work, and reading the WFS
spec is not helping.
You cannot do any kind of calculation with WFS. Look at WPS instead, it's
the OGC protocol
meant to do any kind of calculation.
Unfortunately there is no out of the box process doing exactly what you
want, but with some java programming
the TransformProcess defined in GeoTools could be made usable in GeoServer
WPS.
Cheers
Andrea
--
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.
Ing. Andrea Aime @geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
vec:Transform
Computes a new feature collection from the input one by renaming, deleting, and computing new attributes. Attribute values are specified as ECQL expressions in the form name=expression.
Looking for suggestions. I’d like to multiply the output of one of the properties of a WFS request, similar to what I’m doing in an SLD to convert meters to feet for my “value” property.
Does this make any sense? It doesn’t appear to work, and reading the WFS spec is not helping.
You cannot do any kind of calculation with WFS. Look at WPS instead, it’s the OGC protocol
meant to do any kind of calculation.
Unfortunately there is no out of the box process doing exactly what you want, but with some java programming
the TransformProcess defined in GeoTools could be made usable in GeoServer WPS.
Cheers
Andrea
–
==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
Yes, after I wrote the email I discovered the gs:Transform in WPS, and what a lovely thing it is. All in all, I’ve finally managed to get 2 foot contours from the Oklahoma NRCS LiDAR 2m DEM coverage to come out in all the output formats I already had in WFS. I use the chain WCS → gs:Contour → gs:Transform → gs:Import to create a new PostGIS layer, then WFS with OGR2OGR to get all the output formats needed (SHP, KML, TAB, DGN, CSV, DXF). Then delete the PostGIS layer and the underlying table.
It would be nice to skip the last step of creating the PostGIS layer and WFS and go directly to OGR2OGR, but this doesn’t seem possible at this time.
One more thing, I discovered that gs:Import seems to strip all significant digits after 2. ie, 3.14159 turns into 3.140000. Is this a bug or a feature?
As an example for anyone else contemplating such a thing, here is the WPS XML for the chain:
vec:Transform
Computes a new feature collection from the input one by renaming, deleting, and computing new attributes. Attribute values are specified as ECQL expressions in the form name=expression.
Looking for suggestions. I’d like to multiply the output of one of the properties of a WFS request, similar to what I’m doing in an SLD to convert meters to feet for my “value” property.
Does this make any sense? It doesn’t appear to work, and reading the WFS spec is not helping.
You cannot do any kind of calculation with WFS. Look at WPS instead, it’s the OGC protocol
meant to do any kind of calculation.
Unfortunately there is no out of the box process doing exactly what you want, but with some java programming
the TransformProcess defined in GeoTools could be made usable in GeoServer WPS.
Cheers
Andrea
–
==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
On Thu, May 29, 2014 at 8:41 AM, Andrea Aime
<andrea.aime@anonymised.com>wrote:
On Thu, May 29, 2014 at 4:14 AM, Jody Garnett <jody.garnett@anonymised.com>wrote:
I thought transform was already listed for WPS?
Duh, just looked at the code, and could not find a PPIO for
TransformProcess.Definition, that's why I thought
it was not listed
Ah found it now, the version exposed by the WPS is the lame one, uses a
single string as
comma separated arguments (which is against WPS way to do multiple inputs)
and cannot
do casts.
Eventually we should get rid of it and do it the "right" way (PPIO for
Definition, and
advertise that the transform is multi-input the normal WPS way).
Cheers
Andrea
--
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.
Ing. Andrea Aime @geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549