[Geoserver-users] Dynamic symbolizers plus google charts?

I just got an interesting query:

'I am trying to understand what the dynamics are in terms of KML output, I have seen the templates and integration with geo search which is really great. Being able to incorporate things like Google Charts and Visualization API would be enormously powerful. Is that something that could be 'hacked' already or would it require major coding?! Any ideas in that direction?! '

It seems like the chart api might work out with dynamic symbolizers? http://code.google.com/apis/chart/

A call is like http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World

Can the dynamic symbolizer put in multiple feature attributes?

Seems like this could be very powerful - worth a blog post and some docs if we can get it working.

I think the visualization api might be a bit much, it seems to mostly be javascript calls.

C

--
Chris Holmes
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Chris Holmes wrote:

I just got an interesting query:

'I am trying to understand what the dynamics are in terms of KML output, I have seen the templates and integration with geo search which is really great. Being able to incorporate things like Google Charts and Visualization API would be enormously powerful. Is that something that could be 'hacked' already or would it require major coding?! Any ideas in that direction?! '

It seems like the chart api might work out with dynamic symbolizers? http://code.google.com/apis/chart/

A call is like http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World

Can the dynamic symbolizer put in multiple feature attributes?

Sure it can. I actually had charts in my mind but was considering doing
a local chart server powered by JFreeChart for performance reasons.
Anyways, if you factor in KML, doing a remote call per symbol is not
actually an issue, you'd have to make one anyways.

But in KML you'll want to make a custom implementation of the dynamic
symbolizer handling so that no actual image is grabbed from Google,
but only a URL gets built.
To have the same work in a raster WMS request we'd have to actually
fetch the remote chart, which is then cached in a _not_so_smart way
(no cache expire, no cache size limits), so beyond the first remote
calls we'd have no big performance issues, but start having memory
exhaustion issues if a lot of charts are generated.

Another angle to consider is where the data is coming from. The simple
case of having all the data in your feature is accounted for using
dynamic symbolizers the way you suggested above.
The case in which the actual chart data is sitting in another table
is not, and would require setting up a separate chart server that
can be configured to get the data given a key: imaging having a table
of population gender distribution per county, keyed by county, and
you want to make a chart per county. In that case you need
to configure the chart server to know there is a table
genderdistro(county, male, female), and that one can make charts
out of it given a county key. Or one can have a racedistro(county, race, count) that has multiple race records per county, and want to make
a chart out of it.

That would require some more work, but it's definitely doable.
Cheers
Andrea

Just an update, David Winslow got this working with KML, and has a patch on his computer. If there is of interest he could attach the patch to a jira issue. It looks like it won't get in for 1.7.3, but should be in nightlies after that gets tagged.

Hopefully we'll get a blog post and some docs on how to use it relatively soon. But his quick demo was pretty awesome, pulling charts from the charts api directly in to the KML.

Andrea Aime wrote:

Chris Holmes wrote:

I just got an interesting query:

'I am trying to understand what the dynamics are in terms of KML output, I have seen the templates and integration with geo search which is really great. Being able to incorporate things like Google Charts and Visualization API would be enormously powerful. Is that something that could be 'hacked' already or would it require major coding?! Any ideas in that direction?! '

It seems like the chart api might work out with dynamic symbolizers? http://code.google.com/apis/chart/

A call is like http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World

Can the dynamic symbolizer put in multiple feature attributes?

Sure it can. I actually had charts in my mind but was considering doing
a local chart server powered by JFreeChart for performance reasons.
Anyways, if you factor in KML, doing a remote call per symbol is not
actually an issue, you'd have to make one anyways.

But in KML you'll want to make a custom implementation of the dynamic
symbolizer handling so that no actual image is grabbed from Google,
but only a URL gets built.
To have the same work in a raster WMS request we'd have to actually
fetch the remote chart, which is then cached in a _not_so_smart way
(no cache expire, no cache size limits), so beyond the first remote
calls we'd have no big performance issues, but start having memory
exhaustion issues if a lot of charts are generated.

Another angle to consider is where the data is coming from. The simple
case of having all the data in your feature is accounted for using
dynamic symbolizers the way you suggested above.
The case in which the actual chart data is sitting in another table
is not, and would require setting up a separate chart server that
can be configured to get the data given a key: imaging having a table
of population gender distribution per county, keyed by county, and
you want to make a chart per county. In that case you need
to configure the chart server to know there is a table
genderdistro(county, male, female), and that one can make charts
out of it given a county key. Or one can have a racedistro(county, race, count) that has multiple race records per county, and want to make
a chart out of it.

That would require some more work, but it's definitely doable.
Cheers
Andrea

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Chris Holmes
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Indeed, sorry I didn't reply to this thread sooner. The charts
definitely suffer a bit from having to fetch so many different images
before the map can be rendered, but using dynamic symbolizers in PNG
output works nicely. Interestingly enough, KML embeds direct references
to the images, so it doesn't suffer from the overhead of having to
actually fetch the chart images. I'll write a blog post with some
performance tips in a few days.

As Chris mentioned, there's already a patch on my hard drive just
waiting for the release. Interested parties should watch JIRA issue
#2670 (http://jira.codehaus.org/browse/GEOS-2670). There's a patch
there already, but it wasn't quite enough to fix the issue. I'll attach
the real fix when I get back to the office tomorrow morning.

--
David Winslow
OpenGeo - http://opengeo.org/

On Mon, 2009-03-02 at 22:32 -0500, Chris Holmes wrote:

Just an update, David Winslow got this working with KML, and has a patch
on his computer. If there is of interest he could attach the patch to a
jira issue. It looks like it won't get in for 1.7.3, but should be in
nightlies after that gets tagged.

Hopefully we'll get a blog post and some docs on how to use it
relatively soon. But his quick demo was pretty awesome, pulling charts
from the charts api directly in to the KML.

Andrea Aime wrote:
> Chris Holmes wrote:
>> I just got an interesting query:
>>
>> 'I am trying to understand what the dynamics are in terms of KML output,
>> I have seen the templates and integration with geo search which is
>> really great. Being able to incorporate things like Google Charts and
>> Visualization API would be enormously powerful. Is that something that
>> could be 'hacked' already or would it require major coding?! Any ideas
>> in that direction?! '
>>
>> It seems like the chart api might work out with dynamic symbolizers?
>> http://code.google.com/apis/chart/
>>
>> A call is like
>> http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World
>>
>> Can the dynamic symbolizer put in multiple feature attributes?
>
> Sure it can. I actually had charts in my mind but was considering doing
> a local chart server powered by JFreeChart for performance reasons.
> Anyways, if you factor in KML, doing a remote call per symbol is not
> actually an issue, you'd have to make one anyways.
>
> But in KML you'll want to make a custom implementation of the dynamic
> symbolizer handling so that no actual image is grabbed from Google,
> but only a URL gets built.
> To have the same work in a raster WMS request we'd have to actually
> fetch the remote chart, which is then cached in a _not_so_smart way
> (no cache expire, no cache size limits), so beyond the first remote
> calls we'd have no big performance issues, but start having memory
> exhaustion issues if a lot of charts are generated.
>
> Another angle to consider is where the data is coming from. The simple
> case of having all the data in your feature is accounted for using
> dynamic symbolizers the way you suggested above.
> The case in which the actual chart data is sitting in another table
> is not, and would require setting up a separate chart server that
> can be configured to get the data given a key: imaging having a table
> of population gender distribution per county, keyed by county, and
> you want to make a chart per county. In that case you need
> to configure the chart server to know there is a table
> genderdistro(county, male, female), and that one can make charts
> out of it given a county key. Or one can have a racedistro(county, race,
> count) that has multiple race records per county, and want to make
> a chart out of it.
>
> That would require some more work, but it's definitely doable.
> Cheers
> Andrea
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Chris Holmes
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

I just updated the ticket with a better patch.

--
David Winslow
OpenGeo - http://opengeo.org/

On Mon, 2009-03-02 at 23:13 -0500, David Winslow wrote:

Indeed, sorry I didn't reply to this thread sooner. The charts
definitely suffer a bit from having to fetch so many different images
before the map can be rendered, but using dynamic symbolizers in PNG
output works nicely. Interestingly enough, KML embeds direct references
to the images, so it doesn't suffer from the overhead of having to
actually fetch the chart images. I'll write a blog post with some
performance tips in a few days.

As Chris mentioned, there's already a patch on my hard drive just
waiting for the release. Interested parties should watch JIRA issue
#2670 (http://jira.codehaus.org/browse/GEOS-2670). There's a patch
there already, but it wasn't quite enough to fix the issue. I'll attach
the real fix when I get back to the office tomorrow morning.

--
David Winslow
OpenGeo - http://opengeo.org/

On Mon, 2009-03-02 at 22:32 -0500, Chris Holmes wrote:
> Just an update, David Winslow got this working with KML, and has a patch
> on his computer. If there is of interest he could attach the patch to a
> jira issue. It looks like it won't get in for 1.7.3, but should be in
> nightlies after that gets tagged.
>
> Hopefully we'll get a blog post and some docs on how to use it
> relatively soon. But his quick demo was pretty awesome, pulling charts
> from the charts api directly in to the KML.
>
> Andrea Aime wrote:
> > Chris Holmes wrote:
> >> I just got an interesting query:
> >>
> >> 'I am trying to understand what the dynamics are in terms of KML output,
> >> I have seen the templates and integration with geo search which is
> >> really great. Being able to incorporate things like Google Charts and
> >> Visualization API would be enormously powerful. Is that something that
> >> could be 'hacked' already or would it require major coding?! Any ideas
> >> in that direction?! '
> >>
> >> It seems like the chart api might work out with dynamic symbolizers?
> >> http://code.google.com/apis/chart/
> >>
> >> A call is like
> >> http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World
> >>
> >> Can the dynamic symbolizer put in multiple feature attributes?
> >
> > Sure it can. I actually had charts in my mind but was considering doing
> > a local chart server powered by JFreeChart for performance reasons.
> > Anyways, if you factor in KML, doing a remote call per symbol is not
> > actually an issue, you'd have to make one anyways.
> >
> > But in KML you'll want to make a custom implementation of the dynamic
> > symbolizer handling so that no actual image is grabbed from Google,
> > but only a URL gets built.
> > To have the same work in a raster WMS request we'd have to actually
> > fetch the remote chart, which is then cached in a _not_so_smart way
> > (no cache expire, no cache size limits), so beyond the first remote
> > calls we'd have no big performance issues, but start having memory
> > exhaustion issues if a lot of charts are generated.
> >
> > Another angle to consider is where the data is coming from. The simple
> > case of having all the data in your feature is accounted for using
> > dynamic symbolizers the way you suggested above.
> > The case in which the actual chart data is sitting in another table
> > is not, and would require setting up a separate chart server that
> > can be configured to get the data given a key: imaging having a table
> > of population gender distribution per county, keyed by county, and
> > you want to make a chart per county. In that case you need
> > to configure the chart server to know there is a table
> > genderdistro(county, male, female), and that one can make charts
> > out of it given a county key. Or one can have a racedistro(county, race,
> > count) that has multiple race records per county, and want to make
> > a chart out of it.
> >
> > That would require some more work, but it's definitely doable.
> > Cheers
> > Andrea
> >
> > ------------------------------------------------------------------------------
> > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> > -Strategies to boost innovation and cut costs with open source participation
> > -Receive a $600 discount off the registration fee with the source code: SFAD
> > http://p.sf.net/sfu/XcvMzF8H
> > _______________________________________________
> > Geoserver-users mailing list
> > Geoserver-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
> --
> Chris Holmes
> OpenGeo - http://opengeo.org
> Expert service straight from the developers.
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
David Winslow
OpenGeo - http://opengeo.org/

Chris Holmes wrote:

Just an update, David Winslow got this working with KML, and has a patch on his computer. If there is of interest he could attach the patch to a jira issue. It looks like it won't get in for 1.7.3, but should be in nightlies after that gets tagged.

Hopefully we'll get a blog post and some docs on how to use it relatively soon. But his quick demo was pretty awesome, pulling charts from the charts api directly in to the KML.

I'm interested in looking into this one and make it usable for normal
WMS as well. I won't be fast during the first requests, and probably
will use too much memory afterwards, but it's a start.

Cheers
Andrea

David Winslow wrote:

Indeed, sorry I didn't reply to this thread sooner. The charts
definitely suffer a bit from having to fetch so many different images
before the map can be rendered, but using dynamic symbolizers in PNG
output works nicely.

Deh, sorry, right, it's just a remote png in the end, so it works
with PNG out of the box. Still haven't got enough caffeine running
thru my veins this morning

Cheers
Andrea