Using Nominatim for for Autocompletion might be not the best idea. If you using the osm.org nominatim Server the usage policy forbid using Nominatim for Autocompletion:
Auto-complete search: This is not yet supported by Nominatim and you must not implement such a service on the client side using the API.
Also it is not really useful to use Nominatim for ...
You could make a recursive function. Just typing Python-esque pseudo-code:
from geopy.exc import GeocoderTimedOut
def do_geocode(address, attempt=1, max_attempts=5):
if attempt <= max_attempts:
return do_geocode(address, attempt=attempt+1)
In the comments of the source code you linked there is an explanation:
@param key To access the openstreetmap API you need a valid API key. You can get it for free at https://developer.mapquest.com
For more info also see https://github.com/hrbrmstr/nominatim/issues/5
User_Agent is an http request header that is sent with each request.
Nominatim requires this value to be set to your application name. The goal is to be able to limit the number of requests per application.
Provide a valid HTTP Referer or User-Agent identifying the application
(stock User-Agents ...
You will have to create a new one. Nominatim requires a different database scheme than your rendering stack because it needs to perform really different queries. Using the same database for rendering and geocoding would be very inefficient, if possible at all.
It looks strange that you add both a GeoJSON layer from result.geojson and a marker created from [result.lat, result.lon].
If result.geojson contains the same point information as [result.lat, result.lon], you are adding both markers to your map.
Cool project! You might take a look at MapIt: Global:
MapIt is a service that maps geographical points to administrative areas. This edition is based on source data from the totally amazing OpenStreetMap project, so add your boundaries there if they’re missing. If you’re in the UK our MapIt UK with open Ordnance Survey data will probably be more useful.
Actually there isn't anything called an osm_id, at-least not officially.
In the OSM database, each node, relationship, way etc have a unique id.This uniqueness is only within a particular element type. i.e. there could be a node with id 1023, a relationship with id 1023 as well as a way with id 1023. These are often called the OSM ID for that particular ...
The problem you ran into has nothing to do with carto, it's an issue with your shell command, when you run sudo carto project.mml > OSMBright.xml carto runs as root, but the file write happens as your normal permission level, to do what your looking for you can sudo sh -c "carto project.mml > OSMBright.xml"
It says: The AppKey submitted with this request is invalid.
MapQuest changed their licensing model. Since Sep 15th, 2015, they require a valid API Key for their services. For more information read the related blog entry.
If the plugin doesn't offer a method for entering your own AppKey (or a custom Nominatim URL) then you will have to wait for the plugin ...
Nominatim is a geocoder and reverse-geocoder. You can search for an address and it will return the location. Likewise you can search for a location and it will return its full address hierarchy. Nominatim usually only returns address-related tags from OSM.
Overpass API instead can query for all tags in OSM. You can search for POIs, parking spaces, roads, ...
It would probably be cleaner to join the two PBF files before you do the load. Something like
osmosis --read-pbf file="countryA.pbf" --read-pbf file="countryB.pbf" --merge --write-pbf file="merged.pbf"
then just use merged.pbf for the load.
If you have more than that, you can just keep adding them, but you need a --merge for each one (so three countries ...
Based on Nominatim FAQ, there are many reasons of why your search didn't get any result:
Why wasn't anything found for my search?
There are a number of reasons why no result may have been found:
There is no data currently in OSM which matches your criteria. Data
which you expect to match may be defective in some way. For example,
if you ...
I have found the solution.
As the error suggests: the SSL in Python is not correctly installed.
If you go to /application/python(your version) and then click "Install Certificates.command" everything shall work.
Search-as-you-type is not possible in nominatim by design. It goes for exact matches of the search terms.
Photon is based on Apache Solr which provides a built-in spatial support. Little effort should be needed to enhance photon to provide a location bias. The basic idea is to rank the search results by distance to the bounding box.
I am the main ...
When there is a boundary relation for that city area (like political boundaries) you can use its name for a query via overpass-api or overpass-turbo.
So first find out about any good boundary relation within the OSM data:
go to http://nominatim.openstreetmap.org and try to find a boundary relation for your city ... for example type "Buxtehude" in its search ...
I have resolved this error:
The problem is still your pg_hba.conf file (/etc/postgresql/9.3/main/pg_hba.conf). This line:
local all postgres peer
local all postgres trust
After altering this file, don't forget to restart your PostgreSQL server. If you're ...
The purpose of a tile server is to deliver tiles (raster images).
If you want to geocode then use/install a geocoder, for example Nominatim. If you want to access raw data then use/install a service offering raw data, for example Overpass API.
Yep, seems like until they get a way to authenticate, OSM Place Search Plugin is not at option.
But, the good news, is that Quick Finder plugin does as good if not better, for finding locations, including the whole OSM point locations, so you can search for things like "target tacoma" or "bar asheville" and you'll get point locations for those items that ...
I guess the relationship is a bit tricky to discover. In fact i guess there is no relationship in the sense of OSM: I mean your building is not referenced as a member of the University of texas relation.
In a reproducible perspective, what you can do I such a case could be to perform an overpass query, based on the attribute fetched from the Nominatim ...
I discovered that the complexity of installing own instance of Nominatim can be mitigated by using a docker container where the set up script is already prepared.
I used a docker script available at https://github.com/helvalius/nominatim-docker. Then the installation is just the following:
git clone https://github.com/helvalius/nominatim-docker.git
Your browser and other HTTP/HTTPS clients will sent an Accept-Language field in the HTTP request header. This can for example look like:
Which means: prefer German (de-DE or de) with an quality value of 0.8, then US-English (en-US) with an quality value of 0.5 (i.e. lower than German), then English (...
No, it's not possible to recycle the database, as both tools do very different tasks and therefore they create very specific datastructures to run nice and smooth.
Please import another time your DB dump for mapnik, as explained here: www.switch2osm.org
It says here that the adress is calculate using a combination of admin boundaries, is_in tags and place features. For building level features addresses are calculated using the address of the most suitable street.
Also it says here that nominatim does not process addr:* tags on buildings.
The main OSM site also uses geonames database in searching, so it ...
Alright, when installing Nominatim a folder 'settings' is created, holding a PHP file named 'settings.php'. Within this file all sorts of constants are defined - also 'CONST_Postgresql_Version'.
Simply edit this file and change the value from 9.3 to 9.4 will overcome the initial error message.
by including the email parameter in my request, nominatim osm server acccepted that as a valid user agent.
$url = "http://email@example.com&format=xml&lat=-23.56320001&lon=-46.66140002&zoom=27&addressdetails=1";
Nominatim WIKI parameters
Use Zoom Level in query to get to higher level.
e.g At level 18 this place gives way which is street
and at zoom level 8 this gives relation which corresponds to country
I am posting the answer of my question for who need...
The disk space needed for whole planet is ~759G.
During the installation I face to disk space memory (see my post). After some check it came from logs (syslog.log and kernel.log ) that took a LOT of space (more than 400G). To avoid this issue I change the logrotate conf (and set the max size to 100M) ...
Take the link from iant's comment and click on details. On the database side, Nominatim calculates an address hierarchy. It does this by looking at address tags on the object, associatedStreet relation on the object if present, boundary relations containing the object in question, and places containing the object or being near it. And maybe more.