komoot / photon

an open source geocoder for openstreetmap data
Apache License 2.0
1.94k stars 285 forks source link

Polygon not returned as Search Result #259

Open nafis042 opened 7 years ago

nafis042 commented 7 years ago

Whenever I search a query it always returns as point but not polygon or linestring. I can see the osm_type="R", but in geometry field always shows type="point". how can I get these polygon as geometry?

dve commented 6 years ago

The polygon seems not to be saved in ES, according to https://github.com/komoot/photon/blob/master/src/main/java/de/komoot/photon/PhotonDoc.java. Nominatim seems to "know" the polygon: https://github.com/openstreetmap/Nominatim/blob/master/sql/tables.sql So it should be possible to store in ES and deliver it by the service.

Is this not done for a special reason, or did just no one needed the feature?

lonvia commented 6 years ago

Photon only exports the centroid and the bounding box of the geometry from Nominatim. Any polygon or way geometries are lost. Adding full geometries would increase the database size quite a bit.

ducdigital commented 6 years ago

is it possible to config Photon to load geometries in ES too?

kurko commented 6 years ago

Adding full geometries would increase the database size quite a bit.

Perhaps it'd make sense for an option to exist during importation so the user can decide on whether to import it or not.

GeorgeKontsevik commented 11 months ago

I sent the geocoded coordinate to nominatim to get the polygon. This combo worked quite well for me (since the nominatim is very picky for the input address format)