-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
map GeoNames feature codes to the Pelias categories taxonomy (#20) #22
Conversation
taxonomy.yaml -Add a first iteration of the geonames-to-pelias taxonomy mapping. -Currently a YAML file for human-writable convenience, will be converted to JSON later on. -Needs another look-over to revise some mappings/fill in missing ones.
taxonomy.yaml -Perform a second pass over the GeoNames taxonomy, tweaking some mappings added in 4f47082 and filling in empty ones. Roughly done, now.
taxonomy.yaml -Remove any GeoNames categories without corresponding categories in the Pelias taxonomy.
taxonomy.yaml -> metadata/taxonomy_mapping.json -YAML was initially used because it's much easier to handwrite than JSON. Now that the taxonomy mapping is complete, convert it to JSON.
"taxonomy" is less clear than "category".
task/import.js -Use the `category_mapping.json` file added in 4663087 to map geonames records' feature-codes to Pelias categories, and set them on `Document` objects.
test_cases/categories.json -Add a bunch of test-cases for the addition of categories to GeoNames data (see [0]). -They aren't actually usable until the API can return categories, so must wait until [1] gets merged. 0: pelias/geonames#22 1: pelias/api#122
what do you see as the semantic difference between let's discuss further on a unified strategy. |
Looks like I missed I departed from the OSM schema in some places, introducing categories like |
The idea is to provide a unified taxonomy, so things like https://github.com/pelias/openstreetmap/blob/master/config/category_map.js#L264 need to both map to the same pelias category. In order to be consistent we need to either change the |
Totally agree, we need to discuss the new categories before this gets merged. |
As per these changes to the taxonomy, we've decided to add top-level keys
|
metadata/category_mapping.json -`agriculture` was mistakenly used as a top-level category in some places; as per #22 (comment), replace all such occurrences with `industry:agriculture`.
metadata/category_mapping.json -Some of the Geonames categories also fall under the category of `finance`.
metadata/category_mapping.json -As per #22 (comment), use `education` instead of `academic`.
metadata/category_mapping.json -Some category sets with the `industry:agriculture` category were missing the superset `industry` category. Add it.
👍 |
metadata/category_mapping.json -Typo in a category... oops.
looks good 👍 |
peliasCategories.forEach( function ( category ){ | ||
try { | ||
record.addCategory( category ); | ||
} catch ( ex ) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably log this error
task/import.js -Log `addCategory()` errors. -Use `hasOwnProperty()` for greater readability. -cc @dianashk
👍 |
Map the extensive geonames feature codes onto the Pelias taxonomy.
metadata/category_mapping.json
(mostly uses the same keys as openstreetmap, but there are some new ones likeadmin
,industry
,academic
,natural:water
)Document
categories intask/import.js
fixes #20