jeremiehuchet / nominatim-java-api Goto Github PK
View Code? Open in Web Editor NEWNominatim search API client written in Java
License: GNU Lesser General Public License v3.0
Nominatim search API client written in Java
License: GNU Lesser General Public License v3.0
Hi,
I wanted to know how can I update nominatim without setting this line in settings/local.php :
@define('CONST_Replication_Url', 'https://planet.openstreetmap.org/replication/minute');
I mean I don't want to sync with osm, I want to update nominatim whenever I would like.
for example I have a osm data for two months ago, now I want to update them. but I don't know if I set replicarion service with above value, all data are updated from two months ago until now ?
how can I sure that updating process is correct ?
better to use this address ?
http://download.geofabrik.de/europe-updates/
Thanks in Advance
Pull request #17 point a bug in QueryParameterAnnotationHandler
which doesn't format strings correctly.
@QueryParameter("limit=%d")
private Integer limit;
should be sucessfully transformed to limit=12345
instead of throwing IllegalFormatConversionException
.
Hello,
I would like to ask if you can add the "ref" tag in the address model.
The others (osm_type, osm_id) are already implemented in 2.0.2, but the ref isn't and it sometimes contains information about roadnumbers where the road tag in addressparts always returns the name of the street if available.
I would like to display both the roadnumber as the name of the street.
Kind regards,
Qlubbie
Edit never mind. we did some testing and the json result doesn't contain the ref element. The xml-response does, but thats a nominatim thing. apologies.
Hi! It seems place_id is long, not int.
Please try the following address: "ул. Евдокимова,37, Ростов-на-дону" (It is in cyrillic).
at the first time when I find the following contruction method of JsonNominatimClient, I feel very happy. Because, in my thought, I can set NominatimOptions for my request in the way. However, the NominatimOptions defaults
just work for search(final String query)
. So although I have set a NominatimOptions
, I still need to set the accept-language and ploygon_json.
public JsonNominatimClient(final HttpClient httpClient, final String email, final NominatimOptions defaults) {
this(DEFAULT_BASE_URL, httpClient, email, defaults);
}
@Override
public List<Address> search(final String query) throws IOException {
final NominatimSearchRequest q = new NominatimSearchRequest();
defaults.mergeTo(q);
q.setQuery(query);
return this.search(q);
}
@Override
public List<Address> search(final NominatimSearchRequest search) throws IOException {
final String apiCall = String.format("%s&%s", searchUrl, search.getQueryString());
LOGGER.debug("search url: {}", apiCall);
final HttpGet req = new HttpGet(apiCall);
return httpClient.execute(req, defaultSearchResponseHandler);
}
Hi,
I would like to use your nominatim java api in my Android Java app.
Would you have some sample code of how to use it that you could popint me to?
Thanks,
Alex Donnini
Hello,
I noticed that in the current version (2.0.2) it's impossible to set the accept-language.
I would like to ask if you could implement that.
Kind regards,
Qlubbie
#28 introduces a new library built with JDK7.
Oracle has dropped support for JDK 6 in 2013.
Client does not allow to obtain namedetails.
Steps to resolve issue:
Hi there,
Do you provide a commercial license (dual license) for this library? The reason I'm asking is that the GPL license that you are using reduces the number of potential users as the library cannot be used in commercial (closed-source) projects. Is there a specific reason that you are using the GPL license instead of the less restrictive LGPL license?
Users in not US locale can get , insted . when parsing double.
@OverRide
public String handle(final Object value) {
if (value instanceof Double) {
return String.format(Locale.US, "%f", (Double) value);
} else {
throw new IllegalArgumentException("Can't serialize anything but Double");
}
}
Currently the pom.xml includes gson 2.8.5, however geogson-jts has a (transitive) dependency on gson 2.6.2. If you could exclude gson from geogson-jts that'd be good.
Hi,
When performing a search using version 3.2, getAddressElements() returns null for an Address object. Otherwise when calling lookup(), getAddressElements() is functional.
The nominatim geocoding service at nominatim.openstreetmap.org is available over https, and will soon start redirecting all http requests to https.
Some java http libraries don't follow redirects by default.
Would it please be possible to make all nominatim requests over https?
Hello,
Could you please release 3.0 and push it to Maven central ?
That would allow users to benefit from the latest changes (since May 2013)
thanks
The west/north and east/south bounding box values are switched when deserializing the bounding box JsonArray
When Address class object is deserialized from JSONv2 received from server field elementClass is always null.
SerializedName is wrong, currently used = 'class' is correct for JSON but now JSONv2 is used where that field was renamed to 'category'.
@QueryParameter(value = "address=%s", serializer = BooleanSerializer.class)
private Boolean address;
should be
@QueryParameter(value = "addressdetails=%s", serializer = BooleanSerializer.class)
private Boolean address;
otherwise no address details are returned.
fr.dudie.nominatim.client.NominatimClient mentions in line 22 as a comment " * Interface to use the Google Maps Service.", which, I hope, is wrong. Should be Nominatim instead ;)
Hello & thanks for the great library!
Nominatim requests, as part of the terms of service, to cache results in order to avoid waste of computational resources.
Unfortunatly, the current version of Address object is not serializable.
Would it is possible to consider to make it implement Serializable ?
Tks !
I am a not so experienced Java Developer and i want to use this Library.
I am currently looking through the Javadoc to find out which classes to use.
I guess that at least one code Example would be very helpful to a lot of users who are not that familiar with the library classes.
If anyone does have a working tutorial for this Library please link it. Thanks !
Remove QueryParameterAnnotationHandler
, it's overkill to use java.lang.reflect
API to generate the HTTP URLs.
Hello the code is deprecated, a few exemple here :
final SchemeRegistry registry = new SchemeRegistry();
registry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
final ClientConnectionManager connexionManager = new SingleClientConnManager(null, registry);
final HttpClient httpClient = new DefaultHttpClient(connexionManager, null);
Become now :
static CloseableHttpClient httpClient = HttpClients.createDefault();
Thanks for the great work, i hope for an update anti legacy.
Allow API URL customization to parameterize searches.
All test in JsonNominatimClientTest.java a currently failing on branch master and release 3.3. I believe this may be related to #32 as the errors reference HTTPS (and the lack thereof).
The initial error was java.lang.IllegalStateException: Scheme 'https' not registered
. I attempted to resolve this by switching the scheme and URL in the test file to https. This caused a new error org.apache.http.client.ClientProtocolException
caused by org.apache.http.client.CircularRedirectException: Circular redirect
. Finally, I tried allowing the client to follow circular redirects by adding
httpClient.getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true);
to the constructor of the test class. This only caused a different error: org.apache.http.client.ClientProtocolException
caused by org.apache.http.client.RedirectException: Maximum redirects (100) exceeded
.
Outputs for my test runs are linked below:
scheme_https_not_registered.txt
max_redirect.txt
circ_redirect.txt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.