[Geoserver-users] Customize Google Earth Attribute Display

Hi, I'm a new user of Geoserver and am interested in using it to feed
streaming KML data to Google Earth. My question concerns how to modify or
edit how the attribute data is displayed in google earth upon clicking on
a placemarker. Geoserver's KML output automatically displays the
attribute data from the datasource as a table. Is there a way to edit
this display to display other information than just raw attribute data.
In particular, I would like to build a URL from one of the attribute data
columns and display it as a link within the description bubble, along with
some custom text. Is this possible?

Thanks,

David

It is possible, but not in an easy way: you will have to modify the actual code itself.
The class that writes out the description information is the KMLWriter.java class
In the future we might be able to make the output a little more robust by allowing the user to supply a KML template file for each layer, that will format the output of the data.
One thing you could do is add an extra column to your dataset that is a link:
<a href="example.com">link</a>

A pretty big hack, but it will work for now.

Brent Owens
(The Open Planning Project)

david@anonymised.com wrote:

Hi, I'm a new user of Geoserver and am interested in using it to feed
streaming KML data to Google Earth. My question concerns how to modify or
edit how the attribute data is displayed in google earth upon clicking on
a placemarker. Geoserver's KML output automatically displays the
attribute data from the datasource as a table. Is there a way to edit
this display to display other information than just raw attribute data. In particular, I would like to build a URL from one of the attribute data
columns and display it as a link within the description bubble, along with
some custom text. Is this possible?

Thanks,

David

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Brent Owens ha scritto:

It is possible, but not in an easy way: you will have to modify the actual code itself.
The class that writes out the description information is the KMLWriter.java class
In the future we might be able to make the output a little more robust by allowing the user to supply a KML template file for each layer, that will format the output of the data.
One thing you could do is add an extra column to your dataset that is a link:
<a href="example.com">link</a>

A pretty big hack, but it will work for now.

Another way would be to allow people to define feature type overrides by
means of Expression, so that you could put togheter something like:
linkAtt = strcat("<a href=\"", urlAtt, "\">", displayAtt, "</a>")

that would require the complex data store I guess, so I guess it's something we'll be able to do in the next few months.
Cheers
Andrea