Problem/Motivation
Currently, Overpass QL queries built via overpass_api_ui or hand-written in code are transient and cannot be saved or reused across the site. Site builders who frequently fetch specific OpenStreetMap data (e.g., local amenities, boundaries, or transport networks) have to recreate or paste the same query configurations repeatedly.
Furthermore, without a structured way to store queries, site configurations cannot be exported or tracked in version control (Git), making it difficult to deploy standardized spatial data queries across different environments (dev/stage/prod).
Proposed resolution
Introduce a new submodule, overpass_api_preset, that defines an OverpassQueryPreset Configuration Entity (overpass_preset).
- Allow site builders to save query configurations (query type, spatial parameters, key/value filters, and generated OQL) as reusable presets.
- Expose a full CRUD administration interface (
/admin/structure/overpass-preset) to manage presets. - Integrate a "Save as Preset" action directly inside the
overpass_api_uiQueryBuilderForm. (Waiting for the feature from #3610872.) - Enable full compatibility with Drupal's Configuration Management system (
drush cex/drush cim), allowing presets to be exported as.ymlfiles and deployed across environments. - Provide default configuration presets in
config/installfor common OSM queries (e.g., pharmacies, bus stops).
Remaining tasks
- Scaffold
overpass_api_preset.info.yml,.permissions.yml, and.links.menu.yml/.links.action.yml. - Implement the
OverpassPresetConfig Entity class and its interface. - Create the config schema (
config/schema/overpass_api_preset.schema.yml). - Build the Admin UI: ListBuilder, Form (Add/Edit), and DeleteForm.
- Add a "Save as Preset" button/submit handler in
overpass_api_uiQueryBuilderForm (with graceful fallback ifoverpass_api_presetis disabled). - Provide default config files for common use cases.
- Write unit and kernel tests for config entity CRUD operations and schema validation.
User interface changes
- New administration list page under Structure:
/admin/structure/overpass-preset(listing saved presets with Edit/Delete/Export operations). - New Add/Edit Preset forms.
- A new "Save as Preset" button and preset label field on the
overpass_api_uiQueryBuilderForm.
API changes
- New Config Entity type:
overpass_preset. - New service/storage handler to load and render OQL string directly from an
OverpassPresetInterfaceobject.
Data model changes
Adds a new Configuration Entity schema (overpass_api_preset.preset.*) storing:
id(string): Machine name.label(string): Human-readable name.description(string): Optional description.query_type(string):not_spatial,bbox,in_area,around_area, orraw.filters(array): Key/value conditions and sequence rules.spatial_parameters(array): BBox coordinates, area name, or radius values.generated_oql(string): Cached Overpass QL string representation.
Comments
Comment #2
orkutmuratyilmaz