[Geoserver-users] Google KML Placement Folder/List Control

Hello,
I have spent the last few days learning GeoServer and I am very impressed!

Using a mixture of MySQL and SLD I am able to have accurate control over how my data is presented.
That said, I am gearing my dataset for google earth. I would like to display say 100 taxi cabs.
I want to automatically refresh my google earth KML once every 5 seconds, and I would also like to group certain taxi cabs into a placemark folder.

My two questions
1 - Is it possible to configure GeoServer to return 1 in the KML, or must the user manually set it when adding the KML link?
2 - Can I control what items show up in the google earth places menu? Can I control the folder grouping? Can I control the icon? All the examples I have been looking at seem to have placemark names along the lines of 01, 02, 10, 14, etc. They seem to be a repetitive tree structure which confuses me further.

I have looked around and have not found answers to these questions, so if I am repeating a topic I apologize.

thank you,
Lucas

Lucas Vickers wrote:

Hello,
I have spent the last few days learning GeoServer and I am very impressed!

Using a mixture of MySQL and SLD I am able to have accurate control over how my data is presented.
That said, I am gearing my dataset for google earth. I would like to display say 100 taxi cabs.
I want to automatically refresh my google earth KML once every 5 seconds, and I would also like to group certain taxi cabs into a placemark folder.

My two questions
1 - Is it possible to configure GeoServer to return <refreshVisiblity>1</refreshVisiblity> in the KML, or must the user manually set it when adding the KML link?

Currently this functionality does not exist, but it would be fairly straightforward to add. I've created an issue (http://jira.codehaus.org/browse/GEOS-2702) in GeoServer's bug tracker for this. If you are interested, you can sign up for a JIRA account and subscribe to the watch list for updates on progress on that issue. I assumed that you meant <refreshMode>onInterval</refreshMode> rather than <refreshVisibility>1</refreshVisibility> since onInterval tells Google Earth to refresh periodically, while refreshVisibility just tells it to unhide placemarks when a networklink is refreshed. Please correct me if this assumption is wrong.

2 - Can I control what items show up in the google earth places menu? Can I control the folder grouping? Can I control the icon? All the examples I have been looking at seem to have placemark names along the lines of 01, 02, 10, 14, etc. They seem to be a repetitive tree structure which confuses me further.

This structure allows GeoServer's regionated KML to work. Unfortunately, it doesn't seem that Google Earth allows you to hide the structure of the KML, so we can't do anything about the messy folders in regionated output (except maybe provide a better name). For a dataset of only 100 points, you probably do not need regionated output, so try appending &mode=download to the URL. This will give you an unstructured document with all the placemarks in a single folder.

I have looked around and have not found answers to these questions, so if I am repeating a topic I apologize.

thank you,
Lucas

Hope this helps.
--
David Winslow
OpenGeo - http://opengeo.org/

Your assumption about is correct, I have signed up to track the feature.

Next, I think you are right I won’t need region support. Even if I am displaying 4000 units I doubt it will be a huge deal.

Let me explain in depth what I want, as I’m not sure I can achieve it in GeoServer: Again this is all for Google KML.

I would like to display X number of taxis. Say 4,000 tops.
These taxis will be grouped into two separate groups based on a database flag. Let’s say cars with issues and cars with no issue.
I would like the dispatcher to be able to have a list of placemarks in google, I want two lists: cars w/o issues, cars w/ issues.
At any point in time if a user clicks on an item within the placemark list (one of the cars), it will zoom into this item. I believe this is standard.
When the user zooms out, I will not show cars w/o issues on the map, only cars w/ issues (the cars w/ issues are ALWAYS visible).
However, I want the cars w/o issues to stay in the placemark list independent of zoom level. So I want the placemarks independent of zoom but the actual taxi visibility (on the map) dependent on zoom.

Here’s where I’m confused:

  • I do not know how I could group cars into two separate placemark lists. Would I need separate KML links for this and each just reads different data?
  • I understand how to use SLD to hide the cars w/o issues at certain zoom levels, but then I believe the item will not show up in my placemark list. Is there a way around this?
  • Can I control the icon that is displayed in the placemark list? Is the information derived from the label (point) settings or is it sometihng different?

Many thanks!

On Mon, Mar 9, 2009 at 9:10 AM, David Winslow <dwinslow@anonymised.com> wrote:

Lucas Vickers wrote:

Hello,
I have spent the last few days learning GeoServer and I am very impressed!

Using a mixture of MySQL and SLD I am able to have accurate control over how my data is presented.
That said, I am gearing my dataset for google earth. I would like to display say 100 taxi cabs.
I want to automatically refresh my google earth KML once every 5 seconds, and I would also like to group certain taxi cabs into a placemark folder.

My two questions
1 - Is it possible to configure GeoServer to return 1 in the KML, or must the user manually set it when adding the KML link?

Currently this functionality does not exist, but it would be fairly straightforward to add. I’ve created an issue (http://jira.codehaus.org/browse/GEOS-2702) in GeoServer’s bug tracker for this. If you are interested, you can sign up for a JIRA account and subscribe to the watch list for updates on progress on that issue. I assumed that you meant onInterval rather than 1 since onInterval tells Google Earth to refresh periodically, while refreshVisibility just tells it to unhide placemarks when a networklink is refreshed. Please correct me if this assumption is wrong.

2 - Can I control what items show up in the google earth places menu? Can I control the folder grouping? Can I control the icon? All the examples I have been looking at seem to have placemark names along the lines of 01, 02, 10, 14, etc. They seem to be a repetitive tree structure which confuses me further.

This structure allows GeoServer’s regionated KML to work. Unfortunately, it doesn’t seem that Google Earth allows you to hide the structure of the KML, so we can’t do anything about the messy folders in regionated output (except maybe provide a better name). For a dataset of only 100 points, you probably do not need regionated output, so try appending &mode=download to the URL. This will give you an unstructured document with all the placemarks in a single folder.

I have looked around and have not found answers to these questions, so if I am repeating a topic I apologize.

thank you,
Lucas

Hope this helps.

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

Lucas Vickers wrote:

Your assumption about <refreshVisibility> is correct, I have signed up to track the feature.

Next, I think you are right I won't need region support. Even if I am displaying 4000 units I doubt it will be a huge deal.

Let me explain in depth what I want, as I'm not sure I can achieve it in GeoServer: Again this is all for Google KML.

I would like to display X number of taxis. Say 4,000 tops. These taxis will be grouped into two separate groups based on a database flag. Let's say cars with issues and cars with no issue.
I would like the dispatcher to be able to have a list of placemarks in google, I want two lists: cars w/o issues, cars w/ issues.
At any point in time if a user clicks on an item within the placemark list (one of the cars), it will zoom into this item. I believe this is standard.
When the user zooms out, I will not show cars w/o issues on the map, only cars w/ issues (the cars w/ issues are ALWAYS visible).
However, I want the cars w/o issues to stay in the placemark list independent of zoom level. So I want the placemarks independent of zoom but the actual taxi visibility (on the map) dependent on zoom.

Here's where I'm confused:
- I do not know how I could group cars into two separate placemark lists. Would I need separate KML links for this and each just reads different data?

No. You can get a single KML document that links to multiple datasets from GeoServer's KML reflector simply by adding multiple layers (comma-separated) to the layers parameter in the URL. For example, if taxi:okay and taxi:withissues are your two layers, then the non-regionated link would be http://localhost:8080/geoserver/wms/kml?layers=taxi:okay,taxi:withissues&mode=download . You may find it more convenient to do this with a Postgres view, so that you can move features between the two featuretypes just by modifying an attribute of the data.

- I understand how to use SLD to hide the cars w/o issues at certain zoom levels, but then I believe the item will not show up in my placemark list. Is there a way around this?

Well, KML is a special case with regard to zoom levels, because GeoServer doesn't know how big your Google Earth window is (and our style translator doesn't encode the scale denominators so that Google Earth can understand them, although that would be a nice feature, and doable using a similar technique to the one used in regionated output). You shouldn't rely on zoom levels in KML output, at least for now. The best workaround I can come up with right now is to have the two groups of taxis in separate folders, as described above, and manually toggling the unwanted list.

- Can I control the icon that is displayed in the placemark list? Is the information derived from the label (point) settings or is it sometihng different?

For features, yes. I don't believe it is possible to customize the actual folder icon, and GeoServer itself definitely does not currently support that.

Many thanks!

On Mon, Mar 9, 2009 at 9:10 AM, David Winslow <dwinslow@anonymised.com <mailto:dwinslow@anonymised.com>> wrote:

    Lucas Vickers wrote:

        Hello,
        I have spent the last few days learning GeoServer and I am
        very impressed!

        Using a mixture of MySQL and SLD I am able to have accurate
        control over how my data is presented.
        That said, I am gearing my dataset for google earth. I would
        like to display say 100 taxi cabs.
        I want to automatically refresh my google earth KML once every
        5 seconds, and I would also like to group certain taxi cabs
        into a placemark folder.

        My two questions
        1 - Is it possible to configure GeoServer to return
        <refreshVisiblity>1</refreshVisiblity> in the KML, or must the
        user manually set it when adding the KML link?

    Currently this functionality does not exist, but it would be
    fairly straightforward to add. I've created an issue
    (http://jira.codehaus.org/browse/GEOS-2702) in GeoServer's bug
    tracker for this. If you are interested, you can sign up for a
    JIRA account and subscribe to the watch list for updates on
    progress on that issue. I assumed that you meant
    <refreshMode>onInterval</refreshMode> rather than
    <refreshVisibility>1</refreshVisibility> since onInterval tells
    Google Earth to refresh periodically, while refreshVisibility just
    tells it to unhide placemarks when a networklink is refreshed.
     Please correct me if this assumption is wrong.

        2 - Can I control what items show up in the google earth
        places menu? Can I control the folder grouping? Can I
        control the icon? All the examples I have been looking at
        seem to have placemark names along the lines of 01, 02, 10,
        14, etc. They seem to be a repetitive tree structure which
        confuses me further.

    This structure allows GeoServer's regionated KML to work.
     Unfortunately, it doesn't seem that Google Earth allows you to
    hide the structure of the KML, so we can't do anything about the
    messy folders in regionated output (except maybe provide a better
    name). For a dataset of only 100 points, you probably do not need
    regionated output, so try appending &mode=download to the URL.
     This will give you an unstructured document with all the
    placemarks in a single folder.

        I have looked around and have not found answers to these
        questions, so if I am repeating a topic I apologize.

        thank you,
        Lucas

    Hope this helps.
    --
    David Winslow
    OpenGeo - http://opengeo.org/

  • I understand how to use SLD to hide the cars w/o issues at certain zoom levels, but then I believe the item will not show up in my placemark list. Is there a way around this?

Well, KML is a special case with regard to zoom levels, because GeoServer doesn’t know how big your Google Earth window is (and our style translator doesn’t encode the scale denominators so that Google Earth can understand them, although that would be a nice feature, and doable using a similar technique to the one used in regionated output). You shouldn’t rely on zoom levels in KML output, at least for now. The best workaround I can come up with right now is to have the two groups of taxis in separate folders, as described above, and manually toggling the unwanted list.

I just reviewed a handbook on KML and there is a tag for and .
Could this be utilized to have certain layers be drawn or hidden depending on the google earth view size?

I think you are right allowing the user to simply select or de-select some features would work, but I am just curious.

Lucas

On Tue, 2009-03-10 at 15:53 -0400, Lucas Vickers wrote:

                - I understand how to use SLD to hide the cars w/o
                issues at certain zoom levels, but then I believe the
                item will not show up in my placemark list. Is there
                a way around this?
        Well, KML is a special case with regard to zoom levels,
        because GeoServer doesn't know how big your Google Earth
        window is (and our style translator doesn't encode the scale
        denominators so that Google Earth can understand them,
        although that would be a nice feature, and doable using a
        similar technique to the one used in regionated output). You
        shouldn't rely on zoom levels in KML output, at least for
        now. The best workaround I can come up with right now is to
        have the two groups of taxis in separate folders, as described
        above, and manually toggling the unwanted list.

I just reviewed a handbook on KML and there is a tag for
<minLodPixels> and <maxLodPixels>.
Could this be utilized to have certain layers be drawn or hidden
depending on the google earth view size?

I think you are right allowing the user to simply select or de-select
some features would work, but I am just curious.

Lucas

Yes, minLodPixels and maxLodPixels are the 'similar technique to the one
used in regionated output' to which I referred in my last email.
GeoServer does not have any support for customizing this (it is either
omitted entirely in download mode or automatically generated in
regionating mode), but it should be fairly straightforward to make a
document that does what you need, if you don't mind getting your hands a
bit dirty with a text editor. Save the document generated by the KML
transformer and associate the min/maxLodPixels with the layer that you
want to hide.

Hope this helps.

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

I am using dynamic data, so that wouldn't work. I will keep my eyes
out for any future updates.

Thanks

On 3/10/09, David Winslow <dwinslow@anonymised.com> wrote:

On Tue, 2009-03-10 at 15:53 -0400, Lucas Vickers wrote:

                - I understand how to use SLD to hide the cars w/o
                issues at certain zoom levels, but then I believe the
                item will not show up in my placemark list. Is there
                a way around this?
        Well, KML is a special case with regard to zoom levels,
        because GeoServer doesn't know how big your Google Earth
        window is (and our style translator doesn't encode the scale
        denominators so that Google Earth can understand them,
        although that would be a nice feature, and doable using a
        similar technique to the one used in regionated output). You
        shouldn't rely on zoom levels in KML output, at least for
        now. The best workaround I can come up with right now is to
        have the two groups of taxis in separate folders, as described
        above, and manually toggling the unwanted list.

I just reviewed a handbook on KML and there is a tag for
<minLodPixels> and <maxLodPixels>.
Could this be utilized to have certain layers be drawn or hidden
depending on the google earth view size?

I think you are right allowing the user to simply select or de-select
some features would work, but I am just curious.

Lucas

Yes, minLodPixels and maxLodPixels are the 'similar technique to the one
used in regionated output' to which I referred in my last email.
GeoServer does not have any support for customizing this (it is either
omitted entirely in download mode or automatically generated in
regionating mode), but it should be fairly straightforward to make a
document that does what you need, if you don't mind getting your hands a
bit dirty with a text editor. Save the document generated by the KML
transformer and associate the min/maxLodPixels with the layer that you
want to hide.

Hope this helps.

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

You should be able create a KML document that uses auto-refreshing
networklinks to the flat files. The KML returned when you use
mode=refresh should be pretty close to what you need; just replace
onStop with onInterval and change the links to point at the flat-file
version of the KML layers you want.

Hope this helps.

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

On Tue, 2009-03-10 at 20:54 -0400, Lucas Vickers wrote:

I am using dynamic data, so that wouldn't work. I will keep my eyes
out for any future updates.

Thanks

On 3/10/09, David Winslow <dwinslow@anonymised.com> wrote:
> On Tue, 2009-03-10 at 15:53 -0400, Lucas Vickers wrote:
>>
>>
>> - I understand how to use SLD to hide the cars w/o
>> issues at certain zoom levels, but then I believe the
>> item will not show up in my placemark list. Is there
>> a way around this?
>> Well, KML is a special case with regard to zoom levels,
>> because GeoServer doesn't know how big your Google Earth
>> window is (and our style translator doesn't encode the scale
>> denominators so that Google Earth can understand them,
>> although that would be a nice feature, and doable using a
>> similar technique to the one used in regionated output). You
>> shouldn't rely on zoom levels in KML output, at least for
>> now. The best workaround I can come up with right now is to
>> have the two groups of taxis in separate folders, as described
>> above, and manually toggling the unwanted list.
>>
>> I just reviewed a handbook on KML and there is a tag for
>> <minLodPixels> and <maxLodPixels>.
>> Could this be utilized to have certain layers be drawn or hidden
>> depending on the google earth view size?
>>
>> I think you are right allowing the user to simply select or de-select
>> some features would work, but I am just curious.
>>
>> Lucas
>
> Yes, minLodPixels and maxLodPixels are the 'similar technique to the one
> used in regionated output' to which I referred in my last email.
> GeoServer does not have any support for customizing this (it is either
> omitted entirely in download mode or automatically generated in
> regionating mode), but it should be fairly straightforward to make a
> document that does what you need, if you don't mind getting your hands a
> bit dirty with a text editor. Save the document generated by the KML
> transformer and associate the min/maxLodPixels with the layer that you
> want to hide.
>
> Hope this helps.
>
> --
> David Winslow
> OpenGeo - http://opengeo.org/
>
>