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

Other library nominatim to geocoder #71

Open
mjezegou opened this issue Mar 5, 2021 · 16 comments
Open

Other library nominatim to geocoder #71

mjezegou opened this issue Mar 5, 2021 · 16 comments
Assignees
Milestone

Comments

@mjezegou
Copy link

mjezegou commented Mar 5, 2021

Hello,
I am having problems with the nominatim geolocation.
In many cases, the house number is not found.
We must then manually find the exact situation on the street.

Here is an example :

https://nominatim.openstreetmap.org/search?q=11%20Rue%20du%20Rocher,%2035510%20Cesson-S%C3%A9vign%C3%A9&limit=5&format=json&addressdetails=1

The return is only the street and not the position of number 11 in the street

@mcguffin
Copy link
Owner

mcguffin commented Mar 5, 2021

I'm sorry, but I am not the maintainer of the nominatim service.

@mcguffin mcguffin closed this as completed Mar 5, 2021
@mjezegou
Copy link
Author

mjezegou commented Mar 5, 2021

Is it possible to change the library to another like for exemple openrouteservice , here or other library ?

@mcguffin
Copy link
Owner

mcguffin commented Mar 5, 2021

Well, openrouteservice looks interesting ...
This plugin uses (leaflet-control-geocoder)[https://github.com/perliedman/leaflet-control-geocoder] for geocoding, which does not support openrouteservice. Would be quite a bit of work to do, implementing a different service, parse different kinds of geocoding results, making it compatible to existing installations and datasets ...
However I have some feature like a choosable geocoding service in mind, so I'll put this on the agenda.

@mcguffin mcguffin reopened this Mar 5, 2021
@mcguffin mcguffin added this to the Future milestone Mar 5, 2021
@mjezegou
Copy link
Author

mjezegou commented Mar 5, 2021

Thank you, I would be delighted and my users too !

Cyrille37 added a commit to Cyrille37/acf-openstreetmap-field that referenced this issue Dec 24, 2024
@Cyrille37
Copy link
Contributor

Im trying to implement something ... I'll need several days ;-)

Cyrille37 added a commit to Cyrille37/acf-openstreetmap-field that referenced this issue Dec 25, 2024
@Cyrille37
Copy link
Contributor

Cyrille37 commented Dec 25, 2024

A question at leaflet-control-geocoder about htmlTemplate option & html property : perliedman/leaflet-control-geocoder#357

Another easier proposition to leaflet-control-geocoder perliedman/leaflet-control-geocoder#358 and a first PR perliedman/leaflet-control-geocoder#359

Cyrille37 added a commit to Cyrille37/acf-openstreetmap-field that referenced this issue Dec 26, 2024
Cyrille37 added a commit to Cyrille37/acf-openstreetmap-field that referenced this issue Dec 26, 2024
Cyrille37 added a commit to Cyrille37/acf-openstreetmap-field that referenced this issue Dec 26, 2024
Cyrille37 added a commit to Cyrille37/acf-openstreetmap-field that referenced this issue Dec 26, 2024
@Cyrille37
Copy link
Contributor

@mcguffin Can you assign to me this issue please ?

@mcguffin
Copy link
Owner

@Cyrille37 I'm finishing now too.

Achievements today:

  • Map on the Settings page
  • Update leaflet-control-geocoder to 3.1.0

I've lost myself in generic Geocoder settings and spent the last few hours poking in piles of API docs.

I think the geocoder declaration in the json should look like this:

    "opencage": {
        "label": "OpenCage",
        "options": {
            "apiKey": null
        },
        "settings": {
            "apiKey": {
                "label": "OpenCage API Key",
                "type": "text",
                "required": true 
            }
        }
    }

settings: declares configurable properties. This would be the place for future configs that should go to the settings page like maxResults (numeric), nameProperties (checkboxes).
options: gets populated with the values from settings and is passed to geocoderFactory then. The place for hardcoded params. (Not sure if "apiKey": null is really necessary.)

I think we should retire options.serviceUrl. It overrides the original serviceUrl in leaflet-control-geocoder. I would have to keep track of URL-changes on every upgrade of leaflet-control-geocoder.

What do you think?

If you agree, I'll implement generic geocoder settings as described tomorrow.

@Cyrille37
Copy link
Contributor

Hi @mcguffin

Ok, take the lead. I'll will do tests later today.

@mcguffin
Copy link
Owner

Hi @Cyrille37
I'm shutting down for today.

What's new:

  • Generic settings for photon and OpenCage API keys
  • Removed options.serviceUrl
  • Setup / refactor some unit tests (npm run test should do it)
  • Bring PHPCS audit back to life (npm run audit)
  • Update Readme (Testing Howto)

@Cyrille37
Copy link
Contributor

Cyrille37 commented Dec 30, 2024

Hi @mcguffin

from master 3d17ef3

in settings:

  • the field "OpenCage API Key" still required even if geocoder is "Nominatim". Can't save settings without enter a fake key.
  • the geocoder test does not display the map, nore the result.

dev:

  • cannot run composer because it needs php ^8.1. You did not answer about what minimal php version you wanted.

mcguffin added a commit that referenced this issue Dec 30, 2024
@mcguffin
Copy link
Owner

mcguffin commented Dec 30, 2024

Hi @Cyrille37
The required thing should be fixed.

  • No map no result: I can't reproduce. However Nominatim seems to need return key pressed before results appear. The others don't.
  • Composer: still works for me after resetting everything with $ rm -rf vendor composer.lock && composer install. (Homebrew php 8.3) Any error message? What does $ php -v answer?

@Cyrille37
Copy link
Contributor

cannot run composer because it needs php ^8.1. You did not answer about what minimal php version you wanted.

At first you've to decide which Php version the plugin have to be compatible with. If I code with php 8.3 I cannot see php X.x incompatibility. Isn't it ?

@mcguffin
Copy link
Owner

At first you've to decide which Php version the plugin have to be compatible with. If I code with php 8.3 I cannot see php X.x incompatibility. Isn't it ?

Min PHP is 7.2 in composer.json – I'm going to raise this to 7.4, which is already covered in the wp-env config.

"require": {
"composer/installers": "~1.2",
"php": ">=7.2.24|^8"
},

Max PHP should be 8.4. I'm still working on an effective way to test this together with 7.4.

@Cyrille37
Copy link
Contributor

Cyrille37 commented Dec 30, 2024

Max PHP should be 8.4. I'm still working on an effective way to test this together with 7.4

composer fail because I use 7.4 :

    - doctrine/instantiator 2.0.0 requires php ^8.1 -> your php version (7.4.33) does not satisfy that requirement.
    - phpunit/phpunit 9.6.22 requires doctrine/instantiator ^1.5.0 || ^2 -> satisfiable by doctrine/instantiator[2.0.0].
    - phpunit/phpunit is locked to version 9.6.22 and an update of this package was not requested.

mcguffin added a commit that referenced this issue Dec 30, 2024
@mcguffin
Copy link
Owner

composer fail because I use 7.4 :

Okay I see it now…
rm composer.lock && composer install should do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants