Thanks for taking these ideas to the email list for discussion - much
easier to design up front.

   - Your goal was to have "more"  "better" view parameters :)
   - To keep with the style of WMS it is good to use position (order)
   rather than a layer name
   - Encoding XML or JSON reduces readability of the URL a lot...


XML ... allows for more complex value definitions - but still has a limit
on reserved characters - it is just different reserved characters :) The
same thing for JSON.

How do you plan to look ahead when parsing KVP? Presently the KVP
processing tends to split on "*&*"

Existing format is:

viewparams=p1:v1;p2:v2,p1:v2;p2:v3

Your escaped example is:

&viewparams=mnsi:538008302\,244060802\,538008505,mnsi:22\,44,csvInput:acv\,rrp\;1\,0\;0\,7\;22\,1&bbox=

Is it worth using a naming convention "viewparam-<name>="

&viewparam-mnsi=538008302\,244060802\,538008505,22\,44,&viewparam-csvInput=,,acv\,rrp\;1\,0\;0\,7\;22\,1=&bbox

Unfortunately "," is established as the separator for all the other
parameters (styles= etc...) so it is hard to avoid escaping that.  I think
you could do better to support | rather than (or <P> </P> <P/>)

&viewparam-mnsi=538008302,244060802,538008505|22,44|&viewparam-csvInput=||acv,rrp;1,0;0,7;22,1=&bbox




--
Jody Garnett


On Jul 8, 2022 at 11:51:42 AM, Jody Garnett <jody.garn...@gmail.com> wrote:

> Considering Andrea's feedback on using position rather than layer name:
> 130 characters
>
>
> <mnsi>538008302,244060802,538008505</mnsi><mnsi>22,44</mnsi><mnsi/><csvInput/><csvInput/><csvInput>acv,rrp;1,0;0,7;22,1</csvInput>
>
> Or json-lite: 85 chracters
>
>
> {mnsi:['538008302,244060802,538008505','22,44',],csvInput:[,,'acv,rrp;1,0;0,7;22,1']}
>
> Or json-quote: 95
>
>
> {'mnsi':['538008302,244060802,538008505','22,44',''],'csvInput':['','','acv,rrp;1,0;0,7;22,1']}
>
> The quoting of " and ' in a URL will make any of these hard to read so I
> encourage us to figure out any other approach.
> --
> Jody Garnett
>
>
> On Jul 8, 2022 at 11:38:07 AM, Jody Garnett <jody.garn...@gmail.com>
> wrote:
>
>> If XML is really not earning its keep switch to json or similar that
>> preserves nesting: 110
>>
>>
>> {Layer1:{mnsi:'538008302,244060802,538008505'},Layer2:{mnsi:'22,44'},Layer3:{csvInput:'acv,rrp;1,0;0,7;22,1'}}
>>
>> Even adding quotes: 122
>>
>>
>> {'Layer1':{'mnsi':'538008302,244060802,538008505'},'Layer2':{'mnsi':'22,44'},'Layer3':{'csvInput':'acv,rrp;1,0;0,7;22,1'}}
>>
>> Or if you love XML treat it like the maven properties (not able to
>> validate but succinct): 152
>>
>>
>> <Layer1><mnsi>538008302,244060802,538008505</mnsi></Layer1><Layer2><mnsi>22,44</mnsi></Layer1><Layer3><csvInput>acv,rrp;1,0;0,7;22,1</csvInput></Layer3>
>>
>> --
>> Jody Garnett
>>
>>
>> On Jul 8, 2022 at 11:21:15 AM, Jody Garnett <jody.garn...@gmail.com>
>> wrote:
>>
>>> The XML most often cited downside is verbosity, and the above is already
>>>>> 250 chars. URLs have a practical size limit of 2000 chars
>>>>> <https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers>,
>>>>> adding a few more params in there (or other request parameters) and you'll
>>>>> quickly get to the maximum... at which point you can still do the request,
>>>>> but it's going to have to switch to a POST request with form-url-encoded
>>>>> body.
>>>>>
>>>>
>>>> Right, I guess for complex use cases switch to POST encoding will need
>>>> to be done anyway, that say, we could shorten a bit the syntax:
>>>> <L n="Layer1"><P n="mmsi">538008302,244060802,538008505</P></L><L
>>>> name="Layer3"><Parameter name="mmsi">22,44</P></L><L name="Layer6"><P
>>>> name="csvInput">acv,rrp;1,0;0,7;22,1</P></L>
>>>>
>>>> From 250 to 180.
>>>>
>>>
>>> I though for a moment you were just saving typing in email until you
>>> provided a character count.
>>>
>>> If you reached the level of  proposing shortening the tag names to save
>>> characters; if that is your challenge it is time to make the POST request.
>>> Or accept a different protocol (ogcapi is needed for your use case).
>>>
>>>
>>>
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to