Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose bounding boxes in results where appropriate #12

Closed
mojodna opened this issue Jul 6, 2014 · 3 comments
Closed

Expose bounding boxes in results where appropriate #12

mojodna opened this issue Jul 6, 2014 · 3 comments

Comments

@mojodna
Copy link

mojodna commented Jul 6, 2014

When using a geocoder to jump to a particular location, bounding boxes are useful to appropriately set the viewport's zoom level. Assuming that Pelias stores them in ES, would it be possible to expose them in the API results?

Nominatim exposes boundingbox, e.g. http://nominatim.openstreetmap.org/search?q=Brooklyn&format=json:

{
  "place_id": "5988439137",
  "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
  "osm_type": "node",
  "osm_id": "158857828",
  "boundingbox": [
    "40.6501007080078",
    "40.6501045227051",
    "-73.9495849609375",
    "-73.949577331543"
  ],
  "lat": "40.6501038",
  "lon": "-73.9495823",
  "display_name": "Brooklyn, Downtown Brooklyn, Kings County, New York City, New York, United States of America",
  "class": "place",
  "type": "suburb",
  "importance": 0.79454442710904,
  "icon": "http://nominatim.openstreetmap.org/images/mapicons/poi_place_village.p.20.png"
}

In Pelias' case, it would probably make sense to expose the bounding box in addition to the point geometry. GeoJSON's bbox looks appropriate for this.

@amnesia7
Copy link

Any news on the inclusion of bounding box extents in the API response?

This would be very useful for zooming to locations more appropriately.

This was referenced Nov 23, 2014
@missinglink
Copy link
Member

You may still be using the 'old' ruby version of Pelias. The current docs relate to the 'new' nodejs version.

It was a pretty simple feature so I just opened a PR, it should land on pelias.mapzen.com in the next couple of weeks.

see: pelias/api#43

@amnesia7
Copy link

Great, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants