From ec4714bcd89b1200c466f4581eb210d8ecca7c79 Mon Sep 17 00:00:00 2001 From: Daniel Prange Date: Mon, 29 Jan 2024 15:06:19 +0200 Subject: [PATCH 1/3] fix(helsinki): loosen parent determination conditions Use relative values rather than absolute values. --- munigeo/importer/helsinki.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/munigeo/importer/helsinki.py b/munigeo/importer/helsinki.py index f6bee29..b038ab0 100644 --- a/munigeo/importer/helsinki.py +++ b/munigeo/importer/helsinki.py @@ -133,8 +133,11 @@ def _import_division(self, muni, div, type_obj, syncher, parent_dict, feat): parent_geom = parent.geometry.boundary if not geom.intersects(parent_geom): continue - area = (geom - parent.geometry.boundary).area - if area > 1e-6: + # Difference = how much of the area is outside the parent area + area_difference = (geom - parent_geom).area + # The areas must overlap by at least 99.99%, + # i.e. the difference must be less than 0.01%. + if area_difference / geom.area > 0.0001: continue parents.append(parent) if not parents: From 0c878fbf957a707225892d62a8e99589d62eb3a8 Mon Sep 17 00:00:00 2001 From: Daniel Prange Date: Mon, 6 May 2024 16:55:53 +0300 Subject: [PATCH 2/3] fix(helsinki): update statistical_district layer name Source for name: https://kartta.hsy.fi/geoserver/wfs?request=GetCapabilities --- munigeo/data/fi/helsinki/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/munigeo/data/fi/helsinki/config.yml b/munigeo/data/fi/helsinki/config.yml index ec59937..08fb9dc 100644 --- a/munigeo/data/fi/helsinki/config.yml +++ b/munigeo/data/fi/helsinki/config.yml @@ -275,7 +275,7 @@ divisions: no_parent_division: yes parent_ocd_id: 'ocd-division/country:fi' wfs_url: 'https://kartta.hsy.fi/geoserver/wfs?CQL_FILTER=kunta%20in%20(%27091%27,%27092%27,%27049%27,%27235%27)' - wfs_layer: 'taustakartat_ja_aluejaot:seutukartta_pien_2018' + wfs_layer: 'taustakartat_ja_aluejaot:seutukartta_pien_2021' fields: origin_id: kokotun ocd_id: kokotun From 988ecefb54f541008baede8de391519899fda80f Mon Sep 17 00:00:00 2001 From: Daniel Prange Date: Mon, 6 May 2024 17:00:05 +0300 Subject: [PATCH 3/3] docs: update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68c4daf..2241fac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Fixed +- helsinki importer: Make tolerance for divisions extending past their parents relative to parent + area (from 300 m^2 to 0.1% of parent area) +- helsinki importer: Update `statistical_district` WFS layer value + ## [0.3.10] ### Fixed - Fix Helsinki importer urls