[Geoserver-users] Modifying kml attributes output format?

Hello all. I'm fairly new to GeoServer, but have
successfully been generating a KML stream to Google
Earth from a MySQL data store. I'd like to change the
attribute formatting that controls how attributes are
displayed in the Google Earth 'balloons' that appear
when one clicks a point location.

I'd like output KML to look a lot more like this:

       <Placemark>
         <name>Chimney Pic Area</name>
         <description><![CDATA[<a
href="http://www.myserver.com/mypage.htm&quot;&gt;More
information for this site</a>]]></description>
         <styleUrl>#Precipitation</styleUrl>
         <Point>
           <extrude>0</extrude>
          
<altitudeMode>clampedToGround</altitudeMode>
           <coordinates>
             -83.4933333455682,35.6372222138291,0
           </coordinates>
         </Point>
       </Placemark>

How difficult would it be to make GeoServer provide
output in this type of format rather than the default
output format? I have absolutely no java experience,
but will be ready to give it a shot. Consequently,
the more detailed your response, the better! Ideally,
you'd be able to give me the code or a .jar to do
this. But I'm open to all responses, of course.

Thanks for all of your help!

Alex Z
Knoxville, TN, USA

____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

Hi Alex,

So it looks like you have a specific style you want to use? I don't
believe it is possible to specify styles in kml directly in GeoServer.
The style in a kml output is generated from the SLD style configured in
GeoServer. More info here:

http://docs.codehaus.org/display/GEOSDOC/1.3+Style+Your+Map

I am not sure if the capabilities of SLD cover all that is capable in
KML, like the "extrude" element for example.

If you are interested in looking at code i suggest you set up a
development environment as described here:

http://docs.codehaus.org/display/GEOSDOC/Developers+Guide

The package you want to look at is
"org.vfny.geoserver.wms.responses.map.kml". Here is the link directly in
the subversion repository.

http://svn.codehaus.org/geoserver/trunk/geoserver/wms/src/main/java/org/vfny/geoserver/wms/responses/map/kml/

-Justin

Alex Zendel wrote:

Hello all. I'm fairly new to GeoServer, but have
successfully been generating a KML stream to Google
Earth from a MySQL data store. I'd like to change the
attribute formatting that controls how attributes are
displayed in the Google Earth 'balloons' that appear
when one clicks a point location.

I'd like output KML to look a lot more like this:

       <Placemark>
         <name>Chimney Pic Area</name>
         <description><![CDATA[<a
href="http://www.myserver.com/mypage.htm&quot;&gt;More
information for this site</a>]]></description>
         <styleUrl>#Precipitation</styleUrl>
         <Point>
           <extrude>0</extrude>
          
<altitudeMode>clampedToGround</altitudeMode>
           <coordinates>
             -83.4933333455682,35.6372222138291,0
           </coordinates>
         </Point>
       </Placemark>

How difficult would it be to make GeoServer provide
output in this type of format rather than the default
output format? I have absolutely no java experience,
but will be ready to give it a shot. Consequently,
the more detailed your response, the better! Ideally,
you'd be able to give me the code or a .jar to do
this. But I'm open to all responses, of course.

Thanks for all of your help!

Alex Z
Knoxville, TN, USA

____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

-------------------------------------------------------------------------
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

!DSPAM:1004,45e1c50e215071995013331!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Currently there is no way to format the description that is returned back for each feature. All that you can style right now is how the geometry looks (size, color, opacity) and the label on the geometry. You can take a look at the java code that Justin pointed you at. In the file, just search for the line containing "<![CDATA[", that is where it goes through all the attributes of the feature and fills in the description information. You can just replace it with your own html link and it should work.

We have talked before about making it easier for people to customize how the geometry's description looks, and I think that it would be really useful to add that in.

Brent Owens
(The Open Planning Project)

Alex Zendel wrote:

Hello all. I'm fairly new to GeoServer, but have
successfully been generating a KML stream to Google
Earth from a MySQL data store. I'd like to change the
attribute formatting that controls how attributes are
displayed in the Google Earth 'balloons' that appear
when one clicks a point location.

I'd like output KML to look a lot more like this:

       <Placemark>
         <name>Chimney Pic Area</name>
         <description><![CDATA[<a
href="http://www.myserver.com/mypage.htm&quot;&gt;More
information for this site</a>]]></description>
         <styleUrl>#Precipitation</styleUrl>
         <Point>
           <extrude>0</extrude>
          <altitudeMode>clampedToGround</altitudeMode>
           <coordinates>
             -83.4933333455682,35.6372222138291,0
           </coordinates>
         </Point>
       </Placemark>

How difficult would it be to make GeoServer provide output in this type of format rather than the default
output format? I have absolutely no java experience,
but will be ready to give it a shot. Consequently,
the more detailed your response, the better! Ideally,
you'd be able to give me the code or a .jar to do
this. But I'm open to all responses, of course.

Thanks for all of your help!

Alex Z
Knoxville, TN, USA

____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

-------------------------------------------------------------------------
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:

We have talked before about making it easier for people to customize how the geometry's description looks, and I think that it would be really useful to add that in.

This seems somewhat related to http://jira.codehaus.org/browse/GEOS-836, that is, a templating engine would be useful here too.

Cheers
Andrea

Yep pretty much the same issue. Maybe we can put it on the list of short-term items to tackle.

Brent Owens
(The Open Planning Project)

Andrea Aime wrote:

Brent Owens ha scritto:

We have talked before about making it easier for people to customize how the geometry's description looks, and I think that it would be really useful to add that in.

This seems somewhat related to http://jira.codehaus.org/browse/GEOS-836, that is, a templating engine would be useful here too.

Cheers
Andrea