mapzen / metro-extracts

DEPRECATED. See readme for alternative ways to get "city-sized chunks" of OpenStreetMap data
ISC License
25 stars 27 forks source link

Do not treat non-WoF places as WoF #207

Closed migurski closed 8 years ago

migurski commented 8 years ago

We are making incorrect requests to the /wof GeoJSON endpoint, based on non-WoF IDs. Check that a place ID is actually from Who's On First before attempting to show the outline in the search UI, or passing on its ID to make an ODES request.

To reproduce, search for "New Haven" and select the locality:

screen shot 2016-08-01 at 5 00 05 pm

That locality is actually from GeoNames, and leads to this request: https://search.mapzen.com/v1/place?api_key=search-owZDPeC&ids=geonames:locality:4839366

Which generates this bad request: https://mapzen.com/data/metro-extracts-alt/wof/4839366.geojson

We can tell the ID won't work and the place is not in Who's On First, because the first Mapzen Search response has these properties:

        "properties": {
            "id": "4839366",
            "gid": "geonames:locality:4839366",
            "layer": "locality",
            "source": "geonames",
            "source_id": "4839366",
            "name": "New Haven",

We instead need to look for a WoF source, like this:

        "properties": {
            "id": "85921899",
            "gid": "whosonfirst:locality:85921899",
            "layer": "locality",
            "source": "whosonfirst",
            "source_id": "85921899",
            "name": "Fremont",