From 9312e1b3513100c229fc67308bddf9132b284c9e Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 27 Sep 2023 19:18:19 +0200 Subject: Search filter: search only for mushrooms and plants of interest naturewise. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hence remove invasive species and “other” categories from the style file. --- gis-observation-map | 28 +- style.qml | 3428 +++++++++++++++++++++++---------------------------- 2 files changed, 1572 insertions(+), 1884 deletions(-) diff --git a/gis-observation-map b/gis-observation-map index 23ca88e..afc4071 100755 --- a/gis-observation-map +++ b/gis-observation-map @@ -391,12 +391,15 @@ def getObservations(taxonLists, taxonRedlistCategories, data): properties[k] = v # TODO generate GPKG instead and reproject to EPSG:3006 - path = projectHome.joinpath('fynd.geojson') + path = projectHome.joinpath('observations.geojson') with path.open(mode='w') as fp: json.dump(obs, fp, indent=2, ensure_ascii=False) if projectInstance is not None: - layer = QgsVectorLayer(path.as_posix() + '''|subset="Kingdom" IN ('Fungi', 'Plantae') AND "IsPositiveObservation" AND "IsNaturalOccurrence" AND NOT "IsNotRediscoveredObservation" AND "CoordinateUncertaintyInMeters" <= 250''', path.stem, 'ogr') + layer = QgsVectorLayer( + path.as_posix() + '''|subset="IsPositiveObservation" AND "IsNaturalOccurrence" AND "CoordinateUncertaintyInMeters" <= 250''', + 'Fynd', 'ogr' + ) if not layer.isValid(): raise Exception(f'ERROR: {path}: failed to load in QGIS') if 'QGIS' in config.keys() and 'style' in config['QGIS']: @@ -621,6 +624,27 @@ searchFilter = { } } +# https://artfakta.se/artinformation/taxa/biota-0/detaljer +kingdomIds = { + 'Animalia': 5000001, + 'Archaea': 5000082, + 'Bacteria': 5000052, + 'Chromista': 5000055, + 'Fungi': 5000039, + 'Plantae': 5000045, + 'Protozoa': 5000060, + 'Viruses': 5000083, + 'Algae': 6001047, +} + +searchFilter['taxon'] = { + 'ids': list(map(lambda k: kingdomIds[k], ['Fungi', 'Plantae'])), + 'includeUnderlyingTaxa': True, + # https://github.com/biodiversitydata-se/SOS/blob/master/Docs/SearchFilter.md#taxon-lists + 'taxonListIds': [1, 2, 7, 8, 13, 18], + 'taxonListOperator': 'Filter' +} + getObservations(taxonLists, taxonRedlistCategories, searchFilter) topo_maps = ['Topografi 10', 'Topografi 50', 'Topografi 100'] diff --git a/style.qml b/style.qml index 608c714..509cdaf 100644 --- a/style.qml +++ b/style.qml @@ -1,1615 +1,1290 @@ - + 1 - 1 + 0 1 0 - + - + - + - + - + - + - + - + - + - - - - - - - - + + + + + + + + - - - + + + - - + + - - - - - - + - + - + - - - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - - - + - + - + - - - + - + - + - - - + - + - + - - - + - + - + - - - + - + - + - - - + - + - + - - - + - + - + - - - + - + - + - - - + - + - + - - - + @@ -1640,135 +1315,135 @@ END - + - - - - + + + + - + - + - + - + - - - + + + - - @@ -1777,53 +1452,53 @@ END 0 1 - - - + + + - + - + @@ -1831,12 +1506,12 @@ END - + @@ -1847,505 +1522,498 @@ END - + - - + + - + - + - - + + - - + + - - + + - + - + - - + + - - + + - - + + - + - - - - - - - + - - + + - + - - + + - - + + - - + + - + - - + + - - + + - - + + - + - + - - + + - - + + - + - - + + - - + + - - + + - + - - + + - + - + - - + + - - + + - - + + - - + + - + - + - + - + - - + + - + - - + + - + - + - + - - + + - + - + - + - - + + - - + + - + - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - - + + - - + + - + - - + + @@ -2353,388 +2021,384 @@ END - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - + + - - - - - - - - - - - - + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + - - - - - - - + - @@ -2767,94 +2431,94 @@ def my_form_open(dialog, layer, feature): 0 generatedlayout - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3