whosonfirst / py-mapzen-whosonfirst-export

Export tools for the Who's On First documents
BSD 3-Clause "New" or "Revised" License
2 stars 3 forks source link

Adding wof:placetype_alt values to wof:hierarchy #14

Open stepps00 opened 6 years ago

stepps00 commented 6 years ago

Fixes #12.

I tested this change locally with files that had a wof:placetype_alt property.

The new logic will place the wof:placetype_alt placetype into a record's wof:hierarchy, with a value equal to that record's placetype.

For example, if a locality record has a wof:placetype_alt of "neighbourhood", the wof:hierarchy would change from:

    "wof:hierarchy":[
        {
            "continent_id":102191575,
            "country_id":85633793,
            "county_id":102087579,
            "locality_id":85922583,  <--
            "region_id":85688637
        }
    ],

to:

    "wof:hierarchy":[
        {
            "continent_id":102191575,
            "country_id":85633793,
            "county_id":102087579,
            "locality_id":85922583,  <--
            "neighbourhood_id":85922583,  <--
            "region_id":85688637
        }
    ],

# -*- coding: utf-8 -*- was added to line 1 due to this error when testing:

 Traceback (most recent call last):
  File "../Desktop/test_hier_build.py", line 6, in <module>
    import export
  File "../py-mapzen-whosonfirst-export/mapzen/whosonfirst/export/__init__.py", line 273
SyntaxError: Non-ASCII character '\xe2' in file /../py-mapzen-whosonfirst-export/mapzen/whosonfirst/export/__init__.py on line 273, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
stepps00 commented 6 years ago

Tagging @thisisaaronland for review.