online kml to czml conversion

Hello.

What do you think about a webservice to convert kml to czml?

a) upload a kml file and get a czml file as response

b) a textinput where you can paste a kml snippet and get the czml as response.

This would enable users to immediately test cesium with their data
without having to download and install the converter.

Hello Christian, I too am eagerly awaiting an online conversion server. Unfortunately, it has been a few months since I first started following the project and the conversion server has made little progress. I’m converting http://climateviewer.com/pro/ to Cesium as soon as a conversion server is available, I have a teammate on a new GIS project who is working on a node.js conversion server, and we intend to include czml in the list of options. I will let this group know if/when we are able to accomplish this. Here is a preview shot of our new system: http://climateviewer.com/gss.jpg

~ Jim Lee

Christian,

We can publish a web service right now that can do the conversions listed here https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/Kml. and also supports your first bullet. The second bullet I didn’t think people would want but is a good idea and I’ll have to spend a little time to implement.

I was waiting for the network link conversion to become finalized before posting the service up. You can find info on the network link integration in the czml repo here https://github.com/AnalyticalGraphicsInc/czml-writer/pull/26

and in the cesium repo here https://github.com/AnalyticalGraphicsInc/cesium/tree/czmlLayers

But we can still post it without the network link support if that would help.

rezn8d. thanks for sharing the pic. looks great!

Christian,

We can publish a web service right now that can do the conversions listed
here https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/Kml. and also
supports your first bullet. The second bullet I didn't think people would
want but is a good idea and I'll have to spend a little time to implement.

yes the second bullet is more of an idea when people know kml
and want to see what a kml snippet they know looks in czml

I was waiting for the network link conversion to become finalized before
posting the service up. You can find info on the network link integration
in the czml repo here
https://github.com/AnalyticalGraphicsInc/czml-writer/pull/26
and in the cesium repo here
https://github.com/AnalyticalGraphicsInc/cesium/tree/czmlLayers

But we can still post it without the network link support if that would
help.

Network links are an edge case for me, the reason i am asking is
mainly to be able to learn czml from kml which i know quite well

I know that czml is much more feature rich than kml with the fourth
dimension added but the data i have to visualize does not
have a time dimension (this will come later next year) so that subset
of czml i can get from kml would suffice for now

As a bit of background information: I want to integrate cesium
as an alternative viewer into
http://plone.org/products/collective.geo

which requires me to write a czml library in python
once the library is ready shapefile/kml/geojson
conversion to czml would be quite possible with it too

and provide cesium for
http://iwlearn.net/iw-projects/@@project-map-view.html

OK i’ll be posting it up at cesium.agi.com.

Did this czml writer web service ever get stood up?

Yes we did set up a temporary service. The url is here http://cesium.agi.com/kmlconverter/kml2czml

You can do two things with it:

Request it via a GET with a query parameter called locationUrl where you specify the url of where the kml document resides. I'll have to recheck the code to see if this supports kmz files.

http://cesium.agi.com/kmlconverter/kml2czml?locationUrl=https%3A%2F%2Fdevelopers.google.com%2Fkml%2Fdocumentation%2FKML_Samples.kml(check out California and Northern Arizona in the Grand Canyons)

You can also do a POST and supply a kml or kmz as multipart form data.

We will eventually add the ability to drag/drop kml/kmz files on to CesiumViewer and convert on the fly.

Keep in mind this is a temporary service and could change over time.

let me know if you run into any issues.

That example url is
http://cesium.agi.com/kmlconverter/kml2czml?locationUrl=https%3A%2F%2Fdevelopers.google.com%2Fkml%2Fdocumentation%2FKML_Samples.kml

Hi All,
we have tried to use the service but we are not able to display the results on the Cesium viewer. Any suggestion?

Moreover we would like to convert a simple KML including the sketch of some buildings (a very simple one) but the result is not rendered by the viewer. My question is, is the Z coordinate in the CZML used for rendering?

I report hereafter the KML we are trying to convert.
Thank you in advance for your reply.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
  <name>poligoni.kml</name>
  <StyleMap id="m_ylw-pushpin">
    <Pair>
      <key>normal</key>
      <styleUrl>#s_ylw-pushpin</styleUrl>
    </Pair>
    <Pair>
      <key>highlight</key>
      <styleUrl>#s_ylw-pushpin_hl</styleUrl>
    </Pair>
  </StyleMap>
  <Style id="s_ylw-pushpin_hl">
    <IconStyle>
      <scale>1.3</scale>
      <Icon>
        <href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
      </Icon>
      <hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
    </IconStyle>
  </Style>
  <Style id="s_ylw-pushpin">
    <IconStyle>
      <scale>1.1</scale>
      <Icon>
        <href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
      </Icon>
      <hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
    </IconStyle>
  </Style>
  <Folder>
    <name>I miei luoghi</name>
    <open>1</open>
    <Style>
      <ListStyle>
        <listItemType>check</listItemType>
        <ItemIcon>
          <state>open</state>
          <href>:/mysavedplaces_open.png</href>
        </ItemIcon>
        <ItemIcon>
          <state>closed</state>
          <href>:/mysavedplaces_closed.png</href>
        </ItemIcon>
        <bgColor>00ffffff</bgColor>
        <maxSnippetLines>2</maxSnippetLines>
      </ListStyle>
    </Style>
    <Placemark>
      <name>Poligono senza titolo</name>
      <styleUrl>#m_ylw-pushpin</styleUrl>
      <Polygon>
        <extrude>1</extrude>
        <tessellate>1</tessellate>
        <altitudeMode>relativeToGround</altitudeMode>
        <outerBoundaryIs>
          <LinearRing>
            <coordinates>
              14.26738574970526,40.85318092193987,9.999999999999998 14.26746013120212,40.85289323283426,9.999999999999998 14.26785686208141,40.85292825143067,9.999999999999998 14.26779782657067,40.85320360093553,9.999999999999998 14.26738574970526,40.85318092193987,9.999999999999998
            </coordinates>
          </LinearRing>
        </outerBoundaryIs>
      </Polygon>
    </Placemark>
    <Placemark>
      <name>Poligono senza titolo</name>
      <styleUrl>#m_ylw-pushpin</styleUrl>
      <Polygon>
        <extrude>1</extrude>
        <tessellate>1</tessellate>
        <altitudeMode>relativeToGround</altitudeMode>
        <outerBoundaryIs>
          <LinearRing>
            <coordinates>
              14.26807219156825,40.85324958074902,13 14.26816257612257,40.8529632084893,13 14.26892687268447,40.85305501410747,13 14.26884889418346,40.85335268813706,13 14.26845302716489,40.85345581875907,13 14.26804226566581,40.85335209474857,13 14.26807219156825,40.85324958074902,13
            </coordinates>
          </LinearRing>
        </outerBoundaryIs>
      </Polygon>
    </Placemark>
    <Placemark>
      <name>Poligono senza titolo</name>
      <styleUrl>#m_ylw-pushpin</styleUrl>
      <Polygon>
        <extrude>1</extrude>
        <tessellate>1</tessellate>
        <altitudeMode>relativeToGround</altitudeMode>
        <outerBoundaryIs>
          <LinearRing>
            <coordinates>
              14.26927662628471,40.85310328752461,15 14.26973314463903,40.85310985864372,15 14.26971409826657,40.85351732209372,15 14.26918030098396,40.85337032935772,15 14.26927662628471,40.85310328752461,15
            </coordinates>
          </LinearRing>
        </outerBoundaryIs>
      </Polygon>
    </Placemark>
  </Folder>
</Document>
</kml>

The issue here is the extrude tag which currently is unsupported in the converter. See here for what is supported and not supported

https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/Kml. We’d need some equivalent in Cesium to support it correctly.

If you save the output of the conversion(http://cesium.agi.com/kmlconverter/kml2czml?locationUrl=https%3A%2F%2Fdevelopers.google.com%2Fkml%2Fdocumentation%2FKML_Samples.kml) to a file(ie test.czml) and then drag and drop that onto the cesium viewer, you should see it.

Cheers

Matt

Hello
I want to know is what it is possible to view CityGML data on cesium globe.

if so could you help me to start.

thank you in advance

Not yet, but CityGML is certainly something we are interested in doing. If you’re interested in working on Cesium support for CityGML, I can provide some direction on what would need to be done.

Hi,

I am currently working with CityGML files and would like to view them on Cesium Globe.

Would it be possible for you to guide me how exactly can this be done.

Thanks in advance!