33 Commits

Author SHA1 Message Date
f131c4c66c AddressService: Use the structured query when possible
This allows nominatim to make sure that we are requesting the right place and
enables more heuristics on their side.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
2025-11-24 15:48:00 +01:00
b72b3e8694 refactor(QueryBuilder): Port away from deprecated execute method
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-13 16:36:43 +02:00
8b1f5cf6cb Switch to (default) Nominatim request-format jsonv2.
Extend list of evaluated address-categories to 'building', 'place', 'amenity':
In the long run, a migration to geocodejson-format should be evaluated, as the currently returned tags for categories
are given according to OSM tagging which is not very consistent.

Quoting from https://nominatim.org/release-docs/latest/api/Search/:
"If you are interested in a stable classification of address categories (suburb, city, state, etc),
 have a look at the geocodejson format.
All other formats return classifications according to OSM tagging.
There is a much larger set of categories and they are not always consistent, which makes them very hard to work with."

Signed-off-by: umgfoin <umgfoin@users.noreply.github.com>
2025-07-24 13:22:30 +02:00
f10f1b6d69 Fix non recoverable exception during lookup of long or malformed addressbook entries.
Signed-off-by: umgfoin <umgfoin@users.noreply.github.com>
2025-07-24 13:22:30 +02:00
bd9eca8fbc Update Dependencies and Nextcloud Requirement
Signed-off-by: Alexander Ratajczak <a4blue@hotmail.de>
2025-04-23 16:38:34 +02:00
c1247247f0 lib: refactor query builder handling
Rather than having to remember to reset the query builder in each method
that uses it, these are now created on-demand from the db connection.

Signed-off-by: Maximilian Bosch <maximilian@mbosch.me>
2024-10-16 18:40:49 +02:00
03cc1dbf05 Bump app to Nextcloud 30
Closes #1333

I decided to not cross-check the availability of all all deprecated
things with older majors, so both min and max version are v30 for now.

A list of all things that I've fixed:

* Deprecated SCSS variables updated as documented in the upgrade notes[1].
* Fixed a bunch of query builder deprecations:
  * $qb->resetQueryParts() is deprecated, one should just create a new
    query-builder object. Done that.
  * Calling `$qb->expr()->andX()` (and `orX()`) with no arguments is
    deprecated. Instead, one should list all arguments in an array and
    pass that to the method. Reworked queries where necessary to do so.
* The PHPUnit version I got by running `make test` downloaded a version
  that prohibits non-static data providers. Made all affected data
  providers static.

With that, everything from `make test` passes in a local dev
installation of Nextcloud 30 except for two tests:

    1) OCA\Maps\Controller\PhotosControllerTest::testAddGetPhotos
    Failed asserting that actual size 0 matches expected size 1.

    /home/ma27/Projects/nextcloud/apps/maps/tests/Unit/Controller/PhotosControllerTest.php:206

    2) OCA\Maps\Controller\TracksControllerTest::testAddGetTracks
    Failed asserting that false matches expected true.

    /home/ma27/Projects/nextcloud/apps/maps/tests/Unit/Controller/TracksControllerTest.php:205

Both tests failed on the previous commit already, so I decided to leave
those for now.

[1] https://docs.nextcloud.com/server/latest/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_30.html#front-end-changes

Signed-off-by: Maximilian Bosch <maximilian@mbosch.me>
2024-10-07 17:26:12 +02:00
64f338689c chore: Migrate from ILogger to LoggerInterface
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-19 18:18:06 +02:00
b059d12c92 chore: composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-14 20:21:41 +02:00
3891fca606 Some Cleanup
Signed-off-by: Arne Hamann <git@arne.email>
2022-05-19 11:35:51 +02:00
880d40e8cb Merge branch 'master' into openlocationcodes 2022-04-14 13:21:03 +02:00
d2e5a53164 Remove blank lines in address before Nominatim query to attempt to improve chance of a match 2022-03-24 15:57:11 +01:00
bf5cb0ddca Merge branch 'master' into openlocationcodes 2022-03-14 20:11:55 +01:00
7fc5cfa23c Merge branch 'master' into replace-iconfig-with-memcache 2022-03-14 16:41:42 +01:00
cb32a781d2 Replace use of IConfig with IMemcache to store the last address lookup
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-02-14 18:53:13 +01:00
c99065dbd9 CHG: Tweak nominatim results to get exact building
Signed-off-by: Chris "Koying" Browet <cbro@semperpax.com>
2020-12-28 15:39:22 +01:00
74242a68df Address Service: Convert Open Location Codes to lat/lon
Signed-off-by: Zach DeCook <zachdecook@librem.one>
2020-09-30 22:04:38 -04:00
c0d818df6c fix dbconnection named service injection
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2020-07-06 17:09:03 +02:00
9a3079c5ab get rid of 'post office box' vcard field to make nominatim query, use comas as separator
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2019-08-31 19:51:13 +02:00
22ba9a1641 lookup contact address internally before doing it externally
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2019-08-14 15:54:05 +02:00
79b2609ed9 add 'no routing engine' warning, remove debug log, add protection against 'user' contacts, update docstring
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2019-08-11 16:35:23 +02:00
0ff69a0402 rename contact_uid field to object_uri
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2019-07-23 21:54:16 +02:00
cd70e14695 use contact URI instead of UID to identify address object, listen to contact deletion and delete corresponding addresses
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2019-07-23 18:49:50 +02:00
cc711a1caf improve lookup address query
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2019-07-22 19:08:43 +02:00
fef1b6e92c cleanup useless db contact addresses on vCard change
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2019-07-03 18:10:45 +02:00
fba3f0c40b associate contact uid with addresses in DB
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2019-07-03 17:27:18 +02:00
650d2d7cce code style on contact address stuff
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2019-07-03 15:19:58 +02:00
b4bcd0c52d display all contacts addresses as contact markers
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2019-06-27 16:06:39 +02:00
19c51c4a0c Changed from file to app config value for the last lookup time.
Removed:
    private function getLastLookupFile():ISimpleFile
    private function getLastLookup():int
    private function setLastLookup()

Signed-off-by: Arne Hamann <kontakt+github@arne.email>
2019-06-21 17:10:15 +02:00
a62ebc94ef Added some commends
Signed-off-by: Arne Hamann <kontakt+github@arne.email>
2019-06-18 23:05:45 +02:00
021110fbd5 Fixed error if no network connection is available
Signed-off-by: Arne Hamann <kontakt+github@arne.email>
2019-06-03 11:49:38 +02:00
a8a9af4674 Cronjob for looking up addresses in during Cron
Signed-off-by: Arne Hamann <kontakt+github@arne.email>
2019-06-03 07:38:23 +02:00
9793d33262 First version of looking up contact addresses
Signed-off-by: Arne Hamann <kontakt+github@arne.email>
2019-05-16 12:41:36 +02:00