<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Am 06.05.10 16:36, schrieb Roland Olbricht:
<blockquote cite="mid:201005061636.24132.roland.olbricht@gmx.de"
type="cite">
<pre wrap="">Am Dienstag, 4. Mai 2010 22:12:02 schrieb Andreas Kalsch:
</pre>
<blockquote type="cite">
<pre wrap="">I am still reading some old mailing list posts ...
What about a relation with type="data", which is a relation that can
include tags and other relations recusively?
</pre>
</blockquote>
<pre wrap="">
It is a really good idea to store definitions of tags directly into the
database, but relations leave some drawbacks open:
- A description might easily surpass 255 characters. Or you might want to use
markup (e.g. for a link or for emphasizing things).
</pre>
</blockquote>
Right, so what about dropping this limit? Even better for OSM data as
well.<br>
<blockquote cite="mid:201005061636.24132.roland.olbricht@gmx.de"
type="cite">
<pre wrap="">- Often tags apply only to a part of the world. Or, even worse, do have
different meanings in different part of the worlds. Think of different
maxspeed restrictions on motorways in different parts of the world.
</pre>
</blockquote>
But tags and value are global, semantics can vary, of course. This is
our job: to describe a tag depending on language / country / ... so
that everybody will understand it by reading the right description
appended by a country or language code.<br>
<blockquote cite="mid:201005061636.24132.roland.olbricht@gmx.de"
type="cite">
<pre wrap="">I'd encourage you to start using those relations now but we should have a more
versatile solution with the next API. See
<a class="moz-txt-link-freetext" href="http://wiki.openstreetmap.org/wiki/API_v0.7#Classes">http://wiki.openstreetmap.org/wiki/API_v0.7#Classes</a>
</pre>
</blockquote>
It seems that the class feature was suggested mainly for the purpose of
storing tag descriptions. So isn't it unnecessary work to define an own
feature instead of reusing relations and dropping the length limit?
Additionally, to include a bounding polygon is a bad idea. It's better
to reference the relation ID of the multipolygon. Example in OSM XML:<br>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<pre><relation ...>
<tag k="type" v="data"/>
<tag k="class" v="CountryCodeToFeatureMapping"/>
<member member_class="relation" member_id="12345" role="de"/>
<member member_class="relation" member_id="23456" role="fr"/>
</relation>
<relation ...>
<tag k="type" v="data"/>
<tag k="class" v="<meta charset="utf-8"><span
class="Apple-style-span"
style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"></span>ValueDef"/>
<tag k="key" v="highway=motorway"/>
<tag k="description:de" v="German">
<tag k="implies:fr" v="highway=trunk"/>
<tag k="photo" v=<a class="moz-txt-link-rfc2396E" href="http://...">"http://..."</a>/>
</relation>
</pre>
So we reuse OSM's data as well to define the area where the property
applies. A simple class to map from country code to admin area ID is
setup, so that we can demonstrate that we have got the best data - we
can exactly show what a country code means geometrically.<br>
<br>
Let's think about setting up MongoDB to handle nested objects and
schema changes more easily. In MongoDB, collections are the equivalent
of tables, so we would have several collections or classes, examples in
JSON:<br>
<br>
1) AreaLabel, example:<br>
{<br>
de: {class: 'Relation', id: 12345},<br>
...<br>
}<br>
<br>
2) KeyDef<br>
<br>
3) ValueDef, example:<br>
{<br>
keyDef: {key:'highway'},<br>
value: 'motorway',<br>
description: {<br>
de: '...',<br>
fr: '...'<br>
},<br>
impliesValueDefs: {<br>
fr: {<br>
keyDef: {key:'highway'},<br>
value: 'trunk'<br>
}<br>
},<br>
photo: {<br>
__: '<a class="moz-txt-link-freetext" href="http://">http://</a>...' /* '__' means global */<br>
}<br>
}<br>
<br>
4) Preset<br>
<br>
5) Group<br>
</body>
</html>