Automated edits/pnorman

From OpenStreetMap Wiki
Jump to navigation Jump to search

Mechanical edits conducted by pnorman

Repeated empty relation cleanup

Proposed repeated cleanup of v1 relations with no members more than two days old.

Procedure: Generate a list of relations from a pgsnapshot database, load in JOSM, select relations, delete. Intervene manually on any that are children of other relations.

Account to be used: pnorman_mechanical

SELECT r.id 
  FROM relations r 
    LEFT JOIN relation_members rm ON (r.id=rm.relation_id) 
  WHERE tags = ''::hstore 
    AND version=1 
    AND rm.relation_id IS NULL
    AND tstamp < now() - interval '2 days ago';

GVRD CanVec surface correction

Once-off correction of surface=* tagging for CanVec/geobase ways.

basic procedure: download [highway=service][surface=unpaved][source=Geobase_Import_2009] and select version 1 ways by importers. delete surface=unpaved. select modified. delete unnecessary meta-data as described in the email

See https://lists.openstreetmap.org/pipermail/talk-ca/2012-April/004664.html for details.

Empty relations 1

Proposed one-time cleanup of empty relations

Target relations: Those with no members and either no tags or just type=multipolygon

Procedure: identify relations with no members with the SQL

SELECT * FROM relations LEFT JOIN relation_members ON id = relation_id WHERE relation_id IS NULL AND 
(tags=hstore(array[]::varchar[]) or tags=hstore('type','multipolygon')) AND 
tstamp < TIMESTAMP 'now' - INTERVAL '1 day'

Download list of relations in JOSM. Delete relations. If they are members of other relations they will be investigated.

Discussion: https://lists.openstreetmap.org/pipermail/talk/2012-July/063716.html

No replies after asking for uses for these relations, but deleting starting from oldest.


Final sql:

SELECT * FROM relations 
LEFT JOIN relation_members as children ON id = children.relation_id 
LEFT JOIN relation_members AS parents ON (id = parents.member_id AND parents.member_type = 'R') 
WHERE parents.relation_id is NULL AND children.relation_id IS NULL AND
(tags=hstore(ARRAY[]::VARCHAR[]) OR tags=hstore('type','multipolygon')) AND
tstamp < TIMESTAMP 'now' - INTERVAL '1 day'
ORDER BY tstamp;

NHN Tag cleanup

Remove accuracy:meters, attribution, oneway, waterway:type, sub_sea:type

Turn connector ways into waterway=*

Turn rivers into waterway=river

Full details at https://lists.openstreetmap.org/pipermail/talk-ca/2011-February/003715.html