Skip to content

Commit

Permalink
Fix publishing QML layer from external DB with non-default geo-column…
Browse files Browse the repository at this point in the history
… name

Fix #818
  • Loading branch information
jirik committed Apr 9, 2023
1 parent ff360de commit 4a1b4fa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#### Schema migrations
#### Data migrations
### Changes
- [#818](https://github.com/LayerManager/layman/issues/818) Fix publishing QML layer from external DB with geo-column name other than `wkb_geometry`.
- Fix `time_regex` sample values in documentation and tests.

## v1.20.0
Expand Down
2 changes: 1 addition & 1 deletion src/layman/layer/qgis/wms.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def save_qgs_file(workspace, layer):
qml = util.get_original_style_xml(workspace, layer)
qml_geometry = util.get_qml_geometry_from_qml(qml)
conn_cur = db_util.get_connection_cursor(db_uri_str=table_uri.db_uri_str)
db_types = db.get_geometry_types(db_schema, table_name, conn_cur=conn_cur)
db_types = db.get_geometry_types(db_schema, table_name, column_name=table_uri.geo_column, conn_cur=conn_cur)
db_cols = [
col for col in db.get_all_column_infos(db_schema, table_name, conn_cur=conn_cur, omit_geometry_columns=True)
if col.name != table_uri.primary_key_column
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
frozenset([base_test.RestMethod.PATCH]),
},
},
'multipolygon_qml_custom_id_column': {
'multipolygon_qml_custom_id_column_custom_geo_column': {
'file_path': "sample/data/geometry-types/multipolygon.geojson",
'style_file': 'tests/dynamic_data/publications/layer_external_db/multipolygon.qml',
'schema_name': 'public',
Expand All @@ -93,7 +93,7 @@
'external_table_uri_str': None,
'additional_geo_column': None,
'exp_thumbnail': os.path.join(DIRECTORY, f"thumbnail_multipolygon_qml.png"),
'geo_column_name': 'wkb_geometry',
'geo_column_name': 'my_geometry',
'exp_geometry_type': 'MULTIPOLYGON',
'exp_native_crs': 'EPSG:4326',
'exp_native_bounding_box': [17.0, 47.0, 18.0, 48.5],
Expand Down

0 comments on commit 4a1b4fa

Please sign in to comment.