Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(location): introduce a public API for location providers #41255

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tcitworld
Copy link
Member

Summary

Currently each app does location search & geocoding itself, and it's limited to OpenStreetMap's public Nominatim service. This will allow people to install other app providers, such as Google Maps, Pelias, OpenCage, Photon, etc. This will also allow some providers to provide autocomplete support.

TODO

  • tests
  • create at least one other provider (GMaps ?)
  • add support for custom endpoint for the nominatim provider
  • support a common set of options
  • fix geometry type (should it be always a point?)
  • add the nominatim app to shipped apps

Checklist

Currently each app does location search & geocoding itself, and it's limited to OpenStreetMap's
public Nominatim service. This will allow people to install other app providers, such as Google
Maps, Pelias, OpenCage, Photon, etc. This will also allow some providers to provide autocomplete
support.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
try {
return $provider->geocode($longitude, $latitude, $options);
} catch (RuntimeException $e) {
$this->logger->warning("Failed to geocode coords {$longitude}:${latitude} using provider {$provider->getName()}", ['exception' => $e]);

Check failure

Code scanning / Psalm

UndefinedInterfaceMethod Error

Method OCP\Location\ILocationProvider::getName does not exist
try {
return $provider->search($address, $options);
} catch (RuntimeException $e) {
$this->logger->warning("Failed to search for location {$address} using provider {$provider->getName()}", ['exception' => $e]);

Check failure

Code scanning / Psalm

UndefinedInterfaceMethod Error

Method OCP\Location\ILocationProvider::getName does not exist
return $provider->autocomplete($address, $options);
}
} catch (RuntimeException $e) {
$this->logger->warning("Failed to autocomplete location {$address} using provider {$provider->getName()}", ['exception' => $e]);

Check failure

Code scanning / Psalm

UndefinedInterfaceMethod Error

Method OCP\Location\ILocationProvider::getName does not exist
@solracsf solracsf added this to the Nextcloud 28 milestone Nov 21, 2023
@blizzz blizzz mentioned this pull request Nov 22, 2023
5 tasks
@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
This was referenced Mar 12, 2024
@Altahrim Altahrim mentioned this pull request Mar 20, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 29, Nextcloud 30 Mar 28, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants