Translate posts to Experimental | Feedback
Google
Official Google Earth Download Site
Page 1 of 2 1 2 >
Topic Options
Rate This Topic
Previous Topic
View All Topics Index
Next Topic
#47319 - 07/04/05 01:28 PM GeoServer WMS-KML output in development ***
James_Macgill Offline
Traveler

Registered: 07/04/05
Posts: 26
Loc: State College, PA, USA
Hi all

Apologies if this post if off topic. This seems to fit under the scope of KML tool.

This is a heads up to say that I've nearly completed a first version of a KML output module GeoServer (the OGC WFS reference implemeations). What does this mean? In short it allows for the production of KML from any format supported by GeoServer (well actually by GeoTools the library behind GeoServer).

This includes Shapefile, MIF/MID, OracleSpatial, PostgreSQL (PostGIS), VPF, Tiger, MySQL and a fair few more.

You can see a screen shot and the KML file itself at the end of this post.

Note that the KML file crashed on my friends Google Earth so I would appreciate feed back from people to let me know if it does / does not work.

The styling is random for now, but GeoTools has a full expression based styling language so expect a range of thematic (electoral, population, poverty...) and cartographic maps in the near future once that is completed.

If anyone is familiar with GeoServer and wants to try this on their own data let me know, installation is a bit tricky for now as I had to patch the core GeoTools GML producer to handle some of KMLs quirks (I'll write them up in another post if anyone is interested)

I plan eventually to put out a stand alone tool so that you won't need GeoServer, probably as a plug in to uDIG. The downside to that is that you won't be able to use the new networking capabilities of Google Earth to pull in live data.

So, cheers to July the 4th, its amazing what you can do with a day off!

Lots still to do, and some refactoring before I'm happy to commit this to the GeoServer code base, but I welcome comments suggestions and feedback.



Attachments
35671-shadedStates.kml (2134 downloads)
Preview this file with the Google Earth Plugin (learn more)

Top
#47320 - 07/04/05 04:24 PM Re: GeoServer WMS-KML output in development [Re: James_Macgill]
kens Offline
Traveler

Registered: 03/10/04
Posts: 246
I ran the example and it initially crashed on my computer due to a back-dated graphics driver that does not support filled polygons. When I switched to DirectX mode, it worked for me.

It will be interesting to hear your comments about KML. In one sense, KML is sort-of like the OGC LOF draft specification.

I look forward to seeing more of your work. I'm hoping that one day Google Earth will be able to access WMS/WFS server via a user defined wizard.

Top
#47321 - 07/04/05 05:10 PM Re: GeoServer WMS-KML output in development [Re: kens]
James_Macgill Offline
Traveler

Registered: 07/04/05
Posts: 26
Loc: State College, PA, USA
Quote:

I ran the example and it initially crashed on my computer due to a back-dated graphics driver that does not support filled polygons. When I switched to DirectX mode, it worked for me.




Thanks for the feedback, thats almost certanly what was knocking my friends GE over.
Quote:


It will be interesting to hear your comments about KML. In one sense, KML is sort-of like the OGC LOF draft specification.




I have mixed views of KML... First off though, I'm excited by it, it is great to see a well documented open format for developers and users to share data and to create tools against. That said...

The geometries are psudo GML, if you give them prfixes and put them in the gml name space GE ignores them.
The Multi* geometries are missing (e.g. MultiPolgyon) to be replaced by GeometryCollection. (GeometryCollection keeps things simple but it would be nice if the GML Mults were supported as well so that people don't have to hack their existing GML and GML publisers.

The coordinate tag is the part that caused me the most work as it requires a Z coordinate. I had to hack our GML code to slot in a Z value even for data that has only X and Y. This would be an easy fix for GE as the ordinate seperator ',' and the coordiate separator 'a space' are different. GML actualy allows you to configure what the separators should be, but I could live with it beeing fixed to , and space provided it recognized x,y pairs without the z.

My biggest problem wth KML is the way it blends style and feature information together. This is why the KML comes out of the WMS pipeline rather than the WFS pipe line. This will show up when I do a series of demographic maps (poverty, income, density, growth...) and I need a full set of the geometries in each file.

There may be ways round this, I need to study the docs more closely and see some more examples.

Quote:


I look forward to seeing more of your work. I'm hoping that one day Google Earth will be able to access WMS/WFS server via a user defined wizard.




As GeoTools can talk to other WMSs and WFSs it would be possible to produce a tool that ingested data from anywhere and presented it to GE as KML. Clearly though it would be FAR better if GE could parse Capabilities documents, build a UI based on it and fire targeted (bbox and filtered) queries at WMS and WFS servers directly.

James
p.s. What ever happens to the LOF draft? I think perhaps it was trying to be too many things at once...

Top
#47322 - 07/04/05 07:42 PM Re: GeoServer WMS-KML output in development [Re: James_Macgill]
ink_polaroid Administrator Offline
Sysop

Registered: 01/01/05
Posts: 1882
Loc: SF Bay Area, CA
Nice work, James. Your example works just fine for me (but I'm using a rather more recent build of the client than most).

As you have seen, KML is not GML. There are some strong similarites in places, but GML is purely descriptive (and is *huge*) whereas KML allows for such things as screenspace overlays and network links (and is *tight*).

We're working on the schemata files, and we will publish them ASAP. That should make life a little easier for you.

Top
#47323 - 07/04/05 08:01 PM Re: GeoServer WMS-KML output in development [Re: ink_polaroid]
James_Macgill Offline
Traveler

Registered: 07/04/05
Posts: 26
Loc: State College, PA, USA
GML is indeed huge, but you can use a tiny subset of it and remain compatable. The one glitch that caused me the most grief is the coordinates having to have three values (not because they are hard, but because I had pass a 'generateDummyZ' flag into the core of the GeoTools GML engine.)

The addition of a gml namespace and a couple more tags and KML would contain a valid subset of GML making a lot of people lives easier for very little extra effort.

James

Top
#47324 - 07/04/05 09:55 PM Re: GeoServer WMS-KML output in development [Re: kens]
James_Macgill Offline
Traveler

Registered: 07/04/05
Posts: 26
Loc: State College, PA, USA
Quote:


I look forward to seeing more of your work....





Ok, here is the first properly styled map, nothing complex yet but it does mean the styling engine is up and running. This maps shows the US states shaded by population. I'll post the SLD document that was used to generate it in a follow up post.


Attachments
35858-statePop.kml (1427 downloads)
Preview this file with the Google Earth Plugin (learn more)

Top
#47325 - 07/04/05 10:07 PM Re: GeoServer WMS-KML output in development [Re: James_Macgill]
James_Macgill Offline
Traveler

Registered: 07/04/05
Posts: 26
Loc: State College, PA, USA
OK, for the interested I have attached the Styled Layer Descriptor document that controls how the map is rendered. Normaly this is used to generate an image such as a PNG or GIF but in this case it is used to generate stylized vectors in KML.

The document is made up of styling rules that look like this:
<Rule>
<ogc:Filter xmlns:gml="http://www.opengis.net/gml">
<ogc:PropertyIsLessThan>
<ogc:PropertyName>PERSONS</ogc:PropertyName>
<ogc:Literal>2000000</ogc:Literal>
</ogc:PropertyIsLessThan>
</ogc:Filter>
<PolygonSymbolizer>
<Fill><CssParameter name="fill">#fff7bc</CssParameter></Fill>
</PolygonSymbolizer>
</Rule>

i.e. if POPULATION < 2000000 shade fff7bc

(SLD 1.1 in draft includes support for classification functions which will make the SLD shorter, but functionaly equivelent)

I've not implemented it the KML bindings yet but SLD also allows for control over a large range of visual variables including line width, dash pattern, fill pattern, opacity, line caps, marker size, color and rotation. We do all of these for image generation, we will have to see how far KML lets us go.

So far I'm very excited by the possibilites.

James


Attachments
35862-popshade.zip (538 downloads)
Preview this file with the Google Earth Plugin (learn more)

Top
#47326 - 07/11/05 05:44 AM Re: GeoServer WMS-KML output in development [Re: James_Macgill]
GlobalTrotter2 Offline
Traveler

Registered: 07/11/05
Posts: 4
James - looks good - I need the same done for all the country shape files. I have attached the gml - can you do the same conversion to gml ? Or is there a 'simple' conversion method ?


Attachments
39292-World Borders.zip (531 downloads)
Preview this file with the Google Earth Plugin (learn more)

Top
#47327 - 07/11/05 02:35 PM Re: GeoServer WMS-KML output in development [Re: kens]
bplewe Offline
Traveler

Registered: 03/31/05
Posts: 14
Loc: Spanish Fork, Utah
I too could only get it to work in DirectX mode. Other data has worked fine.

This is potentially an excellent tool for us GIS folks. When might this be released in the standard GeoServer build?

It's interesting how Google Earth is so much more GIS-savvy than Google Maps (who stuck their foot in their mouth at the Where 2.0 conference by saying they had never heard of OGC).

Top
#47328 - 07/12/05 11:29 PM Re: GeoServer WMS-KML output in development [Re: GlobalTrotter2]
mcshea98 Offline
Master Guide

Registered: 04/09/05
Posts: 488
Loc: USA
GlobalTrotter2,

Your data in GML for Australia is a little messed up. I was able to convert all the others; however, Australia is missing half of its coordinates. Can you post the GML for just Australia? Once I get Australia done correctly, I will post the whole thing.

Top
Page 1 of 2 1 2 >