whosonfirst / whosonfirst-www-api

4 stars 2 forks source link

getHierarchiesByLatLon says 37.8376611,-122.479377 is in San Francisco, but it isn't #67

Open simonw opened 6 years ago

simonw commented 6 years ago

http://whosonfirst-api.mapzen.com/?method=whosonfirst.places.getHierarchiesByLatLon&latitude=37.8376611&longitude=-122.47937719999999&api_key=mapzen-XXX&spr=1

{
    "hierarchies": [
        {
            "region": {
                "wof:id": 85688637,
                "wof:parent_id": "85633793",
                "wof:name": "California",
                "wof:placetype": "region",
                "wof:country": "US",
                "wof:repo": "whosonfirst-data"
            },
            "continent": {
                "wof:id": 102191575,
                "wof:parent_id": "-1",
                "wof:name": "North America",
                "wof:placetype": "continent",
                "wof:country": "",
                "wof:repo": "whosonfirst-data"
            },
            "country": {
                "wof:id": 85633793,
                "wof:parent_id": "102191575",
                "wof:name": "United States",
                "wof:placetype": "country",
                "wof:country": "US",
                "wof:repo": "whosonfirst-data"
            },
            "locality": {
                "wof:id": 85922583,
                "wof:parent_id": "102087579",
                "wof:name": "San Francisco",
                "wof:placetype": "locality",
                "wof:country": "US",
                "wof:repo": "whosonfirst-data"
            },
            "county": {
                "wof:id": 102087579,
                "wof:parent_id": "85688637",
                "wof:name": "San Francisco",
                "wof:placetype": "county",
                "wof:country": "US",
                "wof:repo": "whosonfirst-data"
            },
            "neighbourhood": {
                "wof:id": 85820267,
                "wof:parent_id": "85922583",
                "wof:name": "Fort Winfield Scott",
                "wof:placetype": "neighbourhood",
                "wof:country": "US",
                "wof:repo": "whosonfirst-data"
            }
        },
        {
            "continent": {
                "wof:id": 102191575,
                "wof:parent_id": "-1",
                "wof:name": "North America",
                "wof:placetype": "continent",
                "wof:country": "",
                "wof:repo": "whosonfirst-data"
            },
            "region": {
                "wof:id": 85688637,
                "wof:parent_id": "85633793",
                "wof:name": "California",
                "wof:placetype": "region",
                "wof:country": "US",
                "wof:repo": "whosonfirst-data"
            },
            "country": {
                "wof:id": 85633793,
                "wof:parent_id": "102191575",
                "wof:name": "United States",
                "wof:placetype": "country",
                "wof:country": "US",
                "wof:repo": "whosonfirst-data"
            },
            "neighbourhood": {
                "wof:id": 1108832187,
                "wof:parent_id": "-1",
                "wof:name": "Fort Baker",
                "wof:placetype": "neighbourhood",
                "wof:country": "US",
                "wof:repo": "whosonfirst-data"
            },
            "county": {
                "wof:id": 102084353,
                "wof:parent_id": "85688637",
                "wof:name": "Marin",
                "wof:placetype": "county",
                "wof:country": "US",
                "wof:repo": "whosonfirst-data"
            }
        }
    ],
    "stat": "ok"
}

That's this point here: https://www.google.com/maps/search/37.8376611,-122.479377

cursor_and_37 50_15_6_n_122 28_45_8_w_-_google_maps

That's definitely not in San Francisco, so that first returned hierarchy (around Fort Winfield Scott) appears to be incorrect. I'm not sure if this is an API bug or a data bug or both.

nvkelso commented 6 years ago

Looks like the API is (incorrectly) PIPing using a deprecated feature's polygon.

That particular feature is superseded, and the new feature's polygon is correctly in SF. The old feature was wrong on several different levels! I don't think we backfilled a new feature polygon there, so I'd only expect Marin to be returned as the init feature hierarchy for that lat/lng.

Deprecated features shouldn't be available for PIPing by default (unless deprecated features are allowed in a request param?).

thisisaaronland commented 6 years ago

This is the same problem as https://github.com/whosonfirst/whosonfirst-www-api/issues/63

The short-term solution is to request ?extras=edtf: and filter on things with a non-null or non-uuuu (it's an EDTF thing...) cessation or deprecated date.