pelias / wof-admin-lookup

Who's on First Admin Lookup for the Pelias Geocoder
https://pelias.io
MIT License
9 stars 24 forks source link

Incorrect locality interpolation #287

Open ambrusadrianz opened 4 years ago

ambrusadrianz commented 4 years ago

Hey team!

I was using your awesome geocoding engine when I noticed something interesting. Let me tell you more about it.


Here's what I did :innocent:

https://pelias.github.io/compare/#/v1/autocomplete%3Flayers=street&focus.point.lat=59.4391&focus.point.lon=17.9415&text=granva&size=1


Here's what I got :scream_cat:

{
  "geocoding": {
    "version": "0.2",
    "attribution": "http://api.yourpelias.com/attribution",
    "query": {
      "text": "granva",
      "parser": "pelias",
      "parsed_text": {
        "subject": "granva"
      },
      "size": 1,
      "layers": [
        "street"
      ],
      "private": false,
      "focus.point.lat": 59.4391,
      "focus.point.lon": 17.9415,
      "lang": {
        "name": "English",
        "iso6391": "en",
        "iso6393": "eng",
        "defaulted": false
      }
    },
    "engine": {
      "name": "Pelias",
      "author": "Mapzen",
      "version": "1.0"
    },
    "timestamp": 1582112887879
  },
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          17.950292,
          59.413714
        ]
      },
      "properties": {
        "id": "polyline:481559",
        "gid": "openstreetmap:street:polyline:481559",
        "layer": "street",
        "source": "openstreetmap",
        "source_id": "polyline:481559",
        "name": "Granvägen",
        "street": "Granvägen",
        "distance": 2.869,
        "accuracy": "centroid",
        "country": "Sweden",
        "country_gid": "whosonfirst:country:85633789",
        "country_a": "SWE",
        "region": "Stockholm",
        "region_gid": "whosonfirst:region:85688429",
        "region_a": "ST",
        "county": "Stockholm",
        "county_gid": "whosonfirst:county:1159303035",
        "localadmin": "Vantor",
        "localadmin_gid": "whosonfirst:localadmin:1125362217",
        "locality": "Stockholm",
        "locality_gid": "whosonfirst:locality:101752307",
        "neighbourhood": "Kista",
        "neighbourhood_gid": "whosonfirst:neighbourhood:85902231",
        "continent": "Europe",
        "continent_gid": "whosonfirst:continent:102191581",
        "label": "Granvägen, Stockholm, Sweden"
      },
      "bbox": [
        17.949897,
        59.412975,
        17.951959,
        59.414611
      ]
    }
  ],
  "bbox": [
    17.949897,
    59.412975,
    17.951959,
    59.414611
  ]
}

Here's what I was expecting :sparkles:

Something seems to be off with the lookup. This street should be in Sollentuna locality (kommun) not in Stockholm.

missinglink commented 4 years ago

Hi @ambrusadrianz, this record was associated with Stockholm because the lat/lon is contained within this polygon https://spelunker.whosonfirst.org/id/101752307/

I'm not familiar with Stockholm geography, is this shape not correct?

missinglink commented 4 years ago

We also have this polygon https://spelunker.whosonfirst.org/id/1125772423/

missinglink commented 4 years ago

this tool illustrates some of the upcoming functionality of our new spatial service: https://spatial.synergy.io/explore/pip#13/59.413714/17.950292

ambrusadrianz commented 4 years ago

I'm not really familiar with Stockholm geography neither. I just happen to work on a project which needs geocoding for Sweden.

Sollentuna is just a locality inside Stockholm county as far as I know. So this Stockholm polygon might be too broad.

OpenstreetMap Nominatim seems to get this right. query for granvagen

ambrusadrianz commented 4 years ago

The problem might be with the WOF locality placeType classification. Because this seems more like Stockholm county.

missinglink commented 4 years ago

We don't currently use OSM boundary data, although this is on the roadmap.

If you compare the records from WOF and OSM you'll find that they are very similar:

Some options for you:

ambrusadrianz commented 4 years ago

The new spatial service looks really cool. I will check it out. Keep up the good work 👍

Seems like the WOF classification for that area is too broad, I will put an issue on WOF to see what they think.

Do you have a roadmap for the spatial service?

ambrusadrianz commented 4 years ago

@missinglink this can be closed I think. Added one on WOF: https://github.com/whosonfirst-data/whosonfirst-data/issues/1794

Thanks for the fast responses 👍