Translate posts to Experimental | Feedback
Google
Official Google Earth Download Site
Topic Options
Rate This Topic
Previous Topic
View All Topics Index
Next Topic
#728521 - 01/17/07 02:57 PM Observations KML Schema
jcothran2 Offline
Traveler

Registered: 07/10/05
Posts: 20
Loc: Columbia, SC
If you are in the business of collecting or sharing geospatial observations, please take a look at the following proposed observations content schema for KML. Contact me at jeremy.cothran[at]gmail.com if you are interested in utilizing this schema or something similar in need. I'll be maintaining a registry of data sources utilizing this schema in the future and hopefully this or something similar might help advance KML from a display standard to a data transport standard also. Comments or questions about the schema are welcome.

ObsKML Schema

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<name>Obskml sample</name>
<open>1</open>
<Schema parent="Placemark" name="PlacemarkObs">
<!-- namespace type lookups only listed once here for the whole file, the below listed are sample lookups and need some more refinement -->
<SimpleField name="organizationLkp" type="string">http://nautilus.baruch.sc.edu/obsrss/organizations.xml</SimpleField>
<SimpleField name="platformLkp" type="string">http://nautilus.baruch.sc.edu/obsrss/platforms.xml</SimpleField>
<SimpleField name="observationLkp" type="string">http://nautilus.baruch.sc.edu/obsrss/observation_types.xml</SimpleField>
<SimpleField name="uomLkp" type="string">http://nautilus.baruch.sc.edu/obsrss/uom_types.xml</SimpleField>
<SimpleField name="qualityLkp" type="string">http://nautilus.baruch.sc.edu/obsrss/quality_types.xml</SimpleField>

<!-- organization and platform details listed once per placemark -->
<SimpleField name="organization" type="string"></SimpleField>
<SimpleField name="organizationURL" type="string"></SimpleField>
<SimpleField name="platform" type="string"></SimpleField>
<SimpleField name="platformURL" type="string"></SimpleField>

<!-- 1 or more observations per placemark/platform -->
<SimpleArrayField type="string" name="observation">
<SimpleField name="type" type="string"></SimpleField>
<SimpleField name="uom" type="string"></SimpleField>
<SimpleField name="value" type="int"></SimpleField>
<SimpleField name="elev" type="int"></SimpleField>
<SimpleField name="quality" type="string"></SimpleField>
<SimpleField name="dataURL" type="string"></SimpleField>
</SimpleArrayField>
</Schema>
<PlacemarkObs>
<name>CAP1:wls</name>
<description>An html table derived from the obs kml schema would be display here</description>
<Point>
<coordinates>-79.68,32.86,0</coordinates>
</Point>
<TimeStamp><when>2007-01-15T14:00:00</when></TimeStamp>
<organization>carocoops</organization>
<organizationURL>http://carocoops.org</organizationURL>
<platform>CAP1</platform>
<platformURL>http://nautilus.baruch.sc.edu/carocoops_website/buoy_detail.php?buoy=WLS2</platformURL>
<observation>
<type>air_temperature</type>
<uom>celsius</uom>
<value>21</value>
<elev>3</elev>
<quality>0</quality>
<dataURL>http://nautilus.baruch.sc.edu/carocoops_website/buoy_graph.php?buoy=WLS2&amp;graph_type=air_temperature</dataURL>
</observation>
<observation>
<type>water_temperature</type>
<uom>celsius</uom>
<value>19</value>
<elev>-1</elev>
<quality>0</quality>
<dataURL>http://nautilus.baruch.sc.edu/carocoops_website/buoy_graph.php?buoy=WLS2&amp;graph_type=water_temperature</dataURL>
</observation>
</PlacemarkObs>
</Document>
</kml>


Thanks
Jeremy Cothran
Caro-COOPS
SEACOOS

Round the decay
Of that colossal wreck, boundless and bare
The lone and level sands stretch far away.

Top
#728522 - 01/18/07 09:47 AM Re: Observations KML Schema [Re: jcothran2]
ManoM Offline
KML Guru

Registered: 09/22/06
Posts: 447
Hi Jeremy,

This is interesting. You might want to check out the new KML Schema, which has a Metadata tag that allows you to create any tags in any other namespace. This is convenient if you want to describe metadata using the XML Schema language.

The KML Schema is here:

http://code.google.com/apis/kml/schema/kml21.xsd

ManoM

Top
#728523 - 01/22/07 08:36 AM Re: Observations KML Schema [Re: ManoM]
jcothran2 Offline
Traveler

Registered: 07/10/05
Posts: 20
Loc: Columbia, SC
Hi ManoM,

Thanks for the feedback. The example shown is using the kml schema tag to try and better organize shared observation data. If folks who are creating all these wonderful KML feeds with the data presented in HTML tables would go the extra step of using something like the above, then that would make it easier for my or others automated scripts to parse and understand(using a common controlled vocabulary) the data being shared.

Other than the tutorial, I can't find other real world examples where the schema tag is being utilized. My guess is that this isn't of much interest to Google itself since they make money off of inserting advertising for human viewing and not machine to machine communication. So if this isn't better utilized in KML then maybe georss or some other organization or competitor will provide a better answer for this type of use.

Jeremy

Top
#728524 - 01/22/07 08:48 AM Re: Observations KML Schema [Re: jcothran2]
ManoM Offline
KML Guru

Registered: 09/22/06
Posts: 447
Hi Jeremy,

Actually, we're very interested in this kind of data!

The reason no one uses the <Schema> tag is that it is difficult to use, and is essentially a really limited xml schema language, mixing data and structure in the same document.

I think you'd find that using <Metadata> tag will be much more effective at accomplishing what you're interested in. For instance, a much cleaner implementation of your data structure could be:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<name>Obskml sample</name>
<open>1</open>
<PlacemarkObs>
<name>CAP1:wls</name>
<description>An html table derived from the obs kml schema would be display here</description>
<Metadata><obs xmlns="some:namespace">
<organization>carocoops</organization>
<organizationURL>http://carocoops.org</organizationURL>
<platform>CAP1</platform>
<platformURL>http://nautilus.baruch.sc.edu/carocoops_website/buoy_detail.php?buoy=WLS2</platformURL>
<observation>
<type>air_temperature</type>
<uom>celsius</uom>
<value>21</value>
<elev>3</elev>
<quality>0</quality>
<dataURL>http://nautilus.baruch.sc.edu/carocoops_website/buoy_graph.php?buoy=WLS2&amp;graph_type=air_temperature</dataURL>
</observation>
<observation>
<type>water_temperature</type>
<uom>celsius</uom>
<value>19</value>
<elev>-1</elev>
<quality>0</quality>
<dataURL>http://nautilus.baruch.sc.edu/carocoops_website/buoy_graph.php?buoy=WLS2&amp;graph_type=water_temperature</dataURL>
</observation>
</obs>
</Metadata>
<Point>
<coordinates>-79.68,32.86,0</coordinates>
</Point>
<TimeStamp><when>2007-01-15T14:00:00</when></TimeStamp>
</PlacemarkObs>
</Document>
</kml>

This is now valid KML. It would allow you to use tools like data binding technologies designed for the XML Schema language to produce valid KML documents, and to define your own markup language in an XML Schema document that incorporates both your markup and the standard KML schema.

ManoM

Top
#728525 - 01/22/07 09:55 AM Re: Observations KML Schema [Re: jcothran2]
jcothran2 Offline
Traveler

Registered: 07/10/05
Posts: 20
Loc: Columbia, SC
Thanks again ManoM for the speedy response and example. I tried cutting and pasting your example, but edited 'PlacemarkObs' to 'Placemark'(shown below) so it would map the placemark. I understand what you are saying though by using the 'Metadata' tag instead of the 'Schema' tag.

Still though I'm surprized by the current lack of examples or interest in community use of something like the 'Metadata' or 'Schema' tag. As a simple example, the National Weather Service (NWS) provides RSS feeds of latest station measurements(air temperatures, winds, etc), but it's the same issue in that the data is one long string of all the measurements and units of measure(uom) similar to how existing KML observations are strings of HTML with a similarly missing reference to a possible convention or standard in how the obs and uom are represented as XML.

Google has utilized standards like GML and more recently WMS(Web Mapping Service) to good effect for display purposes - hoping Google and/or the development community might also provide leadership or encouragement for data content/reuse purposes via reference XML Schemas and controlled vocabularies also.(real world common usage examples of the Metadata tag for instance).

Thanks
Jeremy

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<name>ObsKML sample</name>
<open>1</open>
<Placemark>
<name>CAP1:wls</name>
<description>An html table derived from the obs kml schema would be display here</description>
<Metadata><obs xmlns="some:namespace">
<organization>carocoops</organization>
<organizationURL>http://carocoops.org</organizationURL>
<platform>CAP1</platform>
<platformURL>http://nautilus.baruch.sc.edu/carocoops_website/buoy_detail.php?buoy=WLS2</platformURL>
<observation>
<type>air_temperature</type>
<uom>celsius</uom>
<value>21</value>
<elev>3</elev>
<quality>0</quality>
<dataURL>http://nautilus.baruch.sc.edu/carocoops_website/buoy_graph.php?buoy=WLS2&amp;graph_type=air_temperature</dataURL>
</observation>
<observation>
<type>water_temperature</type>
<uom>celsius</uom>
<value>19</value>
<elev>-1</elev>
<quality>0</quality>
<dataURL>http://nautilus.baruch.sc.edu/carocoops_website/buoy_graph.php?buoy=WLS2&amp;graph_type=water_temperature</dataURL>
</observation>
</obs>
</Metadata>
<Point>
<coordinates>-79.68,32.86,0</coordinates>
</Point>
<TimeStamp><when>2007-01-15T14:00:00</when></TimeStamp>
</Placemark>
</Document>
</kml>

Top
#728526 - 01/22/07 10:17 AM Re: Observations KML Schema [Re: jcothran2]
ManoM Offline
KML Guru

Registered: 09/22/06
Posts: 447
Hi Jeremy,

I think some reference implementations for Metadata schemata would be great. How about one for Observations? Do you have one for this format you're suggesting? I'd be happy to help out with that.

ManoM

Top
#728527 - 01/22/07 11:58 AM Re: Observations KML Schema [Re: ManoM]
jcothran2 Offline
Traveler

Registered: 07/10/05
Posts: 20
Loc: Columbia, SC
Thanks! I'll post a link to a very simple metadata xml schema(.xsd) incorporating just observations and unit of measure and another which further incorporates some further metadata(platform, organization, etc) as it is available.

I'll also develop and post a link to a perl script/.exe to convert this metadata only KML into a KML with the HTML populated from the metadata and an example of this KML in use with the observations we've collected and posted earlier via KML here and here

Should have these materials available sometime in the next day or two.

Jeremy

Top
#728528 - 01/22/07 01:57 PM Re: Observations KML Schema [Re: jcothran2]
ManoM Offline
KML Guru

Registered: 09/22/06
Posts: 447
Hi Jeremy,

Excellent! I look forward to seeing this.

ManoM

Top
#728529 - 01/22/07 04:16 PM Re: Observations KML Schema [Re: ManoM]
capitao Offline
Traveler

Registered: 04/12/06
Posts: 11
Hi ManoM !!

Here in Brazil, I'm using Schema tag to generate a smallest update file (~ 50 Mb) to a program working together with GE API to make local file based animation (<Update>).

With <Schema>, I can simplificate <Placemark> by <P>.

In the recents GE releases, local file based updates are disabled by GE team,and I dont fix my program to change it making http based animation.

Therefore, yes, exists someelse using Schema tag.

capitao


Edited by capitao (01/22/07 05:21 PM)

Top
#728530 - 01/24/07 10:54 AM Re: Observations KML Schema [Re: ManoM]
jcothran2 Offline
Traveler

Registered: 07/10/05
Posts: 20
Loc: Columbia, SC
Hi ManoM,

For the full ongoing documentation on what I'm trying to do see ObsKML

The short version is that I've posted xml schemas and controlled vocabulary lookups here

in particular a 'simple' kml metadata tag schema labeled 'obs' described by obs_kml_simple.xsd

This hopefully minimally extends some very common and basic metadata tags at placemarks such as observation type, unit of measure(uom), value and elevation(elev). A placemark may have one or several observations. The observation type and unit of measure are constrained to the controlled vocabulary lookups specified in the obsType and uomType namespace. For the observations I've been working with I have some initial lookups for observations and units of measure which I can add to by request or folks could reference their own, but the fewer and broader the lookups, the better for standardization purposes.

I also created a starting registry of links to kml using this scheme which is currently just my own data and a reprocessed kml file for further example purposes.

It would be great if Google or some group or organization could throw some more attention on this issue in regards to KML. KML standardizes the 'where' and 'when' information within a popular and easy xml standard and it would be interesting to see the 'what' part of this data stream standardized also. Separating data content from data display into a more standardized xml schema would allow KML to enable better end user data reuse, aggregation and styling needs.

Thanks
Jeremy

Top