Difference between revisions of "WebSchemas/GeoShapeExamples"

From W3C Wiki
Jump to: navigation, search
m
m (Korcula example)
Line 70: Line 70:
 
<syntaxhighlight lang="html4strict" line start="1" >
 
<syntaxhighlight lang="html4strict" line start="1" >
 
<kml xmlns="http://earth.google.com/kml/2.0"><Folder><name>OpenLayers
 
<kml xmlns="http://earth.google.com/kml/2.0"><Folder><name>OpenLayers
export</name><description>Exported on Fri Jun 22 2012 22:51:32
+
export</name>
GMT+0200 (CEST)</description><Placemark><name>OpenLayers_Feature_Vector_354</name><description>No
+
<description>Exported on Fri Jun 22 2012 22:51:32 GMT+0200 (CEST)</description>
description available</description><Polygon><outerBoundaryIs><LinearRing><coordinates>17.052154541015,
+
<Placemark>
 +
<name>OpenLayers_Feature_Vector_354</name>
 +
<description>No description available</description>
 +
<Polygon>
 +
  <outerBoundaryIs>
 +
    <LinearRing>
 +
      <coordinates>17.052154541015,
 
42.984695434571 17.108459472656, 42.969589233399 17.140045166015,
 
42.984695434571 17.108459472656, 42.969589233399 17.140045166015,
 
42.962722778321 17.166137695312, 42.942123413087 17.181243896484,
 
42.962722778321 17.166137695312, 42.942123413087 17.181243896484,
Line 84: Line 90:
 
42.962722778321 16.603088378906, 43.001174926758 16.658020019531,
 
42.962722778321 16.603088378906, 43.001174926758 16.658020019531,
 
43.008041381837 16.857147216797, 42.979202270508 17.052154541015,
 
43.008041381837 16.857147216797, 42.979202270508 17.052154541015,
42.984695434571</coordinates></LinearRing></outerBoundaryIs></Polygon></Placemark></Folder></kml>
+
42.984695434571
 +
</coordinates>
 +
</LinearRing>
 +
</outerBoundaryIs>
 +
</Polygon>
 +
</Placemark>
 +
</Folder>
 +
</kml>
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
(aside: RDF people might recognise some RDFishness in KML's GML heritage...)
  
 
=== schema.org version ===
 
=== schema.org version ===

Revision as of 21:31, 22 June 2012


This is a WebSchemas proposal GeoShapeExamples for schema.org. See Proposals listing for more. Status: Proposal



The schema.org GeoShape class is under-specified, in particular lacking examples.

GeoShape (and GeoCoordinates) are based on IPTC rNews 1.0's GeoCoordinates, with some changes:

  • the point property was promoted to a first class type for schema.org
  • the definitions became confusing since points in rNews are always expressed as decimal pairs, rather than as complex entities.
  • rNews' examples suffer from HTML formatting errors anyway
  • check this against discussion thread for details.

The result is confusing. This page serves to collect examples that can be used to improve the spec.


Korcula example

From a thread on the geowankers mailing list.


Here's a crude approximation of the island of Korcula, in Croatia, which is home to a city of the same name. We will be lazy here and not write the accent over the 'c'. Nearby in the Web, Wikipedia has pages for both island and city, http://en.wikipedia.org/wiki/Kor%C4%8Dula and http://en.wikipedia.org/wiki/Kor%C4%8Dula_(town)

The polygon vectors were drawn using the openlayers vector-formats demo.

In GeoRSS with RSS2,

  1. <item xmlns="http://backend.userland.com/rss2">
  2. <title></title><description></description>
  3. <georss:polygon
  4. xmlns:georss="http://www.georss.org/georss">42.984695434571
  5. 17.052154541015 42.969589233399 17.108459472656 42.962722778321
  6. 17.140045166015 42.942123413087 17.166137695312 42.929763793946
  7. 17.181243896484 42.922897338868 17.212829589844 42.898178100587
  8. 17.208709716797 42.898178100587 17.177124023437 42.895431518555
  9. 17.090606689453 42.911911010743 16.964263916015 42.87208557129
  10. 16.839294433594 42.888565063477 16.833801269531 42.895431518555
  11. 16.732177734375 42.892684936524 16.725311279297 42.910537719727
  12. 16.670379638672 42.896804809571 16.656646728515 42.927017211915
  13. 16.618194580078 42.95997619629 16.658020019531 42.962722778321
  14. 16.658020019531 43.001174926758 16.603088378906 43.008041381837
  15. 16.658020019531 42.979202270508 16.857147216797 42.984695434571
  16. 17.052154541015</georss:polygon></item>

In GeoJSON,

  1. {"type":"Feature", "properties":{}, "geometry":{"type":"Polygon",
  2. "coordinates":[[[17.052154541015, 42.984695434571], [17.108459472656,
  3. 42.969589233399], [17.140045166015, 42.962722778321],
  4. [17.166137695312, 42.942123413087], [17.181243896484,
  5. 42.929763793946], [17.212829589844, 42.922897338868],
  6. [17.208709716797, 42.898178100587], [17.177124023437,
  7. 42.898178100587], [17.090606689453, 42.895431518555],
  8. [16.964263916015, 42.911911010743], [16.839294433594, 42.87208557129],
  9. [16.833801269531, 42.888565063477], [16.732177734375,
  10. 42.895431518555], [16.725311279297, 42.892684936524],
  11. [16.670379638672, 42.910537719727], [16.656646728515,
  12. 42.896804809571], [16.618194580078, 42.927017211915],
  13. [16.658020019531, 42.95997619629], [16.658020019531, 42.962722778321],
  14. [16.603088378906, 43.001174926758], [16.658020019531,
  15. 43.008041381837], [16.857147216797, 42.979202270508],
  16. [17.052154541015, 42.984695434571]]]}, "crs":{"type":"name",
  17. "properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}}}

In KML,

  1. <kml xmlns="http://earth.google.com/kml/2.0"><Folder><name>OpenLayers
  2. export</name>
  3. <description>Exported on Fri Jun 22 2012 22:51:32 GMT+0200 (CEST)</description>
  4. <Placemark>
  5.  <name>OpenLayers_Feature_Vector_354</name>
  6.  <description>No description available</description>
  7.  <Polygon>
  8.   <outerBoundaryIs>
  9.     <LinearRing>
  10.       <coordinates>17.052154541015,
  11. 42.984695434571 17.108459472656, 42.969589233399 17.140045166015,
  12. 42.962722778321 17.166137695312, 42.942123413087 17.181243896484,
  13. 42.929763793946 17.212829589844, 42.922897338868 17.208709716797,
  14. 42.898178100587 17.177124023437, 42.898178100587 17.090606689453,
  15. 42.895431518555 16.964263916015, 42.911911010743 16.839294433594,
  16. 42.87208557129 16.833801269531, 42.888565063477 16.732177734375,
  17. 42.895431518555 16.725311279297, 42.892684936524 16.670379638672,
  18. 42.910537719727 16.656646728515, 42.896804809571 16.618194580078,
  19. 42.927017211915 16.658020019531, 42.95997619629 16.658020019531,
  20. 42.962722778321 16.603088378906, 43.001174926758 16.658020019531,
  21. 43.008041381837 16.857147216797, 42.979202270508 17.052154541015,
  22. 42.984695434571
  23. </coordinates>
  24. </LinearRing>
  25. </outerBoundaryIs>
  26. </Polygon>
  27. </Placemark>
  28. </Folder>
  29. </kml>

(aside: RDF people might recognise some RDFishness in KML's GML heritage...)

schema.org version

... so what might we say of it in Schema.org?

Well, maybe we would say it's an Island? Pretty tough, http://schema.org/Landform has Volcano and Continent but no island. Are there standard medium-sized lists of expected values we should be using here?

Ok so picking from http://schema.org/Place ... let's go with http://schema.org/TouristAttraction. Maybe we'll describe the island, and then use Place's containedIn relation to describe the city (also called Korcula) that's on the island.

So, it's a thing of type http://schema.org/TouristAttraction ... it has a 'geo' property pointing to a thing that is of type http://schema.org/GeoShape ... which in turn has a 'polygon' property whose value is the Text,

"17.052154541015, 42.984695434571 17.108459472656, 42.969589233399 17.140045166015, 42.962722778321 17.166137695312, 42.942123413087 17.181243896484, 42.929763793946 17.212829589844, 42.922897338868 17.208709716797, 42.898178100587 17.177124023437, 42.898178100587 17.090606689453, 42.895431518555 16.964263916015, 42.911911010743 16.839294433594, 42.87208557129 16.833801269531, 42.888565063477 16.732177734375, 42.895431518555 16.725311279297, 42.892684936524 16.670379638672, 42.910537719727 16.656646728515, 42.896804809571 16.618194580078, 42.927017211915 16.658020019531, 42.95997619629 16.658020019531, 42.962722778321 16.603088378906, 43.001174926758 16.658020019531, 43.008041381837 16.857147216797, 42.979202270508 17.052154541015, 42.984695434571".

As discussed earlier, the first and last pairs are identical.

It's also btw the alleged-birthplace-of http://en.wikipedia.org/wiki/Marco_Polo but let's get the basics working first :)

TODO:

  • Microdata and RDFa examples
  • Suggest concrete example for specification
  • Suggested fixes to definitions
  • Check with IPTC rNews team