Commit graph

142 commits

Author SHA1 Message Date
Tom Hughes
1859728558 Merge remote-tracking branch 'upstream/pull/4984' 2024-07-14 15:40:39 +01:00
Anton Khorev
7917a7db80 Parse lat and lon independently when using dms notation 2024-07-13 17:52:39 +03:00
Anton Khorev
a082caef3c Use casecmp?() instead of casecmp().zero? 2024-07-13 16:00:45 +03:00
Tom Hughes
29dba7318a Use bigdecimal to avoid scientfic notation in DMS decoding 2024-07-12 14:43:33 +01:00
Tom Hughes
e5057dd57a Use named captures to simplify latlon parsing 2024-07-12 14:43:32 +01:00
Tom Hughes
f047f86c1d Preserve lat and lon values as entered for reverse searches 2024-07-12 12:04:16 +01:00
Anton Khorev
0d2010cd2f Remove "whereami" search parameter, use "lat" and "lon" instead 2024-07-06 16:56:49 +03:00
nertc
4b593412c2 Accept coordinates with a slash in search 2024-07-02 23:48:55 +04:00
Tom Hughes
271384e683 Simplify handling of geocoder URLs
This avoids having to build them in multiple places and also
ensures we link to what was actually searched rather than some
random string from the locale file.
2024-06-25 17:57:38 +01:00
Nenad Vujicic
839d203d51 Added link to nominatim results in searching results
Fixes #3205. Added caching of nominatim URL query parameters in sources global variable (as parameters parameter) in GeocoderController#search for both direct and reverse geocoding. In app/views/geocoder/search.html.erb added displaying cached URL as forwarding link when clicked on "OpenStreetMap Nominatim" label. Updated GeocoderControllerTest to check only name (latlng, osm_nominatim, osm_nominatim_reverse) parameter of new sources variable.
2024-06-19 15:44:56 +02:00
Tom Hughes
a11679d3eb Take exclude_place_ids from Nominatim results directly
Fixes #4137
2023-08-08 18:27:53 +01:00
Tom Hughes
0571802b31 Remove accidental commit 2023-03-12 17:53:30 +00:00
Tom Hughes
35c59bff0d Fix "load more" button on search results
Fixes #3969
2023-03-12 17:52:39 +00:00
Richard Fairhurst
b7887b049f Remove Geonames and geocoder.ca 2023-01-09 21:23:48 +00:00
Tom Hughes
dc28f1dccc Fix new rubocop warnings 2022-11-22 18:32:02 +00:00
Tom Hughes
fa93526f76 Use nominatim_url setting more consistently 2022-09-07 08:45:27 +01:00
Andy Allan
561ee71129 Rubocop autofix: ambiguous operator precedence
This simply adds braces to clarify which mathematical operator comes
first.
2022-04-06 14:55:29 +01:00
Tom Hughes
cfb4a70129 Fix Lint/DuplicateBranch rubocop warnings 2022-03-08 19:05:37 +00:00
Tom Hughes
8e8f6ef990 Attempt to avoid polynomial time matches on user supplied data 2022-01-05 18:38:15 +00:00
Tom Hughes
0654be27f9 Fix new rubocop warnings 2021-01-11 19:17:31 +00:00
Sarah Hoffmann
a7b95e2a63 Improve guessing of labels for Nominatim results
This adapts to two changes in place handling by Nominatim:

* Place links that are computed by Nominatim are now found in
  extratags['linked_places']. Keep the check for extratags['place']
  as this may contain an explicitly mapped place label.
* Use address rank for guessing the admin level. This gets normalised
  by Nominatim with respect to country-specific use of admin_level.

Also adds additional labels for admin levels, so that we now have
complete coverage for all levels that are in use in OSM.
2020-12-01 22:52:40 +01:00
Tom Hughes
0e2a66e8de Fix new rubocop warnings 2020-08-06 18:42:16 +01:00
Tom Hughes
9f57f60b87 Fix new rubocop warnings 2019-04-23 09:33:34 +01:00
Tom Hughes
dcfe326f65 Merge remote-tracking branch 'upstream/pull/2175' 2019-03-26 19:14:04 +00:00
Tom Hughes
d6af4450d1 Prefer String#match? over butt ugly Regexp#match? 2019-03-26 19:12:18 +00:00
Andy Allan
d102c9aaf4 Move all settings to settings.yml
We leave the STATUS setting alone, since it's required before rails
boots. The test-specific settings now live in config/settings/test.yml
2019-03-13 18:06:23 +01:00
Andy Allan
1ca77d6dda Rubocop fixes for ruby 2.5 2019-03-13 10:33:33 +01:00
Andy Allan
89399c5ba1 Add missing authorize_resource declaration to geocoder controller 2019-01-09 10:14:52 +01:00
Ilya Zverev
67925e6d98 Do not display two coordinates on 'where am I' click
Closes #1968
2018-09-03 17:46:26 +01:00
Tom Hughes
08f0621d6f Tidy whitespace 2018-08-28 17:56:34 +01:00
Ilya Zverev
a46ecae757 Reverse coordinates order only when called with two nondescript numbers 2018-08-28 15:16:26 +03:00
Ilya Zverev
d9d51fce9b Add parsing coordinates in lon, lat format 2018-08-27 14:06:17 +03:00
Tom Hughes
5925039729 Remove npemap as a source for UK postcodes 2018-02-04 15:14:41 +00:00
Tom Hughes
a83030dab7 Fix new rubocop warnings 2018-01-22 18:55:45 +00:00
Tom Hughes
be86e4824f Convert various URLs to https 2018-01-08 20:18:21 +00:00
Tom Hughes
af1397436f Use https for nominatim 2018-01-08 10:50:44 +00:00
Tom Hughes
b77406ff38 Use decoded strings when parsing XML responses from geocoders
Fixes #1690
2017-11-29 23:07:19 +00:00
Tom Hughes
8dae890a76 Fix rubocop warnings 2017-10-05 19:18:38 +01:00
Tom Hughes
6209a9be78 Drop geocoder.us from search engines
Fixes #1633
2017-09-25 22:52:03 +01:00
Tom Hughes
339d8e46ff Sanitise parameters used in URL generation 2017-06-04 20:24:53 +01:00
Tom Hughes
80d27a7fae Sanitise parameters used in URL generation 2017-06-02 20:27:07 +01:00
Tom Hughes
ff97501ed0 Remove all use of the :text option to render
It doesn't actually do what it says, as it sets the content type
to text/html not text/plain so is just confusing and as a result
has been deprecated in newer rails versions.
2017-06-02 19:12:05 +01:00
Tom Hughes
d73128271f Fix rubocop warnings 2016-09-26 12:38:54 +01:00
Sarah Hoffmann
5efbc8a8b7 look for extra place tags in Nominatim search results
Administrative boundaries at municipality level are generally
better described by the place node (as town, village etc.).
Nominatim exports the place type in extratags if it was able
to merge place nodes with admin boundaries. Use this preferably
to create the descriptive term.
2016-09-26 13:00:10 +02:00
Tom Hughes
5d3ecffa28 Fix new rubocop warnings 2016-02-05 13:35:26 +00:00
Tom Hughes
8fe1899596 Fix rubocop warnings 2016-01-19 09:51:24 +00:00
Tom Hughes
c9d35839be Fix new rubocopy warnings 2015-08-18 20:57:14 +01:00
Tom Hughes
93a617fec9 Error if geocoder#search is called with no arguments 2015-07-26 22:58:41 +01:00
Tom Hughes
b4caac4d49 Improve handling of HTTP errors in search
Fixes #969
2015-05-14 09:21:19 +01:00
Tom Hughes
e2609b9758 Remove unused code 2015-03-02 00:07:13 +00:00