Jukka & Andrea,

Thank you!

I was able to get the query from the geotools log and with a bit of
tinkering using explain was able to speed things up enough to be useful. I
also upped the timeout window at least for testing purposes.

But of course, solve one bug get another.

Let me step back and explain my overall goal and perhaps I'm going about
all wrong.

Attached is a sample map from the web app I'm building. Each red square
represents a land survey section (~1mi^2) and is colored based off a
dynamic summation of pesticide usage (user can select pesticide, time range
of summation, and a few other options).

My current solution is thus: user parameters are sent as viewparams and
inserted into the parameterized SQL to do the summation on the pesticide
table, calculate the breakpoints and color mapping based off of user choice
(3-8 color classes, a handful of classification types, and Colorbrewer2
colorramps), then join to the land survey geometry table. For colorization,
I have an SQL function that wraps R's classInt function using plr. Each
section polygon has it's own color as an attribute which is then used by a
simple SLD for styling.

All the pieces are now working together between client, geoserver, and
postgis. Unfortunately, with a real sized datasets, it seems the jenks
classification from R's classInt can't cut it: what will happen in a second
or two using quantile or equal interval drags on, possibly forever, with
jenks.

Now before I go and bug the R people, is this even a good way of going
about this using geoserver?

I see there is a way to get a custom SLD from a geoserver layer:

http://docs.geoserver.org/stable/en/user/community/sldservice/index.html

Is there anyway to do such a thing automatically so that a parameterized
sql view can have a parameterized SLD such that given the number of
classes, classification method, and colormap, geoserver would use the
summation value in the sql view to create an SLD then use that for
rendering?

The main goal is to have all the classification and styling done on the
server based on a dynamic query. I have previously made a similar web site
just using openlayers to display the vector land survey and colored it
based off a database query using client side javascript libraries. It
worked well, but was a memory hog as both the spatial layer and the
attribute data aren't small. The current project needs to be a bit lighter
weight on the client side which is why I'm trying to dump so much on
geoserver and the DB.

If I'm going about this all wrong, please let me know. Otherwise I guess it
is all about optimization, bugging the R folks, and probably disabling the
jenks option in order to sidestep the issue.

Thanks again for your help,
--Christopher
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to