We've got a lot of approximate, relative, and fuzzy places to deal with at work. I'm designing a hypermedia application to improve the coordinate and/or relativity precision of the place locations using KML. But how do we represent uncertain locations in KML? Previously, if a location was known to be in a lon/lat box I'd include that box as a polygon geometry. It sort of gets the point across, but the "within" relationship gets lost in the process. How do we express that a place is "within" or "near" another placemark? KML doesn't give us much to work with. A Feature can "have" a Geometry, but that's all the semantics we have. The upside of weak semantics is plenty of elbow room. In the absence of better patterns to follow, I'm considering something like this:
<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom"> <Document> <name>relative.kml</name> <open>1</open> <Style id="exampleStyleDocument"> <LabelStyle> <color>ff0000cc</color> </LabelStyle> <BalloonStyle> <displayMode>default</displayMode> </BalloonStyle> </Style> <!-- a relative placemark --> <Placemark id="3"> <name>Relative Feature 3</name> <!-- hypermedia in the user interface --> <description> <![CDATA[ This feature is somewhere near <a href="http://sgillies.net/files/located.kml#2;balloon"> feature 2 (located.kml#2)</a>. ]]> </description> <!-- a machine readable representation using a hypothetical link relation --> <atom:link rel="where:near" href="located.kml#2"/> </Placemark> <!-- located placemarks to provide context --> <NetworkLink> <name>located.kml</name> <Link> <href>http://sgillies.net/files/located.kml</href> </Link> </NetworkLink> </Document> </kml>
See for example: http://sgillies.net/files/relative.kml.
I'm interested to see how others are approaching this problem, but haven't seen any examples yet.
Update (2010-05-26): Turns out that it's just a quirk of Google Earth that you can get a popup bubble (hypermedia) for a placemark without a geometry. In Google Maps, an unlocated placemark does not surface at all. Back to the drawing board?
It seems that kml:address is KML's fuzzy counterpart to coordinates, but it's tied to particular, modern, geocoding database. I can express a location that is (at the center of) Arizona as <address>Arizona</address>, but I can't express a location like "between Arelate and Massalia" using kml:address.