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

Assert DB-related metadata properties #767

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion sample/data/geometry-types/multipolygon.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
{
"type": "Feature",
"properties": {
"geometry_type_name": "MultiPolygon"
"geometry_type_name": "MultiPolygon",
"description_en": "Layman is a web service for publishing geospatial data online through REST API",
"description_cs": "Layman je služba pro publikování geoporostorových dat na webu prostřednictvím REST API"
},
"geometry": {
"type": "MultiPolygon",
Expand Down Expand Up @@ -59,6 +61,43 @@
]
]
}
},
{
"type": "Feature",
"properties": {
"geometry_type_name": "MultiPolygon",
"description_en": "Even large data files can be easily published thanks to chunk upload and asynchronous processing.",
"description_cs": "Layman umožňuje snadno publikovat i velké soubory dat, a to díky uploadu po částech a asynchronnímu zpracování."
},
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[
17.0,
47.6
],
[
18.0,
47.6
],
[
18.0,
47.9
],
[
17.0,
47.9
],
[
17.0,
47.6
]
]
]
]
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
'exp_geometry_type': 'GEOMETRY',
'exp_native_bounding_box': [15.0, 49.0, 15.3, 49.3],
'exp_bounding_box': [1669792.3618991035, 6274861.394006575, 1703188.2091370858, 6325919.274572152],
'exp_languages': {'eng'},
'exp_scale_denominator': 10_000_000,
},
'geometrycollection_mixed_case_table_name': {
'input_file_name': 'geometrycollection',
Expand All @@ -40,6 +42,8 @@
'exp_geometry_type': 'GEOMETRYCOLLECTION',
'exp_native_bounding_box': [15.0, 45.0, 18.0, 46.0],
'exp_bounding_box': [1669792.3618991035, 5621521.486192066, 2003750.8342789242, 5780349.220256351],
'exp_languages': set(),
'exp_scale_denominator': 100_000_000,
},
'linestring_dangerous_table_name': {
'input_file_name': 'linestring',
Expand Down Expand Up @@ -84,6 +88,8 @@
'exp_geometry_type': 'MULTIPOLYGON',
'exp_native_bounding_box': [17.0, 47.0, 18.0, 48.5],
'exp_bounding_box': [1892431.3434856508, 5942074.072431108, 2003750.8342789242, 6190443.809135445],
'exp_languages': {'eng', 'cze'},
'exp_scale_denominator': 50_000_000,
},
'point_custom_id_column': {
'input_file_name': 'point',
Expand All @@ -95,6 +101,8 @@
'exp_geometry_type': 'POINT',
'exp_native_bounding_box': [15.0, 49.0, 15.3, 49.3],
'exp_bounding_box': [1669792.3618991035, 6274861.394006575, 1703188.2091370858, 6325919.274572152],
'exp_languages': set(),
'exp_scale_denominator': None, # Layman doesn't guess scale denominator for (multi)points
},
'polygon': {
'input_file_name': 'polygon',
Expand All @@ -106,6 +114,8 @@
'exp_geometry_type': 'POLYGON',
'exp_native_bounding_box': [15.0, 49.0, 15.3, 49.3],
'exp_bounding_box': [1669792.3618991035, 6274861.394006575, 1703188.2091370858, 6325919.274572152],
'exp_languages': set(),
'exp_scale_denominator': 10_000_000,
},
}

Expand Down Expand Up @@ -200,6 +210,18 @@ def test_layer(layer: Publication, key, rest_method, rest_args, params):
assert_stores(workspace=layer.workspace, exp_stores=both_db_stores)
assert_stores(workspace=f'{layer.workspace}_wms', exp_stores=exp_wms_stores)

comp = process_client.get_workspace_publication_metadata_comparison(layer.type, layer.workspace, layer.name)
md_lang = comp['metadata_properties']['language']
assert md_lang['equal'] is True
assert all(set(langs) == params['exp_languages'] for langs in md_lang['values'].values())

md_spatial_res = comp['metadata_properties']['spatial_resolution']
assert md_spatial_res['equal'] is True
exp_sp_res = {
'scale_denominator': params['exp_scale_denominator']
} if params['exp_scale_denominator'] is not None else None
assert all(sp_res == exp_sp_res for sp_res in md_spatial_res['values'].values())

process_client.delete_workspace_layer(layer.workspace, layer.name)

assert_stores(workspace=layer.workspace, exp_stores=only_default_db_store)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.