boundary=place is valid
Example: 51.4564, -0.6486 -> Windsor (Q464955)
This commit is contained in:
parent
5dbb50ed34
commit
b700f88da6
|
@ -54,6 +54,7 @@ class Polygon(Base):
|
||||||
q = cls.query.filter(
|
q = cls.query.filter(
|
||||||
or_(
|
or_(
|
||||||
cls.boundary == "political",
|
cls.boundary == "political",
|
||||||
|
cls.boundary == "place",
|
||||||
and_(
|
and_(
|
||||||
cls.admin_level.isnot(None), # type: ignore
|
cls.admin_level.isnot(None), # type: ignore
|
||||||
cls.admin_level.regexp_match(r"^\d+$"), # type: ignore
|
cls.admin_level.regexp_match(r"^\d+$"), # type: ignore
|
||||||
|
|
|
@ -134,7 +134,7 @@ def osm_lookup(
|
||||||
assert e.tags
|
assert e.tags
|
||||||
tags: typing.Mapping[str, str] = e.tags
|
tags: typing.Mapping[str, str] = e.tags
|
||||||
admin_level: int | None = get_admin_level(tags)
|
admin_level: int | None = get_admin_level(tags)
|
||||||
if not admin_level and tags.get("boundary") != "political":
|
if not admin_level and tags.get("boundary") not in ("political", "place"):
|
||||||
continue
|
continue
|
||||||
if not (
|
if not (
|
||||||
(hit := hit_from_wikidata_tag(tags))
|
(hit := hit_from_wikidata_tag(tags))
|
||||||
|
|
Loading…
Reference in a new issue