Creating datasources on the fly for each request is likely to not be very
performant.
Here's a couple of alterrnative ideas, one relatively easy, and one harder:
1. You can use SQL functions and operations in the select list columns. So
you might be able to use regex pattern matching and string extraction to
extract the required numeric value from the data_field (with the extraction
expression parameterized by the key string). The syntax will vary
depending on what database you're using and what it provides in the way of
regex functions. If there is no built-in function to do this, you might
still be able to do it using a custom stored procedure.
2. You could use a filter function in the SLD along with SLD variable
substitution to extract the required value part of the data_field in order
to use it to control styling. Unfortunately there is no regex "extract"
function currently in GeoServer, so this would have to be developed. This
is quite possible if you have some Java skills.
On Wed, May 30, 2012 at 4:41 AM, pere roca ristol <pero...@gmail.com> wrote:
> hello,
>
> I have a table with a structure like this:
>
> geom_field data_field
>
> geometry1 data1+100||data2+300||data3+200
> geometry2 data1+100||data2+500
>
> I want users to interactively filter data_field containing data2 (for
> example) and get it symbolized according it's number (300)
>
> What first came in mind is to parse the request in server-side and insert
> the results in a new temporal table or view. The same applies for a new SLD
> (containing Filter with data2 and Symbology depending on the new field in
> this new table)
>
> Then I discovered Geoserver SQL Views, where I can do something like
> "select the_geom, data from mytable where data ilike '%param%'
>
> It works fine to get the geometry, but the big problem is the
> symbolization of each geometry. Even if I create the SLD server-side
> (exploding the data_field and retrieveng 300 and 500 for data2) , the
> problem remains because of evident reasons (just to start, GeoServer cannot
> read data_field as a number).
>
> So, if nobody can see beyond I think I should discard this solution...
>
> I can easily create a CSV (and/or .shp) at each request. But I absolutely
> have to create the datasource in Geoserver before trying to visualize it,
> right?
>
> if you think this can be a good solution, how can I do it on the fly (i
> mean the registration of this new datasource)? will it keep performant at
> multiple requests? it makes sense?
>
> thanks in advance,
>
> Pere
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
--
Martin Davis
OpenGeo - http://opengeo.org
Expert service straight from the developers.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users