Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yofr4nk/search-osm-batch
Batch searching position info from openStreetMap with multiple places
https://github.com/yofr4nk/search-osm-batch
batching latitude longitude nodejs nominatim openstreetmap promises searching
Last synced: about 11 hours ago
JSON representation
Batch searching position info from openStreetMap with multiple places
- Host: GitHub
- URL: https://github.com/yofr4nk/search-osm-batch
- Owner: yofr4nk
- License: mit
- Created: 2018-08-22T11:25:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T19:31:33.000Z (about 2 years ago)
- Last Synced: 2024-04-25T15:02:59.816Z (9 months ago)
- Topics: batching, latitude, longitude, nodejs, nominatim, openstreetmap, promises, searching
- Language: JavaScript
- Size: 230 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Search-osm-batch
Based on [OpenStreetMap Nominatim](https://nominatim.openstreetmap.org/), to Batch searching multiple positions.- Reference taken from needs to get multiple positions info, the API accept only one position per request, with this library it can request many places with only array of them.
# How to use
- Import lib.
- The first argument is an array with places to search:
```
batchSearch(['Doctors Hospital of Augusta, 3651, Wheeler Road, Westwood', 'Miami International Airport'], {
format: 'json'
})
```
- The lib returns a Promise.# Options
- The second argument is a object with params to set in search request.
- There are many params to parse, some of them could be follows:## format:
- It will get a response with ```json | html | xml | jsonv2``` formats.## addressdetails [0|1]
- Include a breakdown of the address into elements.## limit
- Limit the number of returned results. Default is 10.## dedupe
- It will attempt to detect such duplicates and only return one match. Default is 1.## polygon_svg = 1
- Output geometry of results in svg format.# Example:
- The native request to Nominatim with only one allowed place is:
```
https://nominatim.openstreetmap.org/search/Berlin?format=json&addressdetails=1&limit=1&polygon_svg=1
```
- This lib lets build a smart query with an array of places and the option object with all of params allowed by Nominatim
- The Query could be:
```
batchSearch(['Berlin', 'Doctors Hospital of Augusta, 3651, Wheeler Road, Westwood', 'Miami International Airport'], {
format: 'xml',
addressdetails: 1,
limit: 1,
dedupe: 1,
polygon_svg: 1
})
```
- The response will be an array of info about places supplied.