mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
Merge pull request #3648 from lonvia/extratags-for-geocodejson
Enable output of extratags for geocodejson format
This commit is contained in:
@@ -106,8 +106,11 @@ The following feature attributes are implemented:
|
|||||||
* `name` - localised name of the place
|
* `name` - localised name of the place
|
||||||
* `housenumber`, `street`, `locality`, `district`, `postcode`, `city`,
|
* `housenumber`, `street`, `locality`, `district`, `postcode`, `city`,
|
||||||
`county`, `state`, `country` -
|
`county`, `state`, `country` -
|
||||||
provided when it can be determined from the address
|
provided when it can be determined from the address (only with `addressdetails=1`)
|
||||||
* `admin` - list of localised names of administrative boundaries (only with `addressdetails=1`)
|
* `admin` - list of localised names of administrative boundaries (only with `addressdetails=1`)
|
||||||
|
* `extra` - dictionary with additional useful tags like `website` or `maxspeed`
|
||||||
|
(only with `extratags=1`)
|
||||||
|
|
||||||
|
|
||||||
Use `polygon_geojson` to output the full geometry of the object instead
|
Use `polygon_geojson` to output the full geometry of the object instead
|
||||||
of the centroid.
|
of the centroid.
|
||||||
|
|||||||
@@ -249,6 +249,9 @@ def format_base_geocodejson(results: Union[ReverseResults, SearchResults],
|
|||||||
out.keyval(f"level{line.admin_level}", line.local_name)
|
out.keyval(f"level{line.admin_level}", line.local_name)
|
||||||
out.end_object().next()
|
out.end_object().next()
|
||||||
|
|
||||||
|
if options.get('extratags', False):
|
||||||
|
out.keyval('extra', result.extratags)
|
||||||
|
|
||||||
out.end_object().next().end_object().next()
|
out.end_object().next().end_object().next()
|
||||||
|
|
||||||
out.key('geometry').raw(result.geometry.get('geojson')
|
out.key('geometry').raw(result.geometry.get('geojson')
|
||||||
|
|||||||
Reference in New Issue
Block a user