graphhopper / geocoder-converter

Converts arbitrary geocoding responses to a GraphHopper response
https://graphhopper.com/api/1/docs/geocoding/#external-providers
Apache License 2.0
9 stars 11 forks source link

Add support for Extent #38

Closed boldtrn closed 6 years ago

boldtrn commented 6 years ago

Nominatim returns a boundingbox which seems similar to the extent.

boundingbox: [
"47.4780623",
"47.8175234",
"8.8593204",
"9.7538633",
],

OpenCageData returns bounds, which could be converted to the extent.

"bounds": {
        "northeast": {
          "lat": 48.1799218,
          "lng": 11.5961796
        },
        "southwest": {
          "lat": 48.1399218,
          "lng": 11.5561796
        }
      }

I think there is no option for Gisgraphy.

gisgraphy commented 6 years ago

yes, Gisgraphy doesn't return this.

karussell commented 6 years ago

There is a problem that the response somehow is 'recursive'

"extent":{"extent":[13.2288599,52.3570365,13.5488599,52.6770365]}

Related issue: https://github.com/graphhopper/graphhopper/issues/1325

The result should be just like this?

"extent":[13.2288599,52.3570365,13.5488599,52.6770365]
boldtrn commented 6 years ago

Thanks for finding this. This indeed looks wrong. I think in this case the class Extent helps a lot. Jackson offers the annotation @JsonUnwrapped, which avoids creating "extent":{} but only creates all properties of the Extend class. I created a PR #47.