{"id":490,"date":"2021-10-07T10:16:36","date_gmt":"2021-10-07T18:16:36","guid":{"rendered":"https:\/\/blog.geofictician.net\/?p=490"},"modified":"2021-10-07T10:16:36","modified_gmt":"2021-10-07T18:16:36","slug":"on-mass-deletions-in-ogf","status":"publish","type":"post","link":"https:\/\/blog.geofictician.net\/index.php\/2021\/10\/07\/on-mass-deletions-in-ogf\/","title":{"rendered":"On Mass Deletions in OGF"},"content":{"rendered":"<p>This morning, I posted this in response to <a href=\"https:\/\/opengeofiction.net\/user\/ADB52\/diary\/3182\">a query on the User Diaries at OpenGeofiction<\/a>:<\/p>\n<blockquote><p><strong>General advice for all users:<\/strong><\/p>\n<p>When deleting large numbers of objects, please be careful. This is not a use-case that the OSM software is designed to handle (think about it &#8211; mass deletions are NOT common on OSM). Divide up your deletions to cover small numbers of objects (&lt;1000) and small areas (so if something goes wrong you don\u2019t mess up large areas).<\/p><\/blockquote>\n<p>I called attention to the post in the discord channel (&#8220;OGFC&#8221;), and so I decided to rant onward and provide some additional clarification and thoughts. I&#8217;ve distilled those, without much editing, below.<\/p>\n<blockquote><p>To the above, I would add that in my own practice, I have another step I take with respect to deletions. I almost never delete relations. You&#8217;ll notice in JOSM, it actually tries to warn you that &#8220;this is rarely necessary&#8221; when you try to delete a relation, and I think that&#8217;s a solid point. What you can do with relations you don&#8217;t need any more is repurpose them. That means you delete the members of the relation, and all of its tags, and then use it the next time you need a new relation for something.<\/p>\n<p>user: What would be the potential harm of deleting relations?<\/p>\n<p>Well I suspect that sometimes, a deleted relation can end up as a &#8220;ghost&#8221; object, or a &#8220;stranded&#8221; object, in the render database. Meaning it&#8217;s truly been deleted from the API database (the main rails port) but that deletion fails to transfer correctly to the render database (which stores things in a different format, and doesn&#8217;t actually have &#8220;relations&#8221; at all, but rather transforms a relation them into a special type of &#8220;closed way&#8221; I think)<\/p>\n<p>By repurposing a relation instead of deleting it, you guarantee the render database will have to reclassify the linked object(s).<\/p>\n<p>If you just delete it, the render database might not handle the disappeared relation correctly, and just leave the no-longer-linked objects lying around.<\/p>\n<p>This is just speculation, because I don&#8217;t really understand it well. But just based on observed behavior<\/p>\n<p>In general, I think that the OSM software is not designed to handle mass deletions. That&#8217;s the key point.<\/p>\n<p>Because in OSM, who goes around deleting large number of objects? The real world doesn&#8217;t work that way.<\/p>\n<p>You re-tag things, yes. You might move things slightly, adjusting position to improve accuracy. But things in OSM don&#8217;t &#8220;disappear&#8221;<\/p>\n<p>Or if they do, they do so in very, very small sets. A building gets knocked down. A road gets torn out.<\/p>\n<p>One object at a time.<\/p>\n<p>So it seems very plausible to me that the OSM software actually hasn&#8217;t been designed to handle mass deletions, and hasn&#8217;t been tested for integrity in dealing with mass deletions.<\/p>\n<p>For years now, I&#8217;ve been telling people, when you decide to rearrange your territory (and what geofictician doesn&#8217;t sometimes decide to rearrange their territory?!) &#8230; it&#8217;s better to move things than to delete\/re-create things.<\/p>\n<p>This prevents &#8220;ghosts&#8221; in the render.<\/p>\n<p>In the long run, I suspect that we&#8217;ll have to just &#8220;reboot&#8221; the render now and then. But I&#8217;m not going to do it very often. (I mean &#8220;reboot&#8221; as in delete and re-create from zero, not &#8220;reboot&#8221; as in turn the machine off and on again &#8211; that happens every night).<\/p><\/blockquote>\n<p>I&#8217;d welcome comments on this rambling, vaguely rant-like discourse, for those who are knowledgeable about how the OSM apidb-to-renderdb pipeline works.<\/p>\n<p>Music to make deletions to: <a href=\"https:\/\/www.youtube.com\/watch?v=ZyCHumE9VXU\">10cm, &#8220;\uc624\ub298\ubc24\uc5d0.&#8221;<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This morning, I posted this in response to a query on the User Diaries at OpenGeofiction: General advice for all users: When deleting large numbers of objects, please be careful. This is not a use-case that the OSM software is designed to handle (think about it &#8211; mass deletions are NOT common on OSM). Divide &hellip; <a href=\"https:\/\/blog.geofictician.net\/index.php\/2021\/10\/07\/on-mass-deletions-in-ogf\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">On Mass Deletions in OGF<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,14],"tags":[],"class_list":["post-490","post","type-post","status-publish","format-standard","hentry","category-hrate","category-rants-and-general-complaints"],"_links":{"self":[{"href":"https:\/\/blog.geofictician.net\/index.php\/wp-json\/wp\/v2\/posts\/490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.geofictician.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.geofictician.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.geofictician.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.geofictician.net\/index.php\/wp-json\/wp\/v2\/comments?post=490"}],"version-history":[{"count":0,"href":"https:\/\/blog.geofictician.net\/index.php\/wp-json\/wp\/v2\/posts\/490\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.geofictician.net\/index.php\/wp-json\/wp\/v2\/media?parent=490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.geofictician.net\/index.php\/wp-json\/wp\/v2\/categories?post=490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.geofictician.net\/index.php\/wp-json\/wp\/v2\/tags?post=490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}