aboutsummaryrefslogtreecommitdiffstats
path: root/gis-observation-map
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2023-09-27 19:18:19 +0200
committerGuilhem Moulin <guilhem@fripost.org>2023-09-27 19:32:16 +0200
commit9312e1b3513100c229fc67308bddf9132b284c9e (patch)
treef59ab1731a43a0373aaddf214267924e8897fbc8 /gis-observation-map
parentc63ccbb5153f49714cf3cfb5a2dccde814ed357b (diff)
Search filter: search only for mushrooms and plants of interest naturewise.
Hence remove invasive species and “other” categories from the style file.
Diffstat (limited to 'gis-observation-map')
-rwxr-xr-xgis-observation-map28
1 files changed, 26 insertions, 2 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']