[Geoserver-devel] WCS 2.0: multiple kvp keys with different values, here they come

Hi,
so far OGC services always had used one valued keys in requests, eventually creating
some complex syntax to hold the eventual structured values inside the key.

Of course the time should have come, sooner or later, to have a service with
repeated keys with different values in the requests… WCS 2.0 is the one, behold,
subset=… three times:

http://www.myserver.org:port/path?
service=WCS
&version=2.0
&request=GetCoverage
&coverageId=C0002
&subset=lon,http://www.opengis.net/def/crs/EPSG/0/4326(-71,47)
&subset=lat,http://www.opengis.net/def/crs/EPSG/0/4326(-66,51)
&subset=t,http://www.opengis.net/def/trs/ISO-
8601/0/Gregorian+UTC(“2009-11-06T23:20:52Z”)

Now… having the dispatcher and the KVP parser handle this is not too hard,
see the attached path.

Rationale: we allow String in the dispatcher kvp maps, which switch
from Map<String, String> to Map<String, Object> and have the
parseKVP method recognize those and build a List of parsed object,
it’s then up to the request reader to see if it got a single object, or a list
of object, for key that have multiple potential values.

Maybe not too elegant, the alternative would be switching the kvp maps
from Map<String, String> to Map<String, String> which seems a bit
more disruptive.

I’ve attached a patch for this, with a WCS 2.0 example of how things
should be handled by a kvp reader expecting one of these multikeys.

Opinions?

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it 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

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


(attachments)

multikey.patch (12.7 KB)

Patch seems good to me. And I agree keeping value as Object rather than String seems nicer.

···

On Thu, Dec 6, 2012 at 12:35 PM, Andrea Aime <andrea.aime@anonymised.com1268…> wrote:

Hi,
so far OGC services always had used one valued keys in requests, eventually creating
some complex syntax to hold the eventual structured values inside the key.

Of course the time should have come, sooner or later, to have a service with
repeated keys with different values in the requests… WCS 2.0 is the one, behold,
subset=… three times:

http://www.myserver.org:port/path?
service=WCS
&version=2.0
&request=GetCoverage
&coverageId=C0002
&subset=lon,http://www.opengis.net/def/crs/EPSG/0/4326(-71,47)
&subset=lat,http://www.opengis.net/def/crs/EPSG/0/4326(-66,51)
&subset=t,http://www.opengis.net/def/trs/ISO-
8601/0/Gregorian+UTC(“2009-11-06T23:20:52Z”)

Now… having the dispatcher and the KVP parser handle this is not too hard,
see the attached path.

Rationale: we allow String in the dispatcher kvp maps, which switch
from Map<String, String> to Map<String, Object> and have the
parseKVP method recognize those and build a List of parsed object,
it’s then up to the request reader to see if it got a single object, or a list
of object, for key that have multiple potential values.

Maybe not too elegant, the alternative would be switching the kvp maps
from Map<String, String> to Map<String, String> which seems a bit
more disruptive.

I’ve attached a patch for this, with a WCS 2.0 example of how things
should be handled by a kvp reader expecting one of these multikeys.

Opinions?

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it 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

http://www.geo-solutions.it
http://twitter.com/geosolutions_it



LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

On Fri, Dec 7, 2012 at 6:51 AM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Patch seems good to me. And I agree keeping value as Object rather than String seems nicer.

Committed

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it 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

http://www.geo-solutions.it
http://twitter.com/geosolutions_it