-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add new geocoding provider: Bing (Locations API) #505
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…an one feature. In this case when info is not collapsed, hide header previous fields and values
- add folder `src/assets/gecoding-providers` - extract `bing` into two new providers → `bing_places` and `bing_streets` (ref: #498 (comment)) - new gulp task `geocoding-providers`
Raruto
commented
Nov 21, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wlorenzetti @volterra79 you can update your docker settings as follows to test:
# config/g3w-suite/settings_docker.py
VENDOR_KEYS = {
'bing': 'your.super.secret.key'
}
GEOCODING_PROVIDERS = {
"nominatim": {
"label": "Nominatim (OSM)",
"url": "https://nominatim.openstreetmap.org/search",
# "icon": "road",
},
"bing_streets": {
"label": "Bing Streets",
"url": "https://dev.virtualearth.net/REST/v1/Locations/?key=" + VENDOR_KEYS['bing'], # + '&inclnb=1',
# "icon": "road",
},
"bing_places": {
"label": "Bing Places",
"url": "https://dev.virtualearth.net/REST/v1/LocalSearch/?key=" + VENDOR_KEYS['bing'],
# "icon": "poi",
},
}
To set a vendor key you can do as is most comfortable for you, e.g.:
?key=" + VENDOR_KEYS['bing']
← passing it directly into the urlVENDOR_KEYS['bing'] = "super.secret.key"
← setting a generic global keyVENDOR_KEYS['bing_search'] = "super.secret.key"
← setting a specific key to that service
If you would like to add new providers (or rename existing ones), just remember to use the file name as "provider" identifier:
http://localhost:8000/static/client/geocoding-providers/bing_streets.js
http://localhost:8000/static/client/geocoding-providers/bing_places.js
http://localhost:8000/static/client/geocoding-providers/nominatim.js
http://localhost:8000/static/client/geocoding-providers/my_custom_provider.js
...
# config/g3w-suite/settings_docker.py
GEOCODING_PROVIDERS = {
"bing_streets": { ... },
"bing_places": { ... },
"nominatim": { ... },
"my_custom_provider": {
"label": "Custom Provider",
"url": "https://example.com/search"
},
}
VENDOR_KEYS['my_custom_provider'] = 'super.secret.key'
wlorenzetti
added a commit
to g3w-suite/g3w-admin
that referenced
this pull request
Nov 24, 2023
* Add GEOCODING_PROVIDERS setting. * Add geocoding_providers to qdjango.project model. * Update base settings GEOCODING_PROVIDERS. * Add qdjango utility: get_geocoding_providers. * Add geocoding_provider CRUD. * Change initconfig API REST proeperty group.mapcontrols from list to dict. * Fix for update projects with geocoding_providers empty or None. * Check for geocoding_providers is empty. * Update geoconding_providers qdjango.project field for backward compatibility. * Fix test. * Add sql to migration for change mapcontrol nominatim in geocoding * Update mapcontrol structure * Change from 'provider' to 'providers' inside the options of mapcontrol 'geocoding'. * Change from 'provider' to 'providers' inside the options of mapcontrol 'geocoding'. * ⬆️ Client: g3w-client : g3w-suite/g3w-client#505 editing: g3w-suite/g3w-client-plugin-editing#72 * ⬆️ Client: g3w-client : g3w-suite/g3w-client@bf79291 * ⬆️ Client: g3w-client : g3w-suite/g3w-client@d610c3e * Small fix. * Typo. * Add email exists check on recovery username form. * Refactoring and add settings to reset password and user recovery email templates. * ✨ Change password at first login (#650) * Add PASSWORD_CHANGE_FIRST_LOGIN setting. * Add change_password_first_login property to Userdata model. * Create custom G3WSetPasswordForm and custom G3WLoginView to use for change password at first login workflow. * Start testing. * Testing. * Split change password at first login from reset password workflow. * Create a custom view for confirm reset password to split User rest password workflow from Change password at first login worflow. * Override settings fix. --------- Co-authored-by: wlorenzetti <lorenzett@gis3w.it> * ✨ Add support to qgis `'postgresraster'` layer (#652) * Add 'postgresraster' qgis layer type support. * ⬆️ Client: g3w-client :g3w-suite/g3w-client#519 --------- Co-authored-by: wlorenzetti <lorenzett@gis3w.it> Co-authored-by: volterra79 <boccacci.francesco@gmail.com> * Fix get filter layer saved with anonymous user. (#654) Co-authored-by: wlorenzetti <lorenzett@gis3w.it> * Typo * Fix importing project with RelationReference widget * Fix migrations. * ⬆️ Client: g3w-client : g3w-suite/g3w-client@1a8c128 * ⬆️ Client: g3w-client : g3w-suite/g3w-client#505 * ⬆️ Client: g3w-client : g3w-suite/g3w-client#505 Missing svg icon * ⬆️ Client: g3w-client : g3w-suite/g3w-client@23227b6 * ⬆️ Client: g3w-client : g3w-suite/g3w-client@573bc3b * ⬆️ Client: g3w-client :g3w-suite/g3w-client@bfd21d6 g3w-client-plugin-editing: g3w-suite/g3w-client-plugin-editing@546be8b * ⬆️ Client: g3w-client-plugin-editing: g3w-suite/g3w-client-plugin-editing@8e2a163 * ⬆️ Client: g3w-client-plugin-editing: g3w-suite/g3w-client-plugin-editing@bfc43de * ⬆️ Client: g3w-client-plugin-editing: g3w-suite/g3w-client-plugin-editing@cfd558d * ⬆️ Client: g3w-client: g3w-suite/g3w-client@7ac2a8c * mispelling * ⬆️ Client: g3w-client: g3w-suite/g3w-client@ad1b3c2 g3w-client-plugin-editing: g3w-suite/g3w-client-plugin-editing@21cc247 * Remove 'Bing' from default value of 'GEOCODING_PROVIDERS' setting. * ⬆️ Client: g3w-client: g3w-suite/g3w-client@b23276b * ⬆️ Client: g3w-client: Add geocoding providers folder --------- Co-authored-by: wlorenzetti <lorenzett@gis3w.it> Co-authored-by: volterra79 <boccacci.francesco@gmail.com> Co-authored-by: Raruto <Raruto@users.noreply.github.com>
volterra79
approved these changes
Nov 29, 2023
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on:
Premise
bing_Website
→website
bing_Address_postalCode
→address_postalcode
bing_Address_locality
→address_locality
Docker settings
To set a vendor key you can do as is most comfortable for you, e.g.:
?key=" + VENDOR_KEYS['bing']
← passing it directly into the urlVENDOR_KEYS['bing'] = "super.secret.key"
← setting a generic global keyVENDOR_KEYS['bing_search'] = "super.secret.key"
← setting a specific key to that serviceIf you would like to add new providers (or rename existing ones), just remember to use the file name as "provider" identifier:
How to test
cafe
)Add new feature from geocoding results (bing or nominatim)
Available attributes (bing)
Available attributes (nominatim)
Sample QGIS layer (target editable point layer)
Closes: #498