{"id":207,"date":"2007-04-23T09:51:31","date_gmt":"2007-04-23T14:51:31","guid":{"rendered":"http:\/\/crschmidt.net\/blog\/?p=207"},"modified":"2007-04-23T09:51:31","modified_gmt":"2007-04-23T14:51:31","slug":"topology-vs-simple-features-pt-deux","status":"publish","type":"post","link":"https:\/\/crschmidt.net\/blog\/archives\/207\/topology-vs-simple-features-pt-deux\/","title":{"rendered":"Topology vs. Simple Features, pt deux"},"content":{"rendered":"<p>More followup from the list: It seems that there is a reason (in addition to routing) for topological behavior: editing.<\/p>\n<blockquote>\n<p>If you have a junction described in &#8220;features&#8221;, what you get are two  roads that somehow happen to meet in one place (two lines crossing, or  meeting). Right? In terms of storage, both lines will usually have their  own coordinates in the data base; the information that they intersect,  or meet, is not there explicitly, it just comes from the maths applied  when drawing them, and if your database has spatial support you can ask  the database for the point where they intersect.<\/p>\n<p>However if someone wants to move that intersection, he will have to edit  each feature separately &#8211; if you move one road away from the junction,  then the junction is no more.<\/p>\n<\/blockquote>\n<p>  (From the <a href=\"http:\/\/lists.openstreetmap.org\/pipermail\/talk\/2007-April\/013074.html\">mailing list<\/a>.)<\/p>\n<p>It&#8217;s a valid point, and not one that should be easily tossed aside. However, I&#8217;m not arguing against topology in all cases: I think that this is the exact kind of thing for which topology should be used &#8212; in the client.<\/p>\n<p>If you have two nodes that are on top of each other, they should merge together. When you drag one, any feature that includes that node should be updated. When things don&#8217;t actually intersect, they should be separated. The canonical example is a bridge-over-river situation: If I want to draw a bridge over a river, and need two nodes in the exact same place, how do I do that without joining them?<\/p>\n<p>The next piece needed beyond simple join-on-node is a set of logic which tells you when *not* to join data. OpenStreetMap already has the concept of a &#8216;layer&#8217; &#8212; layers determine rendering order, but they also (essentially) determine the ordering on the earth. A bridge has a higher layer than a street, so they shouldn&#8217;t be merged topologically.<\/p>\n<p>But what if they&#8217;re at the same layer, but not connected? (I can&#8217;t envision this, but suppose it happens.) The way I look at it, the answer is that this is a special case, and an additional &#8216;junction&#8217; (or &#8216;not-junction&#8217;) node can be appropriate here. <\/p>\n<p>Maybe I&#8217;m wrong. I&#8217;ve been wrong plenty of times before \ud83d\ude42 However, this is how I&#8217;ve worked so far, and it&#8217;s worked out for the data I&#8217;m working with. I know that Frederik and I disagree on it &#8212; and that&#8217;s fine. Brings vitality to the discussion. \ud83d\ude42 It&#8217;s good to see others so interested in solving the succinctly stated problems brought to the fore by the paper he has put together with Jochen (available from <a href=\"http:\/\/www.remote.org\/frederik\/tmp\/towards-a-new-data-model-for-osm.pdf,\">remote.org<\/a>).<\/p>\n<p>There&#8217;s an additional concern, stated by Steve on the list: <\/p>\n<blockquote>\n<p>And yes you&#8217;re right, topological is really useful since OSM is a wiki and we track changes in nodes. Otherwise moving an intersection of many roads would mean updating many linestrings not one node.<\/p>\n<p><a href=\"http:\/\/lists.openstreetmap.org\/pipermail\/talk\/2007-April\/013097.html\">another mailing list post<\/a><\/p><\/blockquote>\n<p> This one is more interesting to me, because I feel like moving topology to the client actually turns editing a topological operation &#8212; after which, grouping the edits in the API should be simple. Updating multiple features at once is a &#8216;simple matter of programming&#8217; that I can solve (given time\/effort on my part). Certainly I&#8217;ve built a RESTful Feature API that supports this &#8212; but it&#8217;s Simple Feature-based, not topology based.  <\/p>\n<p>Does anyone have experience of creating GIS data from aerial imagery? This is the thing that I have the most experience with, after mapping out a decent sized city using Yahoo! Maps as a backdrop. What do you use in editing? What do you use for export? How does it all tie together?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>More followup from the list: It seems that there is a reason (in addition to routing) for topological behavior: editing. If you have a junction described in &#8220;features&#8221;, what you get are two roads that somehow happen to meet in one place (two lines crossing, or meeting). Right? In terms of storage, both lines will [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62],"tags":[],"class_list":["post-207","post","type-post","status-publish","format-standard","hentry","category-openstreetmap"],"_links":{"self":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/comments?post=207"}],"version-history":[{"count":0,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/207\/revisions"}],"wp:attachment":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/media?parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/categories?post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/tags?post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}