LeafletTab package
Layer Generation Dialog Module
This module provides dialog interfaces for heat network layer generation, including OSM data handling and building coordinate management.
- author:
Dipl.-Ing. (FH) Jonas Pfeiffer
- class districtheatingsim.gui.LeafletTab.layer_generation_dialog.LayerGenerationDialog(base_path, config_manager, parent=None)[source]
Bases:
QDialogDialog for generating layers for heat network visualization.
- accepted_inputs
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- request_map_coordinate
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- __init__(base_path, config_manager, parent=None)[source]
Initialize layer generation dialog.
- Parameters:
base_path (str) – Base path for file operations
config_manager (ConfigManager) – Configuration manager instance
parent (QWidget or None) – Parent widget
- initUI()[source]
Initialize user interface components.
Creates the complete dialog layout including data input section, coordinate management, and OSMnx advanced settings.
- setVisualizationTab(visualization_tab)[source]
Set visualization tab reference.
- Parameters:
visualization_tab (QWidget) – VisualizationTab instance
- toggleLocationInputMode(index)[source]
Toggle input fields based on location mode.
- Parameters:
index (int) – Selected mode index
- toggleGenerationMode(index)[source]
Toggle street layer visibility based on generation mode.
- Parameters:
index (int) – Selected generation mode index
- toggleOSMnxAdvancedSettings()[source]
Toggle visibility of OSMnx advanced settings.
Switches between expanded and collapsed state of the advanced settings panel and updates the toggle button text accordingly.
- setAllHighwayCheckboxes(checked)[source]
Set all highway checkboxes to checked or unchecked.
- Parameters:
checked (bool) – True to check all, False to uncheck all
- updateFilters()[source]
Update custom filter string based on selected highway types.
Builds an OSMnx-compatible filter string from the selected highway type checkboxes for network generation.
- createFileInputLayout(lineEdit, button)[source]
Create file input layout.
- Parameters:
lineEdit (QLineEdit) – File path input widget
button (QPushButton) – Browse button widget
- Returns:
Layout containing file input widgets
- Return type:
QHBoxLayout
- openFileDialog(lineEdit)[source]
Open file dialog and update line edit.
- Parameters:
lineEdit (QLineEdit) – Widget to update with selected file path
- addCoordFromInput()[source]
Add coordinates from input field to table.
Parses coordinate input, transforms to EPSG:25833 if needed, and adds the coordinate pair to the table.
- geocodeAndAdd()[source]
Geocode address and add coordinates to table.
Converts the address input to coordinates using geocoding service and adds result to coordinate table.
- importCoordsFromCSV()[source]
Import coordinates from CSV file.
Opens file dialog to select CSV with UTM_X and UTM_Y columns and imports all coordinates to the table.
- deleteSelectedRow()[source]
Delete selected row from coordinates table.
Removes the currently selected coordinate row from the table.
- clearAllCoordinates()[source]
Clear all coordinates from table.
Shows confirmation dialog and removes all coordinate rows from the table if confirmed.
- copyCoordinates()[source]
Copy all coordinates to clipboard.
Exports all coordinate pairs from the table to the system clipboard in comma-separated format.
- pasteCoordinates()[source]
Paste coordinates from clipboard.
Parses coordinate data from clipboard and adds valid coordinate pairs to the table.
- saveCoordinatesToCSV()[source]
Save coordinates to CSV file.
Prompts user for save format (with or without addresses) and exports coordinates to a CSV file.
- reverse_geocode(x, y)[source]
Simple reverse geocoding (returns formatted coordinates if geocoding fails).
- activateMapPicker()[source]
Activate map coordinate picker mode.
Enables interactive coordinate selection from the map view and updates button state to indicate waiting status.
Leaflet Tab Module
This module provides Leaflet map integration for district heating network visualization and interactive network generation.
- author:
Dipl.-Ing. (FH) Jonas Pfeiffer
- class districtheatingsim.gui.LeafletTab.leaflet_tab.GeoJsonReceiver(base_path='')[source]
Bases:
QObjectBridge for receiving GeoJSON data from JavaScript.
- coordinate_picked
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- polygon_drawn
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- polygon_ready
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- __init__(base_path='')[source]
Initialize GeoJsonReceiver with base path.
- Parameters:
base_path (str) – Base path for file dialogs
- sendGeoJSONToPython(geojson_str)[source]
Receive GeoJSON from JavaScript and save to file.
- Parameters:
geojson_str (str) – GeoJSON data as string
- exportGeoJSON(geojsonString)[source]
Export GeoJSON with file dialog.
- Parameters:
geojsonString (str) – GeoJSON data as string
- exportUnifiedNetworkGeoJSON(geojsonString)[source]
Export edited network in unified format, preserving protected data.
This merges edited geometries from the map with protected building data to create a complete unified network GeoJSON.
- Parameters:
geojsonString (str) – GeoJSON data from map (edited geometries)
- saveEditedNetwork(geojsonString, filepath)[source]
Save edited network back to unified GeoJSON file.
Merges edited geometries from map with original protected data. This is called when user saves changes in the map.
- class districtheatingsim.gui.LeafletTab.leaflet_tab.VisualizationModel[source]
Bases:
objectData model for map visualization operations.
- __init__()[source]
Initialize model with empty layers and base path.
Sets up initial state for visualization model.
- set_base_path(base_path)[source]
Set base path for file operations.
- Parameters:
base_path (str) – Base path to set
- load_geojson(file_path)[source]
Load GeoJSON file as GeoDataFrame.
- Parameters:
file_path (str) – Path to GeoJSON file
- Returns:
Loaded GeoJSON data
- Return type:
GeoDataFrame
- class districtheatingsim.gui.LeafletTab.leaflet_tab.VisualizationPresenter(model, view, folder_manager, data_manager, config_manager)[source]
Bases:
QObjectPresenter mediating between model and view for map visualization.
- layers_imported
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- __init__(model, view, folder_manager, data_manager, config_manager)[source]
Initialize presenter with model, view, and managers.
- Parameters:
model (VisualizationModel) – Model instance
view (VisualizationTabView) – View instance
folder_manager (FolderManager) – Folder manager instance
data_manager (DataManager) – Data manager instance
config_manager (ConfigManager) – Configuration manager instance
- on_project_folder_changed(new_base_path)[source]
Update base path when project folder changes.
- Parameters:
new_base_path (str) – New base path
- open_geocode_addresses_dialog()[source]
Open dialog to select CSV file for geocoding addresses.
Displays file selection dialog and starts geocoding process if file is selected.
- geocode_addresses(inputfilename)[source]
Start geocoding process for CSV file.
- Parameters:
inputfilename (str) – Path to CSV file
- on_geocode_done(fname)[source]
Handle successful geocoding completion.
- Parameters:
fname (str) – Path to generated CSV file
- on_geocode_error(error_message)[source]
Handle geocoding errors.
- Parameters:
error_message (str) – Error message
- load_csv_coordinates(fname=None)[source]
Load coordinates from CSV and add to map.
- Parameters:
fname (str or None) – CSV file path
- import_geojson()[source]
Import GeoJSON files and add to map.
Displays file selection dialog for GeoJSON files and adds selected layers to the map.
- add_geojson_layer(filenames)[source]
Add GeoJSON layers to map.
- Parameters:
filenames (list) – List of GeoJSON file paths
- open_layer_generation_dialog()[source]
Open dialog for generating layers from data.
Creates and displays layer generation dialog with map picker support.
- generate_and_import_layers(inputs)[source]
Start layer generation process.
- Parameters:
inputs (dict) – Generation inputs
- on_generation_done(results)[source]
Handle successful layer generation.
- Parameters:
results (dict) – Generation results
- on_generation_error(error_message)[source]
Handle layer generation errors.
- Parameters:
error_message (str) – Error message
- save_network()[source]
Save edited network back to unified GeoJSON file.
Requests current network data from JavaScript and saves to file.
- activate_map_coordinate_picker()[source]
Activate map coordinate picker mode by calling JavaScript.
Enables interactive coordinate selection on the map.
- class districtheatingsim.gui.LeafletTab.leaflet_tab.VisualizationTabView(parent=None)[source]
Bases:
QWidgetView component for map visualization interface.
- __init__(parent=None)[source]
Initialize view with UI components.
- Parameters:
parent (QWidget or None) – Parent widget
- initUI()[source]
Initialize user interface components.
Sets up layout with menu bar, map view, and progress bar.
- initMenuBar()[source]
Initialize menu bar with actions.
Creates file menu with geocoding, import, and network generation actions.
- initMapView()[source]
Initialize map view with WebEngine and WebChannel.
Sets up web view configuration and Python-JavaScript bridge.
- update_map_view(map_obj)[source]
Update map view with new data.
- Parameters:
map_obj (object) – Map object to display
- class districtheatingsim.gui.LeafletTab.leaflet_tab.VisualizationTabLeaflet(folder_manager, data_manager, config_manager, parent=None)[source]
Bases:
QMainWindowMain window integrating model, view, and presenter for map visualization.
- __init__(folder_manager, data_manager, config_manager, parent=None)[source]
Initialize visualization tab with managers.
- Parameters:
folder_manager (FolderManager) – Folder manager instance
data_manager (DataManager) – Data manager instance
config_manager (ConfigManager) – Configuration manager instance
parent (QWidget or None) – Parent widget
Net Generation Threads Module
This module provides threading classes for network generation, file import, and geocoding operations to maintain GUI responsiveness.
- author:
Dipl.-Ing. (FH) Jonas Pfeiffer
- class districtheatingsim.gui.LeafletTab.net_generation_threads.NetGenerationThread(inputs, base_path)[source]
Bases:
QThreadThread for generating district heating networks.
- calculation_done
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- calculation_error
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- __init__(inputs, base_path)[source]
Initialize network generation thread.
Sets up the thread with input parameters for generating district heating networks using different algorithms.
- class districtheatingsim.gui.LeafletTab.net_generation_threads.OSMStreetDownloadThread(download_func, *args, **kwargs)[source]
Bases:
QThreadThread for downloading OSM street data.
- download_done
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- download_error
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- class districtheatingsim.gui.LeafletTab.net_generation_threads.OSMBuildingDownloadThread(download_func, *args, **kwargs)[source]
Bases:
QThreadThread for downloading OSM building data.
- download_done
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- download_error
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- class districtheatingsim.gui.LeafletTab.net_generation_threads.FileImportThread(m, filenames, color)[source]
Bases:
QThreadThread for importing geospatial files.
- calculation_done
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- calculation_error
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- __init__(m, filenames, color)[source]
Initialize file import thread.
Sets up the thread with map object, filenames, and styling color for importing geospatial files asynchronously.
- class districtheatingsim.gui.LeafletTab.net_generation_threads.GeocodingThread(inputfilename)[source]
Bases:
QThreadThread for geocoding address data.
- calculation_done
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- calculation_error
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- __init__(inputfilename)[source]
Initialize geocoding thread.
Sets up the thread with an input filename for processing geocoding operations asynchronously.
- Parameters:
inputfilename (str) – Input filename for geocoding data
- class districtheatingsim.gui.LeafletTab.net_generation_threads.GeoJSONToCSVThread(geojson_file_path, output_file_path, default_values, model)[source]
Bases:
QThreadThread for converting GeoJSON to CSV with reverse geocoding.
- progress_update
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- calculation_done
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- calculation_error
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- __init__(geojson_file_path, output_file_path, default_values, model)[source]
Initialize GeoJSON to CSV conversion thread.
Sets up the thread with file paths, default values, and model instance for converting GeoJSON building data to CSV with reverse geocoding.
- Parameters:
geojson_file_path (str) – Input GeoJSON file path
output_file_path (str) – Output CSV file path
default_values (dict) – Default values for building parameters
model (ProjectModel) – Model instance with calculate_centroid method
OSM Dialogs Module
This module provides dialog interfaces for OSM data download and building queries through interactive user interfaces.
- author:
Dipl.-Ing. (FH) Jonas Pfeiffer
- class districtheatingsim.gui.LeafletTab.osm_dialogs.DownloadOSMDataDialog(base_path, config_manager, parent, parent_pres)[source]
Bases:
QDialogDialog for downloading OSM street data with OSMnx.
- __init__(base_path, config_manager, parent, parent_pres)[source]
Initialize OSM data download dialog.
Sets up the dialog with configuration for downloading OpenStreetMap street data using different methods and area selection types.
- initUI()[source]
Initialize user interface components.
Creates and arranges all UI elements including area selection, method selection, filter options, and download controls.
- setVisualizationTab(visualization_tab)[source]
Set visualization tab reference for map interaction.
Stores a reference to the visualization tab to enable polygon drawing and map-based area selection functionality.
- Parameters:
visualization_tab (VisualizationTabLeaflet) – The visualization tab instance
- toggleDownloadMethod(index)[source]
Toggle visibility based on download method.
Enables or disables area selection options depending on whether OSMnx or Overpass API is selected.
- Parameters:
index (int) – Index of selected method
- toggleAreaType(index)[source]
Toggle visibility based on area selection type.
Shows the appropriate input widgets based on the selected area type (city name, CSV, GeoJSON, or map drawing).
- Parameters:
index (int) – Index of selected area type
- setAllHighwayCheckboxes(checked)[source]
Set all highway checkboxes to checked or unchecked.
Applies the same checked state to all highway type filters.
- Parameters:
checked (bool) – Target checked state
- updateFilters()[source]
Update OSMnx filter based on selected highway types.
Builds a custom OSMnx filter string from the checked highway type checkboxes for network data download.
- activateMapPolygonDrawing()[source]
Activate polygon drawing mode on map.
Enables the interactive polygon drawing functionality on the Leaflet map and connects signals for polygon completion.
- onPolygonReady()[source]
Called when polygon has been drawn on the map.
Updates UI state and notifies the user that the polygon is ready and can be edited before starting the download.
- getCapturedPolygonFromMap()[source]
Get the captured polygon from the map via JavaScript.
- Returns:
Path to temporary GeoJSON file with polygon, or None if no polygon.
- Return type:
str or None
- clearCapturedPolygon()[source]
Clear the captured polygon from the map.
Removes the drawn polygon from the Leaflet map by calling JavaScript functionality.
- createFileInput(default_path)[source]
Create file input widget with browse button.
Creates a QLineEdit and QPushButton combination for file path input with browse dialog functionality.
- createFileInputLayout(lineEdit, button)[source]
Create file input layout.
Combines file path input widget and browse button into a horizontal layout for consistent UI presentation.
- Parameters:
lineEdit (QLineEdit) – File path input widget
button (QPushButton) – Browse button widget
- Returns:
Layout containing file input widgets
- Return type:
QHBoxLayout
- selectFile(lineEdit)[source]
Open file dialog and update line edit.
Displays a file selection dialog and updates the provided line edit widget with the selected file path.
- Parameters:
lineEdit (QLineEdit) – Widget to update with selected file path
- addTagField(key='', value='')[source]
Add tag field to layout.
Creates and adds a new key-value pair input row for OSM tag specification in the query dialog.
- removeTagField()[source]
Remove last tag field from layout.
Removes the most recently added tag key-value pair from the tag specification form.
- loadAllStandardTags()[source]
Load all standard tags into layout.
Populates the tag specification form with all predefined standard OSM tags for building queries.
- loadSelectedStandardTag()[source]
Load selected standard tag into layout.
Adds the currently selected standard tag from the dropdown to the tag specification form.
- startQuery()[source]
Start OSM data query and download.
Initiates the OpenStreetMap street data download process based on selected area type, method, and filter settings.
- class districtheatingsim.gui.LeafletTab.osm_dialogs.OSMBuildingQueryDialog(base_path, config_manager, parent, parent_pres, visualization_tab=None)[source]
Bases:
QDialogDialog for querying OSM building data with multiple area selection modes.
- __init__(base_path, config_manager, parent, parent_pres, visualization_tab=None)[source]
Initialize OSM building query dialog.
Sets up the dialog for downloading OpenStreetMap building data with multiple area selection modes and configuration options.
- initUI()[source]
Initialize user interface components.
Creates and arranges all UI elements for area selection, tag specification, default values, and download controls.
- toggleAreaType()[source]
Show/hide widgets based on selected area type.
Displays the appropriate input widgets for the selected area selection method (CSV, GeoJSON, or map drawing).
- browseFile(line_edit, file_filter)[source]
Open file dialog for selecting input file.
Displays a file selection dialog with the specified filter and updates the line edit widget with the chosen file path.
- Parameters:
line_edit (QLineEdit) – Line edit to update with selected path
file_filter (str) – File filter string for dialog
- browseSaveFile(line_edit)[source]
Open file dialog for selecting output file.
Displays a save file dialog for GeoJSON output and updates the line edit widget with the chosen file path.
- Parameters:
line_edit (QLineEdit) – Line edit to update with selected path
- activateMapPolygonDrawing()[source]
Activate polygon drawing mode on the map.
Enables interactive polygon drawing on the Leaflet map for defining the area for building data download.
- onPolygonReady()[source]
Handle polygon ready signal from map.
Updates UI state when the polygon drawing is completed on the map, allowing the user to proceed with the download.
- getCapturedPolygonFromMap()[source]
Get the captured polygon from the map via JavaScript.
- Returns:
Path to temporary GeoJSON file with polygon, or None if no polygon.
- Return type:
str or None