diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 5657803..90b5d9c 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -6,6 +6,7 @@ name: Python package on: push: branches: [ "main" ] + pull_request: branches: [ "main" ] @@ -13,28 +14,37 @@ jobs: build: runs-on: ubuntu-latest + strategy: - fail-fast: false matrix: python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | - python -m pip install --upgrade pip - python -m pip install flake8 pytest - if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi + pip install --upgrade pip + pip install pip-tools + pip-sync requirements-dev.txt + + - name: Black code style check + run: | + # stop the build if there are files that need to reformatted + black --check . + - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest run: | pytest diff --git a/brdr/aligner.py b/brdr/aligner.py index fe1764b..cdf5a28 100644 --- a/brdr/aligner.py +++ b/brdr/aligner.py @@ -42,9 +42,17 @@ from brdr.geometry_utils import safe_intersection from brdr.geometry_utils import safe_symmetric_difference from brdr.geometry_utils import safe_union -from brdr.utils import diffs_from_dict_series, get_breakpoints_zerostreak, \ - filter_resulting_series_by_key, get_collection, geojson_tuple_from_series, write_geojson, \ - merge_geometries_by_theme_id, geojson_from_dict, geojson_tuple_from_dict_theme +from brdr.utils import ( + diffs_from_dict_series, + get_breakpoints_zerostreak, + filter_resulting_series_by_key, + get_collection, + geojson_tuple_from_series, + write_geojson, + merge_geometries_by_theme_id, + geojson_from_dict, + geojson_tuple_from_dict_theme, +) logging.basicConfig( level=logging.INFO, format="%(asctime)s - %(message)s", datefmt="%d-%b-%y %H:%M:%S" @@ -69,7 +77,7 @@ def __init__( relevant_distance=1, threshold_overlap_percentage=50, od_strategy=OpenbaarDomeinStrategy.SNAP_SINGLE_SIDE, - crs=DEFAULT_CRS + crs=DEFAULT_CRS, ): """ Initializes the Aligner object @@ -104,16 +112,22 @@ def __init__( # reference self.reference_input = None # to save the initially loaded geojson - self.name_reference_id = "ref_identifier" # name of the identifier-field of the reference data (id has to be unique,f.e CAPAKEY for GRB-parcels) + self.name_reference_id = "ref_identifier" # name of the identifier-field of the reference data (id has to be unique,f.e CAPAKEY for GRB-parcels) self.dict_reference = {} # dictionary to store all reference geometries - self.reference_union = None # to save a unioned geometry of all reference polygons; needed for calculation in most OD-strategies + self.reference_union = None # to save a unioned geometry of all reference polygons; needed for calculation in most OD-strategies # output-dictionaries (when processing dict_thematic) self.dict_result = None # dictionary to save resulting geometries self.dict_result_diff = None # dictionary to save global resulting differences - self.dict_result_diff_plus = None # dictionary to save positive resulting differences - self.dict_result_diff_min = None # dictionary to save negative resulting differences - self.dict_relevant_intersection = None # dictionary to save relevant_intersections + self.dict_result_diff_plus = ( + None # dictionary to save positive resulting differences + ) + self.dict_result_diff_min = ( + None # dictionary to save negative resulting differences + ) + self.dict_relevant_intersection = ( + None # dictionary to save relevant_intersections + ) self.dict_relevant_difference = None # dictionary to save relevant_differences self.dict_predicted = None #dictionary with the 'predicted' results @@ -446,7 +460,9 @@ def process_dict_thematic( self.dict_result_diff = merge_geometries_by_theme_id(dict_result_diff) self.dict_result_diff_plus = merge_geometries_by_theme_id(dict_result_diff_plus) self.dict_result_diff_min = merge_geometries_by_theme_id(dict_result_diff_min) - self.dict_relevant_intersection = merge_geometries_by_theme_id(dict_relevant_intersection) + self.dict_relevant_intersection = merge_geometries_by_theme_id( + dict_relevant_intersection + ) self.dict_relevant_difference = merge_geometries_by_theme_id(dict_relevant_diff) self.feedback_info("thematic dictionary processed") return ( @@ -459,15 +475,15 @@ def process_dict_thematic( ) def predictor( - self, - relevant_distances=np.arange(0, 300, 10, dtype=int)/100, - od_strategy=OpenbaarDomeinStrategy.SNAP_SINGLE_SIDE, - treshold_overlap_percentage=50, + self, + relevant_distances=np.arange(0, 300, 10, dtype=int) / 100, + od_strategy=OpenbaarDomeinStrategy.SNAP_SINGLE_SIDE, + treshold_overlap_percentage=50, ): """ Predicts the 'most interesting' relevant distances for changes in thematic elements based on a distance series. - This function analyzes a set of thematic geometries (`self.dict_thematic`) to identify potentially + This function analyzes a set of thematic geometries (`self.dict_thematic`) to identify potentially interesting distances where changes occur. It performs the following steps: 1. **Process Distance Series:** @@ -475,7 +491,7 @@ def predictor( - This calculation might involve functions like `self.process_series` (implementation details likely depend on your specific code). 2. **Calculate Difference Metrics:** - - Analyzes the results from the distance series to compute difference metrics + - Analyzes the results from the distance series to compute difference metrics between thematic elements at each distance (using `diffs_from_dict_series`). 3. **Identify Breakpoints and Zero-Streaks:** @@ -507,16 +523,23 @@ def predictor( """ dict_predicted = {} for key in self.dict_thematic.keys(): - dict_predicted[key]={} - dict_series = self.process_series(relevant_distances=relevant_distances,od_strategy=od_strategy,treshold_overlap_percentage=treshold_overlap_percentage) + dict_predicted[key] = {} + dict_series = self.process_series( + relevant_distances=relevant_distances, + od_strategy=od_strategy, + treshold_overlap_percentage=treshold_overlap_percentage, + ) diffs = diffs_from_dict_series(dict_series, self.dict_thematic) for key in diffs: if len(diffs[key]) == len(relevant_distances): lst_diffs = list(diffs[key].values()) - breakpoints, zero_streaks = get_breakpoints_zerostreak(relevant_distances, lst_diffs) + breakpoints, zero_streaks = get_breakpoints_zerostreak( + relevant_distances, lst_diffs + ) logging.debug(str(key)) for zs in zero_streaks: dict_predicted[key][zs[0]] = dict_series[zs[0]] + dict_predicted[key] = filter_resulting_series_by_key(dict_predicted[key],key) self.dict_predicted = dict_predicted return dict_predicted, diffs @@ -551,7 +574,7 @@ def process_series( self.feedback_debug("Process series" + str(relevant_distances)) self.od_strategy = od_strategy self.threshold_overlap_percentage = treshold_overlap_percentage - #self._prepare_thematic_data() #not necessary? Assumed that dict_thematic is already loaded + # self._prepare_thematic_data() #not necessary? Assumed that dict_thematic is already loaded dict_series = {} for s in relevant_distances: self.feedback_info( @@ -1034,14 +1057,14 @@ def _calculate_geom_by_intersection_and_reference( self.buffer_distance(), ), ) - #TODO BEGIN: experimental fix - check if it is ok in all cases? - #when calculating for OD, we create a 'virtual parcel'. When calculating this virtual parcel, it is buffered to take outer boundaries into account. - #This results in a side-effect that there are extra non-logical parts included in the result. The function below tries to exclude these non-logica parts. + # TODO BEGIN: experimental fix - check if it is ok in all cases? + # when calculating for OD, we create a 'virtual parcel'. When calculating this virtual parcel, it is buffered to take outer boundaries into account. + # This results in a side-effect that there are extra non-logical parts included in the result. The function below tries to exclude these non-logica parts. # see eo_id 206363 with relevant distance=0.2m and SNAP_ALL_SIDE if is_openbaar_domein: - #geom = buffer_neg_pos(geom, self.buffer_distance()) - geom = self.get_relevant_polygons_from_geom (geom) - #TODO END + # geom = buffer_neg_pos(geom, self.buffer_distance()) + geom = self.get_relevant_polygons_from_geom(geom) + # TODO END elif ( not geom_relevant_intersection.is_empty and geom_relevant_difference.is_empty @@ -1072,7 +1095,6 @@ def _calculate_geom_by_intersection_and_reference( geom = geom_relevant_intersection # (=empty geometry) return geom, geom_relevant_intersection, geom_relevant_difference - def get_relevant_polygons_from_geom(self, geom): """ Get only the relevant parts (polygon) from a geometry. @@ -1085,12 +1107,12 @@ def get_relevant_polygons_from_geom(self, geom): geom = make_valid(unary_union(geom)) # Create a GeometryCollection from the input geometry. geometry_collection = GeometryCollection(geom) - array=[] + array = [] for g in geometry_collection.geoms: # Ensure each sub-geometry is valid. g = make_valid(g) if str(g.geom_type) in ["Polygon", "MultiPolygon"]: - relevant_geom = buffer_neg(g,self.buffer_distance()) + relevant_geom = buffer_neg(g, self.buffer_distance()) if relevant_geom != None and not relevant_geom.is_empty: array.append(g) return make_valid(unary_union(array)) diff --git a/brdr/constants.py b/brdr/constants.py index 9815e41..2da6495 100644 --- a/brdr/constants.py +++ b/brdr/constants.py @@ -32,8 +32,8 @@ # Limit used when extracting features by URL, using the feature API (fe from GRB) DOWNLOAD_LIMIT = 10000 -#default CRS: -DEFAULT_CRS= "EPSG:31370" +# default CRS: +DEFAULT_CRS = "EPSG:31370" -#MULTI_SINGLE_ID_SEPARATOR #separator to split multipolygon_ids to single polygons -MULTI_SINGLE_ID_SEPARATOR = '*$*' +# MULTI_SINGLE_ID_SEPARATOR #separator to split multipolygon_ids to single polygons +MULTI_SINGLE_ID_SEPARATOR = "*$*" diff --git a/brdr/geometry_utils.py b/brdr/geometry_utils.py index 85451ad..180e2c5 100644 --- a/brdr/geometry_utils.py +++ b/brdr/geometry_utils.py @@ -168,7 +168,9 @@ def safe_union(geom_a: BaseGeometry, geom_b: BaseGeometry) -> BaseGeometry: geom = union(geom_a, geom_b) except GEOSException: try: - logging.warning("union_error for geoms:" + geom_a.wkt + " and " + geom_b.wkt) + logging.warning( + "union_error for geoms:" + geom_a.wkt + " and " + geom_b.wkt + ) geom = union(buffer(geom_a, 0.0000001), buffer(geom_b, 0.0000001)) except Exception: logging.error("error: empty geometry returned") @@ -206,7 +208,9 @@ def safe_intersection(geom_a: BaseGeometry, geom_b: BaseGeometry) -> BaseGeometr geom = intersection(geom_a, geom_b) except GEOSException: try: - logging.warning("intersection_error for geoms:" + geom_a.wkt + " and " + geom_b.wkt) + logging.warning( + "intersection_error for geoms:" + geom_a.wkt + " and " + geom_b.wkt + ) geom = intersection(buffer(geom_a, 0.0000001), buffer(geom_b, 0.0000001)) except Exception: logging.error("error: empty geometry returned") @@ -244,7 +248,9 @@ def safe_difference(geom_a, geom_b): geom = difference(geom_a, geom_b) except GEOSException: try: - logging.warning("difference_error for geoms:" + geom_a.wkt + " and " + geom_b.wkt) + logging.warning( + "difference_error for geoms:" + geom_a.wkt + " and " + geom_b.wkt + ) geom = difference(buffer(geom_a, 0.0000001), buffer(geom_b, 0.0000001)) except Exception: logging.error("error: empty geometry returned") @@ -282,7 +288,12 @@ def safe_symmetric_difference(geom_a, geom_b): geom = symmetric_difference(geom_a, geom_b) except GEOSException: try: - logging.warning("symmetric_difference_error for geoms:" + geom_a.wkt + " and " + geom_b.wkt) + logging.warning( + "symmetric_difference_error for geoms:" + + geom_a.wkt + + " and " + + geom_b.wkt + ) geom = symmetric_difference( buffer(geom_a, 0.0000001), buffer(geom_b, 0.0000001) ) @@ -316,7 +327,7 @@ def grid_bounds(geom: BaseGeometry, delta: float): nx = 2 if ny < 2: ny = 2 - gx, gy = np.linspace(min_x, max_x, nx+1), np.linspace(min_y, max_y, ny+1) + gx, gy = np.linspace(min_x, max_x, nx + 1), np.linspace(min_y, max_y, ny + 1) grid = [] for i in range(len(gx) - 1): for j in range(len(gy) - 1): diff --git a/brdr/utils.py b/brdr/utils.py index 9a0eb15..1a637f2 100644 --- a/brdr/utils.py +++ b/brdr/utils.py @@ -59,6 +59,29 @@ def geojson_tuple_from_dict_theme(dict_theme, crs, name_id, prop_dict=None, geom feature_collections.append(FeatureCollection(ft, crs=crs_geojson)) return tuple(feature_collections) + +def geojson_tuple_from_dict_theme( + dict_theme, crs, name_id, prop_dict=None, geom_attributes=True +): + """ + get a geojson-tuple (6 geojsons) for a dictionary of theme_ids (keys) and dictionary of relevant distance-results (values) + """ + features = [[], [], [], [], [], []] + for key in dict_theme.keys(): + if prop_dict is not None and key in prop_dict: + prop_dictionary = prop_dict[key] + fcs = geojson_tuple_from_series( + dict_theme[key], crs, name_id, prop_dict=prop_dictionary + ) + for count, ft in enumerate(features): + ft.extend(fcs[count].features) + crs_geojson = {"type": "name", "properties": {"name": crs}} + feature_collections = [] + for ft in features: + feature_collections.append(FeatureCollection(ft, crs=crs_geojson)) + return tuple(feature_collections) + + def geojson_from_dict(dictionary, crs, name_id, prop_dict=None, geom_attributes=True): """ get a geojson (featurecollection) from a dictionary of ids(keys) and geometries (values) @@ -284,54 +307,72 @@ def get_breakpoints_zerostreak(x, y): write_zero_streak = False last_extreme = 0 for i in range(1, len(x)): - if round(derivative[i],2) == 0: + if round(derivative[i], 2) == 0: streak = streak + 1 if start_streak == None: - start_streak = x[i-1] - elif (streak !=0): + start_streak = x[i - 1] + elif streak != 0: write_zero_streak = True - if start_streak != None and (write_zero_streak or len(x)-1 == i): - end_streak = x[i-1] + if start_streak != None and (write_zero_streak or len(x) - 1 == i): + end_streak = x[i - 1] if derivative[i] == 0: end_streak = x[i] - center_streak = start_streak + (end_streak - start_streak)/2 - zero_streaks.append((start_streak,end_streak,center_streak, streak,last_extreme)) + center_streak = start_streak + (end_streak - start_streak) / 2 + zero_streaks.append( + (start_streak, end_streak, center_streak, streak, last_extreme) + ) streak = 0 start_streak = None write_zero_streak = False - logging.debug('end_streak') - if i < len(x)-1 and round(derivative[i],2) > 0 and derivative[i - 1] <= derivative[i] and derivative[i]>= derivative[i + 1]: + logging.debug("end_streak") + if ( + i < len(x) - 1 + and round(derivative[i], 2) > 0 + and derivative[i - 1] <= derivative[i] + and derivative[i] >= derivative[i + 1] + ): last_extreme = derivative[i] extremes.append((x[i], derivative[i], "maximum")) - if i < len(x)-1 and round(derivative[i],2) < 0 and derivative[i - 1] >= derivative[i] and derivative[i]<= derivative[i + 1]: + if ( + i < len(x) - 1 + and round(derivative[i], 2) < 0 + and derivative[i - 1] >= derivative[i] + and derivative[i] <= derivative[i + 1] + ): last_extreme = derivative[i] extremes.append((x[i], derivative[i], "minimum")) for extremum in extremes: - logging.info(f"breakpoints: relevant_distance:{extremum[0]:.2f}, extreme:{extremum[1]:.2f} ({extremum[2]})") + logging.info( + f"breakpoints: relevant_distance:{extremum[0]:.2f}, extreme:{extremum[1]:.2f} ({extremum[2]})" + ) for st in zero_streaks: - logging.info(f"zero_streaks: [{st[0]:.2f} - {st[1]:.2f}] - center:{st[2]:.2f} - counter:{st[3]:.2f} - min/max-extreme:{st[4]:.2f} ") - #plt.plot(series, afgeleide, label='afgeleide-' + str(key)) - return extremes,zero_streaks + logging.info( + f"zero_streaks: [{st[0]:.2f} - {st[1]:.2f}] - center:{st[2]:.2f} - counter:{st[3]:.2f} - min/max-extreme:{st[4]:.2f} " + ) + # plt.plot(series, afgeleide, label='afgeleide-' + str(key)) + return extremes, zero_streaks + def numerical_derivative(x, y): - """ - Calculate the numerical derivative of a graph. + """ + Calculate the numerical derivative of a graph. - Parameters: - x (numpy.ndarray): The x values of the graph. - y (numpy.ndarray): The y values of the graph. + Parameters: + x (numpy.ndarray): The x values of the graph. + y (numpy.ndarray): The y values of the graph. + + Returns: + numpy.ndarray: The derivative of y with respect to x. + """ - Returns: - numpy.ndarray: The derivative of y with respect to x. - """ + dx = np.diff(x) + dy = np.diff(y) + derivative = dy / dx + derivative = np.insert(derivative, 0, 0) + # derivative = np.append(derivative, 0) - dx = np.diff(x) - dy = np.diff(y) - derivative = dy / dx - derivative = np.insert(derivative, 0, 0) - #derivative = np.append(derivative, 0) + return derivative - return derivative def _filter_dict_by_key(dictionary, filter_key): """ @@ -348,7 +389,9 @@ def _filter_dict_by_key(dictionary, filter_key): dict: A new dictionary containing only entries where the key matches the `filter_key`. """ return {key: dictionary[key] for key in dictionary.keys() if key == filter_key} -def filter_resulting_series_by_key(resulting_series,filter_key): + + +def filter_resulting_series_by_key(resulting_series, filter_key): """ Filters a dictionary of result tuples based on a specific key. @@ -368,7 +411,7 @@ def filter_resulting_series_by_key(resulting_series,filter_key): Returns: dict: A new dictionary (`filtered_resulting_series`) with the same structure as the original one, but containing filtered inner dictionaries based on the `filter_key`. """ - filtered_resulting_series ={} + filtered_resulting_series = {} for dist in resulting_series: result_tuple = resulting_series[dist] filtered_tuple = ( @@ -377,7 +420,7 @@ def filter_resulting_series_by_key(resulting_series,filter_key): _filter_dict_by_key(result_tuple[2], filter_key), _filter_dict_by_key(result_tuple[3], filter_key), _filter_dict_by_key(result_tuple[4], filter_key), - _filter_dict_by_key(result_tuple[5], filter_key) + _filter_dict_by_key(result_tuple[5], filter_key), ) filtered_resulting_series[dist] = filtered_tuple @@ -426,23 +469,28 @@ def diffs_from_dict_series(dict_series, dict_thematic): diffs = {} for key in keys: diffs[key] = {} - for rel_dist in dict_series: #all the relevant distances used to calculate the series + for ( + rel_dist + ) in dict_series: # all the relevant distances used to calculate the series results = dict_series[rel_dist][0] - results_diff =dict_series[rel_dist][1] + results_diff = dict_series[rel_dist][1] for key in keys: if key not in results.keys() and key not in results_diff.keys(): raise KeyError("No results calculated for theme_id " + str(key)) - #calculate the diffs you want to have - #diff = results_diff[key].area * 100 / results[key].area #percentage of change - diff = results[key].area - dict_thematic[key].area#difference (m²) between area of resulting geometry and original geometry - diff = round(diff, 1)#round, so the detected changes are within 10cm² - #diff = abs(results[key].area - dict_thematic[key].area) #absolute difference (m²) between area of resulting geometry and original geometry - #diff = abs(results[key].area - dict_thematic[key].area)*100/dict_thematic[key].area #absolute difference (%) between area of resulting geometry and original geometry - #TODO: determine a good diff-value for determination + # calculate the diffs you want to have + # diff = results_diff[key].area * 100 / results[key].area #percentage of change + diff = ( + results[key].area - dict_thematic[key].area + ) # difference (m²) between area of resulting geometry and original geometry + diff = round(diff, 1) # round, so the detected changes are within 10cm² + # diff = abs(results[key].area - dict_thematic[key].area) #absolute difference (m²) between area of resulting geometry and original geometry + # diff = abs(results[key].area - dict_thematic[key].area)*100/dict_thematic[key].area #absolute difference (%) between area of resulting geometry and original geometry + # TODO: determine a good diff-value for determination diffs[key][rel_dist] = diff return diffs + def get_collection(ref_url, limit): """ Fetches a collection of features from a paginated API endpoint. @@ -468,7 +516,10 @@ def get_collection(ref_url, limit): logging.debug(url) json = requests.get(url).json() feature_collection = json - if "features" not in feature_collection or len(feature_collection["features"]) == 0: + if ( + "features" not in feature_collection + or len(feature_collection["features"]) == 0 + ): break start_index = start_index + limit if collection == {}: @@ -477,6 +528,7 @@ def get_collection(ref_url, limit): collection["features"].extend(feature_collection["features"]) return collection + def merge_geometries_by_theme_id(dictionary): """ Merges geometries in a dictionary from multiple themes into a single theme. @@ -504,6 +556,7 @@ def merge_geometries_by_theme_id(dictionary): dict_out[id_theme_global] = unary_union(dict_out[id_theme_global]) return dict_out + def geom_from_dict(dict, key): """ Get the geometry from a dictionary with geometries. If key not present, diff --git a/examples/__init__.py b/examples/__init__.py index d5e3751..020fa08 100644 --- a/examples/__init__.py +++ b/examples/__init__.py @@ -5,7 +5,10 @@ import numpy as np -def _make_map(ax, results, results_diff_pos, results_diff_neg, thematic_dict, reference_dict): + +def _make_map( + ax, results, results_diff_pos, results_diff_neg, thematic_dict, reference_dict +): """ Fills an ax with a map: * reference_dict @@ -18,19 +21,66 @@ def _make_map(ax, results, results_diff_pos, results_diff_neg, thematic_dict, re try: if ax is None: ax = plt.subplot(1, 1, 1) - ax_result = gpd.GeoSeries(list(results.values())).plot(ax=ax, alpha=0.5, color='none', hatch=" ", edgecolor='green', linewidth=7.0, label='result', zorder=2) - ax_thematic_dict = gpd.GeoSeries(list(thematic_dict.values())).plot(ax=ax, alpha=0.8,color='none',hatch="/", edgecolor='#0000FF',linewidth=3.0,linestyle='dashdot',label='theme',zorder=3) - ax_diff_pos = gpd.GeoSeries(list(results_diff_pos.values())).plot(ax=ax, color='none', edgecolor='green', hatch="+",linewidth=0.0, linestyle='dashdot',label='diff_plus', zorder=4) - ax_diff_neg = gpd.GeoSeries(list(results_diff_neg.values())).plot(ax=ax, color='none', edgecolor='red', hatch="+",linewidth=0.0, linestyle='dashdot',label='diff_min', zorder=5) - #save the extent of original, resuling and difference - geometries - axis_extent = list(ax_thematic_dict.viewLim.intervalx) + list(ax_thematic_dict.viewLim.intervaly) - ax_reference_dict = gpd.GeoSeries(list(reference_dict.values())).plot(ax=ax,color='#FFF8C9',edgecolor='black',linewidth=2.0,label='reference', zorder=1) - #zoom map to saved extent + ax_result = gpd.GeoSeries(list(results.values())).plot( + ax=ax, + alpha=0.5, + color="none", + hatch=" ", + edgecolor="green", + linewidth=7.0, + label="result", + zorder=2, + ) + ax_thematic_dict = gpd.GeoSeries(list(thematic_dict.values())).plot( + ax=ax, + alpha=0.8, + color="none", + hatch="/", + edgecolor="#0000FF", + linewidth=3.0, + linestyle="dashdot", + label="theme", + zorder=3, + ) + ax_diff_pos = gpd.GeoSeries(list(results_diff_pos.values())).plot( + ax=ax, + color="none", + edgecolor="green", + hatch="+", + linewidth=0.0, + linestyle="dashdot", + label="diff_plus", + zorder=4, + ) + ax_diff_neg = gpd.GeoSeries(list(results_diff_neg.values())).plot( + ax=ax, + color="none", + edgecolor="red", + hatch="+", + linewidth=0.0, + linestyle="dashdot", + label="diff_min", + zorder=5, + ) + # save the extent of original, resuling and difference - geometries + axis_extent = list(ax_thematic_dict.viewLim.intervalx) + list( + ax_thematic_dict.viewLim.intervaly + ) + ax_reference_dict = gpd.GeoSeries(list(reference_dict.values())).plot( + ax=ax, + color="#FFF8C9", + edgecolor="black", + linewidth=2.0, + label="reference", + zorder=1, + ) + # zoom map to saved extent ax.axis(axis_extent) except: logging.error("make_map: Error while making map") return ax + def show_map(dict_results_by_distance, dict_thematic, dict_reference): """ Show results on a map @@ -38,18 +88,32 @@ def show_map(dict_results_by_distance, dict_thematic, dict_reference): len_series = len(dict_results_by_distance.keys()) i = 0 # Plot data in subplots - len_series_half = ceil(len_series / 2)#calculate half of the length of the series + len_series_half = ceil(len_series / 2) # calculate half of the length of the series for dist in dict_results_by_distance: ax = plt.subplot(len_series_half, 2, i + 1) - ax = _make_map(ax, dict_results_by_distance[dist][0], dict_results_by_distance[dist][2], dict_results_by_distance[dist][3], dict_thematic, dict_reference) - ax.set_title('Relevant distance (m):' + str(dist)) + ax = _make_map( + ax, + dict_results_by_distance[dist][0], + dict_results_by_distance[dist][2], + dict_results_by_distance[dist][3], + dict_thematic, + dict_reference, + ) + ax.set_title("Relevant distance (m):" + str(dist)) i = i + 1 # Adjust layout - #plt.tight_layout() + # plt.tight_layout() # Show figure plt.show() -def plot_series(series, dictionary,xlabel="relevant distance",ylabel="difference",title="Relevant distance vs difference"): + +def plot_series( + series, + dictionary, + xlabel="relevant distance", + ylabel="difference", + title="Relevant distance vs difference", +): for key in dictionary: if len(dictionary[key]) == len(series): lst_diffs = list(dictionary[key].values()) diff --git a/examples/example_131635.py b/examples/example_131635.py index 24112df..c86bf18 100644 --- a/examples/example_131635.py +++ b/examples/example_131635.py @@ -12,13 +12,14 @@ aligner.load_thematic_data_dict(dict_theme) aligner.load_reference_data_grb_actual(grb_type="adp", partition=1000) - #RESULTS + # RESULTS rel_dist = 2 dict_results_by_distance = {} #put resulting tuple in a dictionary dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(rel_dist,4) aligner.export_results("output/",formula=True) + show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) for key in dict_results_by_distance[rel_dist][0]: print(key) - print(aligner.get_formula(dict_results_by_distance[rel_dist][0][key])) \ No newline at end of file + print(aligner.get_formula(dict_results_by_distance[rel_dist][0][key])) diff --git a/examples/example_aligner.py b/examples/example_aligner.py index de46f2a..8e43777 100644 --- a/examples/example_aligner.py +++ b/examples/example_aligner.py @@ -48,6 +48,9 @@ # Example how to use the Aligner rel_dist = 6 dict_results_by_distance = {} - dict_results_by_distance[aligner.relevant_distance] = aligner.process_dict_thematic(relevant_distance=rel_dist, od_strategy=OpenbaarDomeinStrategy.SNAP_FULL_AREA_ALL_SIDE) + dict_results_by_distance[aligner.relevant_distance] = aligner.process_dict_thematic( + relevant_distance=rel_dist, + od_strategy=OpenbaarDomeinStrategy.SNAP_FULL_AREA_ALL_SIDE, + ) aligner.export_results("output/") show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) diff --git a/examples/example_ao.py b/examples/example_ao.py index 72137cb..fab4747 100644 --- a/examples/example_ao.py +++ b/examples/example_ao.py @@ -10,13 +10,13 @@ # Initiate brdr aligner = Aligner() # Load thematic data & reference data - #dict_theme = get_oe_dict_by_ids([206363], oetype='erfgoedobjecten') - aanduidingsobjecten = range(1,10) - dict_theme = get_oe_dict_by_ids(aanduidingsobjecten, oetype='aanduidingsobjecten') + # dict_theme = get_oe_dict_by_ids([206363], oetype='erfgoedobjecten') + aanduidingsobjecten = range(1, 10) + dict_theme = get_oe_dict_by_ids(aanduidingsobjecten, oetype="aanduidingsobjecten") aligner.load_thematic_data_dict(dict_theme) aligner.load_reference_data_grb_actual(grb_type="adp", partition=1000) - #RESULTS + # RESULTS # rel_dist = 0.2 # dict_results_by_distance = {} # #put resulting tuple in a dictionary @@ -24,11 +24,17 @@ # aligner.export_results("output/") # show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) - series = np.arange(0, 500, 20, dtype=int)/100 - #predict which relevant distances are interesting to propose as resulting geometry - dict_predicted, diffs = aligner.predictor(relevant_distances=series, od_strategy=2,treshold_overlap_percentage=50) + series = np.arange(0, 500, 20, dtype=int) / 100 + # predict which relevant distances are interesting to propose as resulting geometry + dict_predicted, diffs = aligner.predictor( + relevant_distances=series, od_strategy=2, treshold_overlap_percentage=50 + ) for key in dict_predicted.keys(): - diff ={} - diff[key]= diffs[key] - plot_series(series,diff) - show_map(dict_predicted[key], {key:aligner.dict_thematic[key]}, aligner.dict_reference) \ No newline at end of file + diff = {} + diff[key] = diffs[key] + plot_series(series, diff) + show_map( + dict_predicted[key], + {key: aligner.dict_thematic[key]}, + aligner.dict_reference, + ) diff --git a/examples/example_combined_borders_adp_gbg.py b/examples/example_combined_borders_adp_gbg.py index 729adb5..29cf67e 100644 --- a/examples/example_combined_borders_adp_gbg.py +++ b/examples/example_combined_borders_adp_gbg.py @@ -33,7 +33,7 @@ rel_dist = 2 dict_results_by_distance = {} - dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(rel_dist,4) + dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(rel_dist, 4) aligner.export_results("output/") show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) diff --git a/examples/example_eo.py b/examples/example_eo.py index 1963e33..632ae74 100644 --- a/examples/example_eo.py +++ b/examples/example_eo.py @@ -10,24 +10,24 @@ # Initiate brdr aligner = Aligner() # Load thematic data & reference data - #dict_theme = get_oe_dict_by_ids([206363], oetype='erfgoedobjecten') - - erfgoedobjecten =[ -# 206407, -# 206403, -# 206372, -# 206369, -# 206377, -# 206371, -# 206370, -# 206368, -206786 -] - dict_theme = get_oe_dict_by_ids(erfgoedobjecten, oetype='erfgoedobjecten') + # dict_theme = get_oe_dict_by_ids([206363], oetype='erfgoedobjecten') + + erfgoedobjecten = [ + # 206407, + # 206403, + # 206372, + # 206369, + # 206377, + # 206371, + # 206370, + # 206368, + 206786 + ] + dict_theme = get_oe_dict_by_ids(erfgoedobjecten, oetype="erfgoedobjecten") aligner.load_thematic_data_dict(dict_theme) aligner.load_reference_data_grb_actual(grb_type="adp", partition=1000) - #RESULTS + # RESULTS # rel_dist = 0.2 # dict_results_by_distance = {} # #put resulting tuple in a dictionary @@ -35,14 +35,20 @@ # aligner.export_results("output/") # show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) + series = np.arange(0, 200, 20, dtype=int)/100 #predict which relevant distances are interesting to propose as resulting geometry dict_predicted, diffs = aligner.predictor(relevant_distances=series, od_strategy=2,treshold_overlap_percentage=50) fcs = aligner.get_predictions_as_geojson() write_geojson('output/predicted.geojson',fcs[0]) write_geojson('output/predicted_diff.geojson', fcs[1]) + for key in dict_predicted.keys(): diff = {} diff[key] = diffs[key] plot_series(series, diff) - show_map(dict_predicted[key], {key:aligner.dict_thematic[key]}, aligner.dict_reference) \ No newline at end of file + show_map( + dict_predicted[key], + {key: aligner.dict_thematic[key]}, + aligner.dict_reference, + ) diff --git a/examples/example_local_data.py b/examples/example_local_data.py index 4eb4a34..8ec961b 100644 --- a/examples/example_local_data.py +++ b/examples/example_local_data.py @@ -5,14 +5,19 @@ if __name__ == "__main__": # Initiate brdr aligner = Aligner() - #Load local thematic data and reference data + # Load local thematic data and reference data aligner.load_thematic_data_file( "../tests/testdata/themelayer_referenced.geojson", "id_theme" ) - aligner.load_reference_data_file('../tests/testdata/reference_leuven.geojson', "capakey") + aligner.load_reference_data_file( + "../tests/testdata/reference_leuven.geojson", "capakey" + ) # Example how to use the Aligner rel_dist = 1 dict_results_by_distance = {} - dict_results_by_distance[aligner.relevant_distance] = aligner.process_dict_thematic(relevant_distance=rel_dist, od_strategy=OpenbaarDomeinStrategy.SNAP_FULL_AREA_ALL_SIDE) + dict_results_by_distance[aligner.relevant_distance] = aligner.process_dict_thematic( + relevant_distance=rel_dist, + od_strategy=OpenbaarDomeinStrategy.SNAP_FULL_AREA_ALL_SIDE, + ) aligner.export_results("output/") - #show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) + # show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) diff --git a/examples/example_multi_to_single.py b/examples/example_multi_to_single.py index 333fda6..2026c20 100644 --- a/examples/example_multi_to_single.py +++ b/examples/example_multi_to_single.py @@ -22,7 +22,7 @@ rel_dist = 2 dict_results_by_distance = {} - dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(rel_dist,4) + dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(rel_dist, 4) aligner.export_results("output/") show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) @@ -43,7 +43,7 @@ rel_dist = 5 dict_results_by_distance = {} - dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(rel_dist,4) + dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(rel_dist, 4) aligner.export_results("output/") show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) diff --git a/examples/example_parcel_change_detector.py b/examples/example_parcel_change_detector.py index cd16eb0..86448bd 100644 --- a/examples/example_parcel_change_detector.py +++ b/examples/example_parcel_change_detector.py @@ -17,6 +17,7 @@ # * it can be used to convert the geometries to a formula, to compare and # evaluate if equality is detected after alignement + def check_business_equality(base_formula, actual_formula): """ function that checks if 2 formulas are equal (determined by business-logic) @@ -24,7 +25,7 @@ def check_business_equality(base_formula, actual_formula): if base_formula.keys() != actual_formula.keys(): return False for key in base_formula.keys(): - if base_formula[key]['full'] != actual_formula[key]['full']: + if base_formula[key]["full"] != actual_formula[key]["full"]: return False # if abs(base_formula[key]['area'] - actual_formula[key]['area'])>1: #area changed by 1 m² # return False @@ -33,8 +34,8 @@ def check_business_equality(base_formula, actual_formula): return True -#PARAMS -#========= +# PARAMS +# ========= crs = "EPSG:31370" limit = 10000 # bbox = "172800,170900,173000,171100" @@ -42,14 +43,20 @@ def check_business_equality(base_formula, actual_formula): bbox = "170000,170000,175000,174900" # bbox = "100000,195000,105000,195900" # bbox = "150000,210000,155000,214900" -#bbox = "173500,173500,174000,174000" # example "aanduid_id" = 34195 +# bbox = "173500,173500,174000,174000" # example "aanduid_id" = 34195 base_year = "2023" -base_correction = 0 # relevant distance that is used to align the original geometries to the reference-polygons of the base-year -excluded_area = 10000 #geometries bigger than this, will be excluded -series = [0, 0.5, 1, 1.5, 2] #series of relevant distance that is used to check if we can auto-align the geometries to the actual reference-polygons to get an 'equal' formula - -#BASE -#===== +base_correction = 0 # relevant distance that is used to align the original geometries to the reference-polygons of the base-year +excluded_area = 10000 # geometries bigger than this, will be excluded +series = [ + 0, + 0.5, + 1, + 1.5, + 2, +] # series of relevant distance that is used to check if we can auto-align the geometries to the actual reference-polygons to get an 'equal' formula + +# BASE +# ===== # Initiate a Aligner to create a themeset that is base-referenced on a specific # base_year base_aligner = Aligner() @@ -57,9 +64,7 @@ def check_business_equality(base_formula, actual_formula): # base_aligner.load_thematic_data_file("testdata/theme_changetest.geojson", # 'theme_identifier') base_aligner.load_thematic_data_file( # "testdata/theme_leuven.geojson", 'aanduid_id') -base_aligner.load_thematic_data_geojson( - get_oe_geojson_by_bbox(bbox), "aanduid_id" -) +base_aligner.load_thematic_data_geojson(get_oe_geojson_by_bbox(bbox), "aanduid_id") logging.info( "Number of OE-thematic features loaded into base-aligner: " + str(len(base_aligner.dict_thematic)) @@ -76,16 +81,27 @@ def check_business_equality(base_formula, actual_formula): base_aligner.load_reference_data_geojson(collection, "CAPAKEY") # SEARCH FOR CHANGED Parcels in specific timespan -#================================================= -version_date = base_year + "-01-01" # all changes between this date and NOW will be found +# ================================================= +version_date = ( + base_year + "-01-01" +) # all changes between this date and NOW will be found base_url = "https://geo.api.vlaanderen.be/GRB/ogc/features/collections/ADP/items?" -adp_url = (base_url + "datetime="+ version_date + "%2F9999-12-31T00:00:00Z" - + "& limit="+ str(limit)+ "&crs=" + crs + "&bbox-crs=EPSG:31370&bbox=" + bbox +adp_url = ( + base_url + + "datetime=" + + version_date + + "%2F9999-12-31T00:00:00Z" + + "& limit=" + + str(limit) + + "&crs=" + + crs + + "&bbox-crs=EPSG:31370&bbox=" + + bbox ) collection = get_collection(adp_url, limit) array_features = [] -for feature in collection['features']: +for feature in collection["features"]: geom = shape(feature["geometry"]).buffer(0) array_features.append(geom) if len(array_features) == 0: @@ -102,11 +118,11 @@ def check_business_equality(base_formula, actual_formula): for key in thematic_intersections: geometry_base_original = base_aligner.dict_thematic[key] print(key) - print (geometry_base_original) + print(geometry_base_original) -#ACTUAL +# ACTUAL # Initiate a Aligner to reference thematic features to the actual borders -#================================================================================ +# ================================================================================ # Initiate a Aligner to reference thematic features to the actual borders actual_aligner = Aligner() @@ -118,8 +134,8 @@ def check_business_equality(base_formula, actual_formula): actual_aligner.load_reference_data_geojson(collection, "CAPAKEY") -#LOOP AND PROCESS ALL POSSIBLE AFFECTED FEATURES -#================================================= +# LOOP AND PROCESS ALL POSSIBLE AFFECTED FEATURES +# ================================================= counter_equality = 0 counter_difference = 0 counter_excluded = 0 @@ -136,7 +152,7 @@ def check_business_equality(base_formula, actual_formula): geometry_base_original, base_correction ) last_version_date = base_aligner.get_last_version_date(geometry_base_result) - logging.info('key:' + key + '-->last_version_date: ' + last_version_date) + logging.info("key:" + key + "-->last_version_date: " + last_version_date) logging.info("Original formula: " + key) base_formula = base_aligner.get_formula(geometry_base_result) @@ -144,12 +160,12 @@ def check_business_equality(base_formula, actual_formula): geometry_actual_result, b, c, d, e, f = actual_aligner.process_geometry( geometry_base_result, i ) - logging.info( - "New formula: " + key + " with relevant distance(m) : " + str(i) - ) + logging.info("New formula: " + key + " with relevant distance(m) : " + str(i)) actual_formula = actual_aligner.get_formula(geometry_actual_result) diff = True - if check_business_equality(base_formula, actual_formula): # Logic to be determined by business + if check_business_equality( + base_formula, actual_formula + ): # Logic to be determined by business counter_equality = counter_equality + 1 logging.info("equality detected for: " + key + " at distance(m): " + str(i)) diff = False diff --git a/examples/example_parcel_vs_building.py b/examples/example_parcel_vs_building.py index bd60d8b..0c6092d 100644 --- a/examples/example_parcel_vs_building.py +++ b/examples/example_parcel_vs_building.py @@ -26,7 +26,7 @@ ) # gebruik de actuele adp-percelen adp= administratieve percelen # Example how to use a series (for histogram) - series = np.arange(0, 300, 10, dtype=int)/100 + series = np.arange(0, 300, 10, dtype=int) / 100 x_dict_series = aligner_x.process_series(series, 4, 50) x_resulting_areas = diffs_from_dict_series(x_dict_series, aligner_x.dict_thematic) y_dict_series = aligner_y.process_series(series, 4, 50) @@ -37,5 +37,8 @@ # Make a 1-by-1 comparison for each thematic feature compared to the 2 references ( # parcels and buildings) for key in x_resulting_areas: - dict_diff = {"x" + str(key): x_resulting_areas[key], "y" + str(key): y_resulting_areas[key]} + dict_diff = { + "x" + str(key): x_resulting_areas[key], + "y" + str(key): y_resulting_areas[key], + } plot_series(series, dict_diff) diff --git a/examples/example_readme.py b/examples/example_readme.py index bd68172..4cbe102 100644 --- a/examples/example_readme.py +++ b/examples/example_readme.py @@ -2,26 +2,35 @@ from shapely import from_wkt from brdr.enums import OpenbaarDomeinStrategy -#CREATE AN ALIGNER -aligner = Aligner(relevant_distance=1, od_strategy=OpenbaarDomeinStrategy.SNAP_SINGLE_SIDE, - threshold_overlap_percentage=50, crs='EPSG:31370') -#ADD A THEMATIC POLYGON TO THEMATIC DICTIONARY and LOAD into Aligner -thematic_dict= {"theme_id_1": from_wkt('POLYGON ((0 0, 0 9, 5 10, 10 0, 0 0))')} +# CREATE AN ALIGNER +aligner = Aligner( + relevant_distance=1, + od_strategy=OpenbaarDomeinStrategy.SNAP_SINGLE_SIDE, + threshold_overlap_percentage=50, + crs="EPSG:31370", +) +# ADD A THEMATIC POLYGON TO THEMATIC DICTIONARY and LOAD into Aligner +thematic_dict = {"theme_id_1": from_wkt("POLYGON ((0 0, 0 9, 5 10, 10 0, 0 0))")} aligner.load_thematic_data_dict(thematic_dict) -#ADD A REFERENCE POLYGON TO REFERENCE DICTIONARY and LOAD into Aligner -reference_dict = {"ref_id_1": from_wkt('POLYGON ((0 1, 0 10,8 10,10 1,0 1))')} +# ADD A REFERENCE POLYGON TO REFERENCE DICTIONARY and LOAD into Aligner +reference_dict = {"ref_id_1": from_wkt("POLYGON ((0 1, 0 10,8 10,10 1,0 1))")} aligner.load_reference_data_dict(reference_dict) -#EXECUTE THE ALIGNMENT -result, result_diff, result_diff_plus, result_diff_min, relevant_intersection, relevant_diff = ( - aligner.process_dict_thematic(relevant_distance=1)) -#PRINT RESULTS IN WKT -print ('result: ' + result['theme_id_1'].wkt) -print ('added area: ' + result_diff_plus['theme_id_1'].wkt) -print ('removed area: ' + result_diff_min['theme_id_1'].wkt) -#SHOW RESULTING GEOMETRY AND CHANGES +# EXECUTE THE ALIGNMENT +( + result, + result_diff, + result_diff_plus, + result_diff_min, + relevant_intersection, + relevant_diff, +) = aligner.process_dict_thematic(relevant_distance=1) +# PRINT RESULTS IN WKT +print("result: " + result["theme_id_1"].wkt) +print("added area: " + result_diff_plus["theme_id_1"].wkt) +print("removed area: " + result_diff_min["theme_id_1"].wkt) +# SHOW RESULTING GEOMETRY AND CHANGES # from examples import show_map # show_map( # {aligner.relevant_distance:(result, result_diff, result_diff_plus, result_diff_min, relevant_intersection, relevant_diff)}, # thematic_dict, # reference_dict) - diff --git a/examples/example_wanted_changes.py b/examples/example_wanted_changes.py index b9757c9..d95f3e3 100644 --- a/examples/example_wanted_changes.py +++ b/examples/example_wanted_changes.py @@ -1,11 +1,16 @@ import numpy as np from brdr.aligner import Aligner -from brdr.utils import get_breakpoints_zerostreak, diffs_from_dict_series, filter_resulting_series_by_key, \ - write_geojson, geojson_tuple_from_series +from brdr.utils import ( + get_breakpoints_zerostreak, + diffs_from_dict_series, + filter_resulting_series_by_key, + write_geojson, + geojson_tuple_from_series, +) from examples import plot_series, show_map # Press the green button in the gutter to run the script. -if __name__ == '__main__': +if __name__ == "__main__": """ example to test if we can seperate wanted deviations from unwanted deviations. By calculating results with a series of relevant distances we get a graphic. @@ -18,46 +23,54 @@ ##Initiate a Aligner aligner = Aligner() ##Load thematic data & reference data - aligner.load_thematic_data_file("../tests/testdata/test_wanted_changes.geojson", 'theme_id') - aligner.load_reference_data_grb_actual(grb_type='adp', partition=1000) #gebruik de actuele adp-percelen adp= administratieve percelen + aligner.load_thematic_data_file( + "../tests/testdata/test_wanted_changes.geojson", "theme_id" + ) + aligner.load_reference_data_grb_actual( + grb_type="adp", partition=1000 + ) # gebruik de actuele adp-percelen adp= administratieve percelen - - - #Example how to use the Aligner + # Example how to use the Aligner rel_dist = 2 dict_results_by_distance = {} - dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(rel_dist,4) + dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(rel_dist, 4) aligner.export_results("output/") show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) - #Possibility to get the descriptive formula of a thematic feature + # Possibility to get the descriptive formula of a thematic feature results = dict_results_by_distance[rel_dist][0] for key in results: print(key) print(aligner.get_formula(results[key])) - #Example how to use a series (for histogram) - series = np.arange(0, 500, 10, dtype=int)/100 - dict_series = aligner.process_series(series,4,50) + # Example how to use a series (for histogram) + series = np.arange(0, 500, 10, dtype=int) / 100 + dict_series = aligner.process_series(series, 4, 50) resulting_areas = diffs_from_dict_series(dict_series, aligner.dict_thematic) fc = geojson_tuple_from_series(dict_series, aligner.CRS, aligner.name_thematic_id) - write_geojson('output/series.geojson',fc[0]) - write_geojson('output/series_diff.geojson', fc[1]) - write_geojson('output/series_relevant_difference.geojson', fc[5]) + write_geojson("output/series.geojson", fc[0]) + write_geojson("output/series_diff.geojson", fc[1]) + write_geojson("output/series_relevant_difference.geojson", fc[5]) plot_series(series, resulting_areas) for key in resulting_areas: if len(resulting_areas[key]) == len(series): lst_diffs = list(resulting_areas[key].values()) extremes, zero_streak = get_breakpoints_zerostreak(series, lst_diffs) - print (str(key)) + print(str(key)) for extremum in extremes: print(f"{extremum[0]:.2f}, {extremum[1]:.2f} ({extremum[2]})") for st in zero_streak: - print(f"{st[0]:.2f} - {st[1]:.2f} -{st[2]:.2f} - {st[3]:.2f} - startextreme {st[4]:.2f} ") + print( + f"{st[0]:.2f} - {st[1]:.2f} -{st[2]:.2f} - {st[3]:.2f} - startextreme {st[4]:.2f} " + ) dict_results_by_distance = {} - dict_results_by_distance[st[0]] = aligner.process_dict_thematic(st[0], 4) - dict_results_by_distance = filter_resulting_series_by_key(dict_results_by_distance,key) - show_map(dict_results_by_distance, {key:aligner.dict_thematic[key]}, aligner.dict_reference) - - - - + dict_results_by_distance[st[0]] = aligner.process_dict_thematic( + st[0], 4 + ) + dict_results_by_distance = filter_resulting_series_by_key( + dict_results_by_distance, key + ) + show_map( + dict_results_by_distance, + {key: aligner.dict_thematic[key]}, + aligner.dict_reference, + ) diff --git a/examples/examples_aligner.py b/examples/examples_aligner.py index 8a2b2af..aedfec1 100644 --- a/examples/examples_aligner.py +++ b/examples/examples_aligner.py @@ -14,7 +14,7 @@ # Use GRB adp-parcels as reference polygons adp= administratieve percelen aligner.load_reference_data_grb_actual(grb_type="adp", partition=1000) - #alternative reference poly + # alternative reference poly # # Use GRB-gbg (buildings), gbg= gebouw aan de grond # x.load_reference_data_grb_actual('gbg') ## Use local data @@ -23,13 +23,18 @@ # Example how to use the Aligner rel_dist = 10 dict_results_by_distance = {} - dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(relevant_distance=rel_dist, od_strategy=OpenbaarDomeinStrategy.SNAP_FULL_AREA_SINGLE_SIDE) + dict_results_by_distance[rel_dist] = aligner.process_dict_thematic( + relevant_distance=rel_dist, + od_strategy=OpenbaarDomeinStrategy.SNAP_FULL_AREA_SINGLE_SIDE, + ) aligner.export_results("output/") show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) rel_dist = 6 dict_results_by_distance = {} - dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(relevant_distance=rel_dist, od_strategy=OpenbaarDomeinStrategy.SNAP_ALL_SIDE) + dict_results_by_distance[rel_dist] = aligner.process_dict_thematic( + relevant_distance=rel_dist, od_strategy=OpenbaarDomeinStrategy.SNAP_ALL_SIDE + ) aligner.export_results("output/") show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) # for key in r: @@ -45,6 +50,10 @@ # border will be used for cases where relevant zones cannot be used for determination) rel_dist = 6 dict_results_by_distance = {} - dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(relevant_distance=rel_dist, od_strategy=OpenbaarDomeinStrategy.SNAP_FULL_AREA_ALL_SIDE,treshold_overlap_percentage=-1) + dict_results_by_distance[rel_dist] = aligner.process_dict_thematic( + relevant_distance=rel_dist, + od_strategy=OpenbaarDomeinStrategy.SNAP_FULL_AREA_ALL_SIDE, + treshold_overlap_percentage=-1, + ) aligner.export_results("output/") - show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) \ No newline at end of file + show_map(dict_results_by_distance, aligner.dict_thematic, aligner.dict_reference) diff --git a/examples/examples_predictor.py b/examples/examples_predictor.py index b93b028..a779e90 100644 --- a/examples/examples_predictor.py +++ b/examples/examples_predictor.py @@ -4,24 +4,30 @@ from examples import show_map # Press the green button in the gutter to run the script. -if __name__ == '__main__': +if __name__ == "__main__": """ - example to use the predictor-function to automatically predict which resulting geometries are interesting to look at + example to use the predictor-function to automatically predict which resulting geometries are interesting to look at (based on detection of breakpoints and relevant distances of 'no-change') """ # TODO: future possibilities to choose the best proposal automatically? (AI-machine learning?) ##Initiate a Aligner aligner = Aligner() ##Load thematic data & reference data - aligner.load_thematic_data_file("../tests/testdata/test_wanted_changes.geojson", 'theme_id') - aligner.load_reference_data_grb_actual(grb_type='adp', partition=1000) #gebruik de actuele adp-percelen adp= administratieve percelen + aligner.load_thematic_data_file( + "../tests/testdata/test_wanted_changes.geojson", "theme_id" + ) + aligner.load_reference_data_grb_actual( + grb_type="adp", partition=1000 + ) # gebruik de actuele adp-percelen adp= administratieve percelen - series = np.arange(0, 300, 10, dtype=int)/100 - #predict which relevant distances are interesting to propose as resulting geometry - dict_predicted = aligner.predictor(relevant_distances=series, od_strategy=4,treshold_overlap_percentage=50) + series = np.arange(0, 300, 10, dtype=int) / 100 + # predict which relevant distances are interesting to propose as resulting geometry + dict_predicted = aligner.predictor( + relevant_distances=series, od_strategy=4, treshold_overlap_percentage=50 + ) for key in dict_predicted.keys(): - show_map(dict_predicted[key], {key:aligner.dict_thematic[key]}, aligner.dict_reference) - - - - + show_map( + dict_predicted[key], + {key: aligner.dict_thematic[key]}, + aligner.dict_reference, + ) diff --git a/examples/stats_snapping_distance_creation.py b/examples/stats_snapping_distance_creation.py index 311aadf..ed8ef79 100644 --- a/examples/stats_snapping_distance_creation.py +++ b/examples/stats_snapping_distance_creation.py @@ -12,7 +12,7 @@ array_treshold_overlap_percentage = [50] array_od = [1] # array_relevant_distance = [0.2, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 8, 10] -array_relevant_distance = np.arange(0, 500, 10, dtype=int)/100 +array_relevant_distance = np.arange(0, 500, 10, dtype=int) / 100 print(array_relevant_distance) x = Aligner() diff --git a/pyproject.toml b/pyproject.toml index f76d4cb..2fe7ebe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,13 +36,14 @@ Issues = "https://github.com/OnroerendErfgoed/brdr/issues" [project.optional-dependencies] dev = [ "black==24.4.0", + "flake8==7.0.0", "geopandas==0.14.3", - "matplotlib==3.8.4", "hatchling==1.24.2", + "matplotlib==3.8.4", + "mypy==1.9.0", "pip-tools==7.4.1", "pytest-cov==5.0.0", "pytest==8.1.1", - "mypy==1.9.0", "toml==0.10.2", "types-requests==2.31.0.20240406", ] @@ -53,3 +54,6 @@ build-backend = "hatchling.build" [tool.setuptools] packages = ["brdr"] + +[tool.black] +target-version = ['py39', 'py310', 'py311', 'py312'] diff --git a/requirements-dev.txt b/requirements-dev.txt index 4cec2af..b25bcf4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -28,10 +28,10 @@ coverage==7.4.4 # via pytest-cov cycler==0.12.1 # via matplotlib -exceptiongroup==1.2.1 - # via pytest fiona==1.9.6 # via geopandas +flake8==7.0.0 + # via brdr (pyproject.toml) fonttools==4.51.0 # via matplotlib geojson==3.1.0 @@ -48,6 +48,8 @@ kiwisolver==1.4.5 # via matplotlib matplotlib==3.8.4 # via brdr (pyproject.toml) +mccabe==0.7.0 + # via flake8 mypy==1.9.0 # via brdr (pyproject.toml) mypy-extensions==1.0.0 @@ -84,6 +86,10 @@ pluggy==1.4.0 # via # hatchling # pytest +pycodestyle==2.11.1 + # via flake8 +pyflakes==3.2.0 + # via flake8 pyparsing==3.1.2 # via matplotlib pyproj==3.6.1 @@ -116,24 +122,12 @@ six==1.16.0 # python-dateutil toml==0.10.2 # via brdr (pyproject.toml) -tomli==2.0.1 - # via - # black - # build - # coverage - # hatchling - # mypy - # pip-tools - # pyproject-hooks - # pytest trove-classifiers==2024.5.22 # via hatchling types-requests==2.31.0.20240406 # via brdr (pyproject.toml) typing-extensions==4.11.0 - # via - # black - # mypy + # via mypy tzdata==2024.1 # via pandas urllib3==2.2.1 diff --git a/tests/test_aligner.py b/tests/test_aligner.py index 088e825..a648b29 100644 --- a/tests/test_aligner.py +++ b/tests/test_aligner.py @@ -60,10 +60,20 @@ def test_get_last_version_date(self): def test_export_results(self): aligner = Aligner() - aligner.load_thematic_data_dict({"theme_id_1": from_wkt('POLYGON ((0 0, 0 9, 5 10, 10 0, 0 0))')}) - aligner.load_reference_data_dict({"ref_id_1": from_wkt('POLYGON ((0 1, 0 10,8 10,10 1,0 1))')}) - result, result_diff, result_diff_plus, result_diff_min, relevant_intersection, relevant_diff = ( - aligner.process_dict_thematic()) + aligner.load_thematic_data_dict( + {"theme_id_1": from_wkt("POLYGON ((0 0, 0 9, 5 10, 10 0, 0 0))")} + ) + aligner.load_reference_data_dict( + {"ref_id_1": from_wkt("POLYGON ((0 1, 0 10,8 10,10 1,0 1))")} + ) + ( + result, + result_diff, + result_diff_plus, + result_diff_min, + relevant_intersection, + relevant_diff, + ) = aligner.process_dict_thematic() path = "./tmp/" aligner.export_results(path=path) for file_name in os.listdir(path): @@ -73,9 +83,7 @@ def test_export_results(self): def test_partition(self): # Test partition function delta = 2.0 - filtered_partitions = self.sample_aligner.partition( - self.sample_geom, delta - ) + filtered_partitions = self.sample_aligner.partition(self.sample_geom, delta) # Check if the result is a list of Polygon objects self.assertIsInstance(filtered_partitions, list) @@ -110,46 +118,65 @@ def test_process_geometry(self): key_ref = "a" ref_dict = {key_ref: self.sample_geom} self.sample_aligner.load_reference_data_dict(ref_dict) - result, result_diff, result_diff_plus, result_diff_min, relevant_intersection, relevant_diff = self.sample_aligner.process_geometry( - self.sample_geom.buffer(0.5) - ) + ( + result, + result_diff, + result_diff_plus, + result_diff_min, + relevant_intersection, + relevant_diff, + ) = self.sample_aligner.process_geometry(self.sample_geom.buffer(0.5)) self.assertTrue(from_wkt(result.wkt).equals(from_wkt(self.sample_geom.wkt))) self.assertFalse(result_diff.is_empty) def test_predictor(self): ##Load thematic data & reference data - thematic_dict = {"theme_id": from_wkt('POLYGON ((0 0, 0 9, 5 10, 10 0, 0 0))')} + thematic_dict = {"theme_id": from_wkt("POLYGON ((0 0, 0 9, 5 10, 10 0, 0 0))")} # ADD A REFERENCE POLYGON TO REFERENCE DICTIONARY - reference_dict = {"ref_id": from_wkt('POLYGON ((0 1, 0 10,8 10,10 1,0 1))')} + reference_dict = {"ref_id": from_wkt("POLYGON ((0 1, 0 10,8 10,10 1,0 1))")} # LOAD THEMATIC DICTIONARY self.sample_aligner.load_thematic_data_dict(thematic_dict) # LOAD REFERENCE DICTIONARY self.sample_aligner.load_reference_data_dict(reference_dict) - series = np.arange(0, 300, 10, dtype=int)/100 + series = np.arange(0, 300, 10, dtype=int) / 100 # predict which relevant distances are interesting to propose as resulting geometry - dict_predicted, diffs = self.sample_aligner.predictor(relevant_distances=series, od_strategy=4, - treshold_overlap_percentage=50) + dict_predicted, diffs = self.sample_aligner.predictor( + relevant_distances=series, od_strategy=4, treshold_overlap_percentage=50 + ) self.assertEqual(len(dict_predicted), len(thematic_dict)) def test_load_reference_data_grb_actual_adp(self): - thematic_dict = {"theme_id_1": from_wkt( - 'MultiPolygon (((174184.09476602054201066 171899.68933439542888664, 174400.56834639035514556 171832.959863749332726, 174388.65236948925303295 171770.99678386366576888, 174182.10876987033407204 171836.13745758961886168, 174184.88916448061354458 171873.07698598300339654, 174184.09476602054201066 171899.68933439542888664)))')} + thematic_dict = { + "theme_id_1": from_wkt( + "MultiPolygon (((174184.09476602054201066 171899.68933439542888664, 174400.56834639035514556 171832.959863749332726, 174388.65236948925303295 171770.99678386366576888, 174182.10876987033407204 171836.13745758961886168, 174184.88916448061354458 171873.07698598300339654, 174184.09476602054201066 171899.68933439542888664)))" + ) + } self.sample_aligner.load_thematic_data_dict(thematic_dict) # LOAD REFERENCE DICTIONARY - self.sample_aligner.load_reference_data_grb_actual(grb_type="adp", partition=1000) + self.sample_aligner.load_reference_data_grb_actual( + grb_type="adp", partition=1000 + ) self.assertGreater(len(self.sample_aligner.dict_reference), 0) def test_load_reference_data_grb_actual_gbg(self): - thematic_dict = {"theme_id_1": from_wkt( - 'MultiPolygon (((174184.09476602054201066 171899.68933439542888664, 174400.56834639035514556 171832.959863749332726, 174388.65236948925303295 171770.99678386366576888, 174182.10876987033407204 171836.13745758961886168, 174184.88916448061354458 171873.07698598300339654, 174184.09476602054201066 171899.68933439542888664)))')} + thematic_dict = { + "theme_id_1": from_wkt( + "MultiPolygon (((174184.09476602054201066 171899.68933439542888664, 174400.56834639035514556 171832.959863749332726, 174388.65236948925303295 171770.99678386366576888, 174182.10876987033407204 171836.13745758961886168, 174184.88916448061354458 171873.07698598300339654, 174184.09476602054201066 171899.68933439542888664)))" + ) + } self.sample_aligner.load_thematic_data_dict(thematic_dict) # LOAD REFERENCE DICTIONARY - self.sample_aligner.load_reference_data_grb_actual(grb_type="gbg", partition=1000) + self.sample_aligner.load_reference_data_grb_actual( + grb_type="gbg", partition=1000 + ) self.assertGreater(len(self.sample_aligner.dict_reference), 0) def test_load_reference_data_grb_actual_knw(self): - thematic_dict = {"theme_id_1": from_wkt( - 'MultiPolygon (((174184.09476602054201066 171899.68933439542888664, 174400.56834639035514556 171832.959863749332726, 174388.65236948925303295 171770.99678386366576888, 174182.10876987033407204 171836.13745758961886168, 174184.88916448061354458 171873.07698598300339654, 174184.09476602054201066 171899.68933439542888664)))')} + thematic_dict = { + "theme_id_1": from_wkt( + "MultiPolygon (((174184.09476602054201066 171899.68933439542888664, 174400.56834639035514556 171832.959863749332726, 174388.65236948925303295 171770.99678386366576888, 174182.10876987033407204 171836.13745758961886168, 174184.88916448061354458 171873.07698598300339654, 174184.09476602054201066 171899.68933439542888664)))" + ) + } self.sample_aligner.load_thematic_data_dict(thematic_dict) # LOAD REFERENCE DICTIONARY self.sample_aligner.load_reference_data_grb_actual(grb_type="knw", partition=0) @@ -158,24 +185,34 @@ def test_load_reference_data_grb_actual_knw(self): def test_all_od_strategies(self): ##Load thematic data & reference data - thematic_dict = {"theme_id_1": from_wkt('POLYGON ((0 0, 0 9, 5 10, 10 0, 0 0))')} + thematic_dict = { + "theme_id_1": from_wkt("POLYGON ((0 0, 0 9, 5 10, 10 0, 0 0))") + } # ADD A REFERENCE POLYGON TO REFERENCE DICTIONARY - reference_dict = {"ref_id_1": from_wkt('POLYGON ((0 1, 0 10,8 10,10 1,0 1))')} + reference_dict = {"ref_id_1": from_wkt("POLYGON ((0 1, 0 10,8 10,10 1,0 1))")} # LOAD THEMATIC DICTIONARY self.sample_aligner.load_thematic_data_dict(thematic_dict) # LOAD REFERENCE DICTIONARY self.sample_aligner.load_reference_data_dict(reference_dict) for od_strategy in OpenbaarDomeinStrategy: - tuple = self.sample_aligner.process_dict_thematic(relevant_distance=1, od_strategy=od_strategy, - treshold_overlap_percentage=50) + tuple = self.sample_aligner.process_dict_thematic( + relevant_distance=1, + od_strategy=od_strategy, + treshold_overlap_percentage=50, + ) self.assertEqual(len(tuple), 6) def test_process_interior_ring(self): - thematic_dict = {"theme_id_1": from_wkt( - 'MultiPolygon (((174370.67910432978533208 171012.2469546866195742, 174461.24052877808571793 171002.71417316573206335, 174429.46459037516615354 170869.25523187351063825, 174373.85669817010057159 170894.6759825958579313, 174369.09030740967136808 170896.6619787460367661, 174370.67910432978533208 171012.2469546866195742),(174400.07184735251939856 170963.78864862219779752, 174401.26344504262669943 170926.4519209987774957, 174419.53460962430108339 170922.47992869839072227, 174429.06739114515949041 170958.62505863170372322, 174400.07184735251939856 170963.78864862219779752)))')} + thematic_dict = { + "theme_id_1": from_wkt( + "MultiPolygon (((174370.67910432978533208 171012.2469546866195742, 174461.24052877808571793 171002.71417316573206335, 174429.46459037516615354 170869.25523187351063825, 174373.85669817010057159 170894.6759825958579313, 174369.09030740967136808 170896.6619787460367661, 174370.67910432978533208 171012.2469546866195742),(174400.07184735251939856 170963.78864862219779752, 174401.26344504262669943 170926.4519209987774957, 174419.53460962430108339 170922.47992869839072227, 174429.06739114515949041 170958.62505863170372322, 174400.07184735251939856 170963.78864862219779752)))" + ) + } self.sample_aligner.load_thematic_data_dict(thematic_dict) # LOAD REFERENCE DICTIONARY - self.sample_aligner.load_reference_data_grb_actual(grb_type="adp", partition=1000) + self.sample_aligner.load_reference_data_grb_actual( + grb_type="adp", partition=1000 + ) tuple = self.sample_aligner.process_dict_thematic() results = tuple[0] self.assertEqual(len(results), len(thematic_dict)) @@ -185,21 +222,47 @@ def test_process_circle(self): thematic_dict = {"key": geometry} self.sample_aligner.load_thematic_data_dict(thematic_dict) # LOAD REFERENCE DICTIONARY - self.sample_aligner.load_reference_data_grb_actual(grb_type="adp", partition=1000) + self.sample_aligner.load_reference_data_grb_actual( + grb_type="adp", partition=1000 + ) tuple = self.sample_aligner.process_dict_thematic() - self.assertEqual(geometry, tuple[0]['key']) - + self.assertEqual(geometry, tuple[0]["key"]) def test__prepare_thematic_data(self): aligner = Aligner() geojson = { -"type": "FeatureCollection", -"name": "theme", -"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::31370" } }, -"features": [ -{ "type": "Feature", "properties": { "fid": 4, "id": 4, "theme_identifier": "4" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 174647.924166895216331, 170964.980246312363306 ], [ 174693.204879119351972, 170943.531487890402786 ], [ 174696.382472959638108, 170930.82111252922914 ], [ 174678.905706838035258, 170901.428369506524177 ], [ 174660.634542256389977, 170861.708446502889274 ], [ 174641.56897921464406, 170820.399726579111302 ], [ 174593.905071610264713, 170839.46528962085722 ], [ 174614.559431572153699, 170881.568408004706725 ], [ 174628.064205393398879, 170926.054721768799936 ], [ 174647.924166895216331, 170964.980246312363306 ] ] ] ] } } -] -} + "type": "FeatureCollection", + "name": "theme", + "crs": { + "type": "name", + "properties": {"name": "urn:ogc:def:crs:EPSG::31370"}, + }, + "features": [ + { + "type": "Feature", + "properties": {"fid": 4, "id": 4, "theme_identifier": "4"}, + "geometry": { + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [174647.924166895216331, 170964.980246312363306], + [174693.204879119351972, 170943.531487890402786], + [174696.382472959638108, 170930.82111252922914], + [174678.905706838035258, 170901.428369506524177], + [174660.634542256389977, 170861.708446502889274], + [174641.56897921464406, 170820.399726579111302], + [174593.905071610264713, 170839.46528962085722], + [174614.559431572153699, 170881.568408004706725], + [174628.064205393398879, 170926.054721768799936], + [174647.924166895216331, 170964.980246312363306], + ] + ] + ], + }, + } + ], + } aligner.thematic_input = geojson aligner._prepare_thematic_data() - self.assertGreater(len(aligner.dict_thematic),0) + self.assertGreater(len(aligner.dict_thematic), 0) diff --git a/tests/test_examples.py b/tests/test_examples.py index 9f2093e..f0d4d59 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -1,4 +1,3 @@ - import unittest import numpy as np @@ -6,15 +5,20 @@ from brdr.aligner import Aligner from brdr.enums import OpenbaarDomeinStrategy -from brdr.utils import get_oe_dict_by_ids, multipolygons_to_singles, diffs_from_dict_series, \ - filter_resulting_series_by_key, get_breakpoints_zerostreak, get_oe_geojson_by_bbox +from brdr.utils import ( + get_oe_dict_by_ids, + multipolygons_to_singles, + diffs_from_dict_series, + filter_resulting_series_by_key, + get_breakpoints_zerostreak, + get_oe_geojson_by_bbox, +) class TestExamples(unittest.TestCase): - def test_example_131635(self): - #EXAMPLE + # EXAMPLE aligner = Aligner() dict_theme = get_oe_dict_by_ids([131635]) aligner.load_thematic_data_dict(dict_theme) @@ -98,15 +102,16 @@ def test_example_wanted_changes(self): ##Load thematic data & reference data dict_theme = get_oe_dict_by_ids([131635]) aligner.load_thematic_data_dict(dict_theme) - aligner.load_reference_data_grb_actual(grb_type='adp', - partition=1000) # gebruik de actuele adp-percelen adp= administratieve percelen + aligner.load_reference_data_grb_actual( + grb_type="adp", partition=1000 + ) # gebruik de actuele adp-percelen adp= administratieve percelen # Example how to use the Aligner rel_dist = 2 dict_results_by_distance = {} dict_results_by_distance[rel_dist] = aligner.process_dict_thematic(rel_dist, 4) # Example how to use a series (for histogram) - series = np.arange(0, 300, 10, dtype=int)/100 + series = np.arange(0, 300, 10, dtype=int) / 100 dict_series = aligner.process_series(series, 4, 50) resulting_areas = diffs_from_dict_series(dict_series, aligner.dict_thematic) for key in resulting_areas: @@ -117,21 +122,30 @@ def test_example_wanted_changes(self): for extremum in extremes: print(f"{extremum[0]:.2f}, {extremum[1]:.2f} ({extremum[2]})") for st in zero_streak: - print(f"{st[0]:.2f} - {st[1]:.2f} -{st[2]:.2f} - {st[3]:.2f} - startextreme {st[4]:.2f} ") + print( + f"{st[0]:.2f} - {st[1]:.2f} -{st[2]:.2f} - {st[3]:.2f} - startextreme {st[4]:.2f} " + ) dict_results_by_distance = {} - dict_results_by_distance[st[0]] = aligner.process_dict_thematic(st[0], 4) - dict_results_by_distance = filter_resulting_series_by_key(dict_results_by_distance, key) + dict_results_by_distance[st[0]] = aligner.process_dict_thematic( + st[0], 4 + ) + dict_results_by_distance = filter_resulting_series_by_key( + dict_results_by_distance, key + ) def test_example_predictor(self): aligner = Aligner() ##Load thematic data & reference data dict_theme = get_oe_dict_by_ids([131635]) aligner.load_thematic_data_dict(dict_theme) - aligner.load_reference_data_grb_actual(grb_type='adp', - partition=1000) # gebruik de actuele adp-percelen adp= administratieve percelen + aligner.load_reference_data_grb_actual( + grb_type="adp", partition=1000 + ) # gebruik de actuele adp-percelen adp= administratieve percelen - series = np.arange(0, 300, 10, dtype=int)/100 + series = np.arange(0, 300, 10, dtype=int) / 100 # predict which relevant distances are interesting to propose as resulting geometry - dict_predicted, diffs = aligner.predictor(relevant_distances=series, od_strategy=4, treshold_overlap_percentage=50) + dict_predicted, diffs = aligner.predictor( + relevant_distances=series, od_strategy=4, treshold_overlap_percentage=50 + ) for key in dict_predicted.keys(): - continue \ No newline at end of file + continue diff --git a/tests/test_geometry_utils.py b/tests/test_geometry_utils.py index 30642e0..49d2913 100644 --- a/tests/test_geometry_utils.py +++ b/tests/test_geometry_utils.py @@ -36,11 +36,13 @@ def test_buffer_pos(self): """Tests buffer_pos with a point geometry.""" polygon = Polygon(((-1, -1), (-1, 1), (1, 1), (1, -1))) result = buffer_pos(polygon, 1.0) - self.assertEqual(result, Polygon(((-2, -2), (-2, 2), (2, 2), (2, -2), (-2, -2)))) + self.assertEqual( + result, Polygon(((-2, -2), (-2, 2), (2, 2), (2, -2), (-2, -2))) + ) class TestSafeOperations(unittest.TestCase): - #TODO: add cases where GEOS-exception occurs + # TODO: add cases where GEOS-exception occurs def test_safe_union(self): """Tests safe_union with two points.""" polygon_a = Polygon(((0, 0), (1, 0), (1, 1), (0, 1), (0, 0))) @@ -52,9 +54,13 @@ def test_safe_union(self): def test_safe_union_geos_exception(self): """Tests safe_union with a geos exception.""" - polygon_a = from_wkt('MULTIPOLYGON(((172767.25694 174472.63279888, 172766.30994001 174470.77679888, 172765.64794001 174469.48679888, 172766.51694001 174469.12679888, 172765.12794 174466.03679889, 172764.34694001 174466.34679888, 172762.84694001 174463.15679888, 172764.28394001 174462.46479889, 172765.32594 174461.96179888, 172761.13894 174453.29579888, 172760.09694001 174451.01679889, 172759.79494001 174450.12279889, 172760.93594001 174449.76179888, 172761.82594 174450.27579889, 172762.67394001 174449.91179889, 172765.15694 174448.84679888, 172764.19994001 174445.99879888, 172764.60994 174445.80279889, 172764.33894001 174444.31479888, 172763.51694001 174441.74179888, 172763.21994 174440.02779889, 172761.17694 174440.68879888, 172759.74794001 174436.70479888, 172759.02694001 174436.93979888, 172756.96694 174437.61179889, 172755.11894001 174438.21379888, 172754.95694001 174437.62679889, 172754.60694 174436.35679889, 172756.19994001 174435.93579889, 172758.35594 174435.36579889, 172760.84694001 174434.70679888, 172760.58894001 174433.53579888, 172760.14694 174431.53679889, 172759.53294 174429.60779888, 172759.38494 174428.15179888, 172759.12694001 174427.54679888, 172758.76694001 174426.28679889, 172758.12194001 174424.02879888, 172758.32294 174423.95879888, 172758.05194 174421.82179889, 172756.64394001 174422.12379888, 172755.98194 174422.32379889, 172755.12694001 174419.48579888, 172753.83594001 174419.79579889, 172752.49394001 174414.58679888, 172751.20794001 174414.83379888, 172750.65294001 174412.80779888, 172748.95294001 174413.24779889, 172748.47294 174411.39879889, 172753.23294001 174410.11879888, 172752.77094 174408.42079889, 172752.20594 174406.34079888, 172751.57694 174404.02979888, 172750.94994001 174401.72379889, 172750.44494 174399.86779889, 172749.65394 174396.95879888, 172749.08794 174394.87879889, 172750.24394001 174394.48479888, 172751.79494001 174393.68579889, 172753.32194001 174392.89979888, 172754.02694001 174394.06179888, 172759.86194001 174390.84279888, 172760.84694001 174392.75779888, 172762.75294 174391.80779888, 172764.67794001 174390.84979888, 172767.03494001 174389.67579888, 172769.10394001 174388.64579888, 172770.82694 174387.78779888, 172772.41294001 174387.00179889, 172771.70694001 174385.58179888, 172770.47494001 174383.10379888, 172769.86494001 174381.87779888, 172769.31094001 174380.77179889, 172768.51694001 174379.18579889, 172767.43494001 174377.02279888, 172766.27794001 174374.71279889, 172765.78994 174373.61879888, 172765.24294 174372.39279888, 172764.56294 174370.86879888, 172763.48394 174368.72379889, 172762.58994001 174366.94779889, 172761.36994 174364.52279888, 172760.27094 174362.33879888, 172759.15994001 174360.12979888, 172757.85194 174357.53079889, 172752.91594 174345.84979888, 172752.44494 174344.50079888, 172751.68294 174342.55779888, 172750.88594 174340.52579889, 172749.87694001 174337.94779888, 172748.82694 174335.20279888, 172747.72094 174332.38879888, 172746.51294001 174329.31579889, 172745.36494001 174326.39779888, 172743.82194001 174322.47179888, 172742.68394 174319.57579888, 172739.86294 174320.46079888, 172737.67194 174320.96779888, 172736.12194001 174321.39879889, 172733.90294001 174322.01479889, 172731.21594 174322.76179888, 172729.70094 174323.15779889, 172729.10494001 174323.34879888, 172727.50294 174323.86079888, 172724.60494001 174324.78679888, 172719.82894001 174326.31279889, 172720.17794001 174327.77779889, 172720.41094 174328.75779888, 172720.82494001 174330.49979889, 172721.08494 174331.56079889, 172721.42594 174332.98579888, 172721.70594 174334.18179888, 172722.03394001 174335.51479889, 172722.60994 174337.84979888, 172723.15794 174340.07079888, 172719.07994 174341.35879889, 172719.00094001 174340.49779889, 172718.62994001 174340.60179888, 172717.50294 174340.91679888, 172714.97094 174341.62679888, 172714.17294 174341.84979888, 172712.47094 174342.32679888, 172710.41394001 174342.90279889, 172708.33894001 174343.48379889, 172705.43894001 174344.29679888, 172702.72094 174345.05779888, 172703.36294 174347.25779888, 172703.90994001 174349.13479888, 172702.14294 174349.59779889, 172700.29694 174350.08079888, 172697.39194001 174350.83979889, 172695.26994001 174351.39479888, 172694.94394 174349.74379888, 172692.57994 174350.34579889, 172689.68394 174351.08279889, 172686.95894 174351.77579889, 172684.89594 174352.30079888, 172683.30094 174352.70679888, 172681.18294 174353.24579888, 172679.33194001 174353.71579888, 172677.40094 174354.20779889, 172676.77394001 174351.89279888, 172676.06194 174349.26679889, 172675.74094001 174348.08279889, 172675.25994 174346.30779888, 172674.46694 174343.38379889, 172673.58194001 174340.11779889, 172672.77094 174337.12779888, 172670.94994001 174337.60879888, 172669.08994001 174338.09979888, 172668.25594001 174338.31979889, 172663.54094 174339.43779888, 172663.95094 174340.99179888, 172664.37094 174342.58279889, 172664.94494 174344.75679888, 172665.47294 174346.75879889, 172666.08594001 174349.08279889, 172666.77094 174351.67579889, 172667.44094 174354.21779888, 172665.21794001 174354.76179888, 172663.37894 174355.21179888, 172661.58094 174355.65179889, 172659.15894001 174356.24379888, 172656.24094001 174356.95779889, 172655.82894001 174354.98779888, 172655.30694001 174352.49479889, 172654.75394 174349.85379888, 172653.44094 174347.26779888, 172650.79094 174346.37779888, 172649.39294 174346.74579888, 172648.16994001 174347.06779889, 172643.14494001 174348.38979889, 172640.56794001 174349.06779889, 172638.06294 174349.72679888, 172635.80894 174350.31979889, 172634.01694001 174350.79179888, 172631.56094001 174351.43779889, 172631.68094001 174351.69779888, 172630.46894001 174352.05179889, 172629.28094001 174352.39979888, 172627.68094001 174352.86779889, 172628.10094001 174354.11979889, 172628.68794 174355.86679889, 172629.43094001 174358.08279889, 172630.24694001 174360.51479889, 172630.85694 174362.33379888, 172631.76094 174365.02779889, 172632.43094001 174364.86779889, 172632.93494001 174366.67479889, 172630.87694001 174367.28679889, 172629.35094001 174367.69579888, 172627.54894001 174368.17979889, 172625.44094 174368.74479889, 172623.82194001 174369.17879888, 172621.82194001 174369.71579888, 172620.13194 174370.16879888, 172618.52894 174370.59879889, 172616.85694 174371.04679888, 172613.67694 174372.43679888, 172612.27094 174372.87179888, 172610.70894 174373.35479889, 172608.85694 174373.92679889, 172608.25794001 174371.89079888, 172607.82694 174370.42679889, 172607.50694 174370.51679889, 172607.38694001 174370.06679888, 172607.01194001 174368.70179889, 172605.61394 174369.12679889, 172604.29194001 174364.49979888, 172605.79494001 174364.27579889, 172604.95794001 174361.23079889, 172604.15694 174358.31679888, 172601.38294001 174359.08279889, 172599.73694001 174359.53679889, 172599.03094001 174356.96479888, 172598.45694001 174354.87679889, 172598.31094001 174353.65579888, 172597.92494001 174352.22579889, 172597.51694001 174350.71679889, 172593.94294001 174351.68579889, 172594.45994 174353.59579889, 172594.89194001 174355.18879888, 172594.43694 174355.28679889, 172595.10394001 174357.58879888, 172595.61694 174359.35679889, 172596.36994 174361.95579889, 172596.92694 174363.87679888, 172594.25694 174364.45679888, 172594.21694 174364.31679888, 172593.00494001 174364.65379888, 172592.00394 174364.93279888, 172590.26894 174365.41579889, 172588.36994 174365.94479889, 172586.29894001 174366.52079888, 172585.71094001 174364.28879889, 172585.01994001 174361.66879889, 172584.37794 174359.23179889, 172583.45694001 174355.73579888, 172582.56194 174352.34079888, 172581.81194 174349.49579888, 172578.83494 174350.40579889, 172579.40794 174352.63579888, 172579.78994 174354.11679888, 172580.28794001 174356.05279889, 172580.77094 174357.92779888, 172581.47694 174360.66679888, 172581.97094 174362.58679888, 172582.24294 174363.61779889, 172582.54194001 174364.74379888, 172582.91294001 174366.13879888, 172583.24094001 174367.37179888, 172583.56894 174368.60379888, 172583.98394 174370.16379889, 172584.46094001 174371.95479888, 172584.86494001 174373.47379888, 172585.18994 174374.69679889, 172581.69994001 174375.73579888, 172581.45894 174374.65479888, 172581.93994 174374.65479888, 172582.48094 174373.39279888, 172580.61794 174366.54279888, 172576.54694 174367.44579888, 172576.96094001 174368.82979888, 172577.49594 174370.61579889, 172578.20294001 174372.70579888, 172578.57394 174374.21879889, 172578.69794 174374.72879888, 172578.94194001 174375.71979888, 172579.21594 174376.83779888, 172579.48694001 174377.94179888, 172579.78194 174379.14479889, 172580.08194001 174380.37079888, 172580.58694 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888, 172576.23194 174376.15679888, 172575.20994 174372.55179889, 172573.66494 174372.83079889, 172574.33394 174375.25079888, 172574.79994001 174376.93479888, 172574.46694 174377.10679889, 172573.55494 174377.38579888, 172571.95794001 174377.87279889, 172569.12694001 174378.73679888, 172570.29694 174382.59679888, 172569.06894 174382.95779889, 172567.62494 174383.37779888, 172566.17594 174383.79879889, 172564.97094 174384.14879888, 172563.53494001 174384.56479888, 172562.23594001 174384.94279889, 172561.03494001 174385.29079889, 172559.35194 174385.66979888, 172558.39794001 174385.88479888, 172556.63694001 174386.28179888, 172554.56194 174386.74879888, 172554.93394 174388.02679888, 172555.33194001 174389.39779888, 172555.78394001 174390.95079888, 172556.25094001 174392.55979888, 172556.78094001 174394.38279888, 172557.38394001 174396.45779889, 172555.12994001 174410.66979888, 172554.04194001 174412.21079889, 172554.18094001 174413.74279889, 172554.35894 174415.69279889, 172554.59094 174418.23979888, 172554.80294001 174420.57479888, 172555.02794001 174423.04279888, 172555.93294 174422.97279889, 172557.54494001 174422.84879889, 172560.00094001 174422.89679889, 172562.04294 174422.83779889, 172563.99094001 174422.77979888, 172565.29094 174422.74079889, 172567.21594 174422.68179889, 172569.10194 174422.62379888, 172568.98294001 174421.27879888, 172568.88094001 174420.13579889, 172568.73194 174418.45579889, 172568.45294001 174415.31879888, 172570.64394 174415.21279889, 172570.64394001 174420.55979889, 172572.08594001 174420.43979888, 172572.08594001 174421.46179888, 172572.89894001 174421.52179889, 172572.93594001 174418.69679889, 172572.92794001 174415.53279888, 172575.20994 174415.51279889, 172575.27294001 174421.23079888, 172577.66994001 174421.37079888, 172577.71794001 174420.68179889, 172577.72494001 174418.93679889, 172577.73594001 174415.93279888, 172580.01694001 174415.87379888, 172579.83694 174420.49979889, 172581.27894 174420.49979889, 172581.16094 174421.60179888, 172582.17694 174421.66979888, 172582.13594 174422.43279888, 172582.06294 174423.81779889, 172581.85494001 174425.10579888, 172581.54394 174425.96979888, 172582.27094 174425.90879888, 172583.34994001 174425.81679888, 172584.44594001 174425.72479888, 172585.57394 174425.43879889, 172587.27294001 174425.00679888, 172589.82794001 174424.35879889, 172589.40294001 174423.53179888, 172589.03494001 174422.06079888, 172588.59694001 174420.30879889, 172588.35594 174419.34679888, 172587.97694 174417.82879889, 172587.78294 174417.05679889, 172587.61594001 174415.77979888, 172587.36494001 174414.35979888, 172587.75394 174413.42079888, 172587.86994 174411.44879889, 172592.26794 174410.32279888, 172592.57794001 174412.11779889, 172593.54694 174411.85679889, 172593.88294001 174413.17479889, 172596.71694 174412.45279888, 172597.50594001 174415.42779888, 172593.94094 174416.36279888, 172594.31794001 174417.67579888, 172595.57994 174417.37579888, 172595.88594 174418.96979888, 172599.56994 174418.29279888, 172600.39494001 174421.68079888, 172599.12494 174422.00279888, 172597.83994001 174422.32779888, 172595.25594001 174422.98279888, 172595.67794001 174424.90679888, 172598.81094001 174424.21879889, 172599.32294 174426.26379888, 172599.83994001 174428.32779888, 172600.28294 174430.09379889, 172599.53294 174430.30379888, 172598.94794 174431.12079888, 172598.50794001 174431.73679888, 172598.17194 174432.53079888, 172597.70394001 174433.63779889, 172598.26694001 174435.35479889, 172601.68394 174434.46579888, 172602.63794001 174437.85679889, 172603.52094 174441.33179888, 172604.18794 174443.95879889, 172607.05394 174443.20479888, 172608.01694001 174447.05779888, 172602.61494001 174448.18279888, 172603.57694 174451.96779888, 172591.37294001 174454.98979888, 172593.09694001 174460.86279888, 172596.00694 174460.12279889, 172599.45294001 174459.24579888, 172605.06394001 174457.81879888, 172608.39694 174456.97079889, 172613.56094001 174455.65679888, 172614.32594 174458.77479888, 172609.11894001 174459.86879888, 172606.47194001 174460.59979888, 172604.45794001 174461.15679888, 172605.34094 174464.77179889, 172607.57394 174464.20979889, 172609.99094001 174463.60579889, 172613.07994 174462.83479889, 172613.61894001 174464.88379889, 172614.04994001 174466.51979889, 172614.37794 174467.76679889, 172612.53894001 174468.36579889, 172611.16394001 174468.81479888, 172608.52994 174469.67379888, 172609.11194001 174471.76679889, 172609.56494 174473.39879889, 172612.91294001 174485.56179888, 172614.59894 174485.11079888, 172617.38894 174484.36379889, 172622.33194001 174483.04179888, 172625.99594 174482.06079889, 172629.84294001 174481.03179888, 172641.95194 174477.65279889, 172643.75494001 174477.16979888, 172645.38894 174476.73279888, 172647.53094001 174476.15979889, 172649.87894 174475.53179888, 172652.14894001 174474.92479889, 172655.08794 174474.13879889, 172656.82294 174473.67479889, 172659.20494 174473.03779889, 172661.12994001 174472.52279888, 172663.13094001 174471.98779888, 172666.07294 174471.20079888, 172669.09894 174470.39179889, 172670.32794001 174470.07579888, 172672.24694001 174469.58179889, 172673.91894 174469.15179888, 172674.58694 174468.84879889, 172675.52994 174468.59879889, 172677.88094001 174467.97779889, 172680.51794 174467.28079889, 172683.39194001 174466.52079888, 172686.88994 174465.59579889, 172690.08694 174464.75079888, 172693.60394001 174463.82179889, 172694.71594 174465.90079889, 172695.81494 174467.95779889, 172696.76694001 174469.73679889, 172698.74294 174473.43379889, 172700.00894001 174475.80279888, 172701.21194 174478.05279888, 172702.29394 174480.07679889, 172712.67294 174477.65879888, 172714.31294 174477.23479888, 172715.92294 174476.81879889, 172718.15094 174476.24279889, 172719.85594 174475.80279888, 172719.07394 174472.68079888, 172722.78994 174471.85879889, 172723.62094 174471.64979888, 172726.34994001 174470.96079888, 172727.68494001 174470.62379888, 172728.34494 174470.45779889, 172728.94594001 174470.31079889, 172729.36494001 174470.20779889, 172733.29694 174468.74879888, 172732.51594001 174463.94179888, 172736.18094001 174462.86079888, 172736.12094 174460.75779888, 172739.38594 174460.04779889, 172751.74194 174457.62979889, 172752.52594 174459.31079889, 172753.47194001 174461.34079888, 172754.32394 174463.17079889, 172755.22994001 174465.11479888, 172756.45494 174467.74379888, 172757.91194 174470.86979889, 172759.17194 174473.57379889, 172760.30194 174475.99779889, 172767.25694 174472.63279888)))') - polygon_b = from_wkt('MULTIPOLYGON(((172557.3838523062 174396.45835165278, 172555.12905084348 174410.6693711578, 172554.04105084387 174412.2103631608, 172554.28937084228 174414.93676316369, 172555.0277388468 174423.0425551683, 172563.7369228527 174422.37100316587, 172569.0432908535 174421.9618511684, 172568.4963957805 174415.81728130922, 172568.4972705121 174415.81723898993, 172568.45294000994 174415.31879887995, 172570.64394 174415.21279888996, 172570.64394001 174420.55979889, 172572.08594000997 174420.43979888, 172572.08594000997 174420.94152719184, 172572.77495595193 174420.8841888285, 172572.71193637606 174416.03471118974, 172572.929204253 174416.03280700246, 172572.92794000998 174415.53279887998, 172575.20994000003 174415.51279889, 172575.27294001004 174421.23079888, 172577.6697196799 174421.37078601134, 172577.70199362023 174416.43384416474, 172577.73410833202 174416.4330134905, 172577.7358131635 174415.9674395041, 172577.73594001 174415.93279888004, 172578.87644000998 174415.90329888, 172580.01694000998 174415.87379888, 172579.83694 174420.49979889003, 172581.27894 174420.49979889003, 172581.22540097954 174420.99979889003, 172582.22334147422 174420.99979889003, 172582.17621886 174421.66917916582, 172582.0176908598 174424.652603168, 172581.5430028588 174425.96959516776, 172581.36988285926 174426.44985117015, 172583.22229886055 174426.393211171, 172584.53372231862 174426.04524331444, 172585.60137086362 174425.76191516966, 172589.6888588667 174424.67730716988, 172588.59657086435 174420.30905116722, 172587.97628287587 174417.82828320874, 172587.62773886323 174416.44255516306, 172587.57641086724 174416.43890716136, 172587.6150668636 174415.78034716102, 172587.75349886715 174413.420987159, 172587.86921086907 174411.4484431595, 172591.77150026744 174410.4497097941, 172592.26794067942 174410.3228028141, 172592.57794001006 174412.11779889002, 172593.54694000003 174411.85679889002, 172593.88294001002 174413.17479889, 172596.71693999998 174412.45279888005, 172597.50594000999 174415.42779887991, 172597.172895412 174415.51514718245, 172597.022295644 174415.5546452982, 172597.0224054087 174415.55505917643, 172593.93199883454 174416.33165895962, 172593.94094 174416.36279887997, 172594.31794001002 174417.67579888002, 172595.57994 174417.37579888004, 172595.88594000004 174418.96979887996, 172599.56993999996 174418.29279888, 172600.39494000998 174421.68079888003, 172599.91025387176 174421.80368780546, 172599.94715650496 174421.95523461731, 172596.69628287107 174422.8178511672, 172595.3009759594 174423.18812865848, 172595.67794001 174424.90679888, 172598.81094000905 174424.2187988902, 172598.92996166085 174424.6941881079, 172599.32293973575 174426.26379782447, 172599.32319430308 174426.26481412462, 172599.83993917855 174428.32779556068, 172600.28294000003 174430.09379889, 172599.53294 174430.30379888, 172598.9479399949 174431.12079888713, 172598.50794000993 174431.73679888, 172598.17194137024 174432.53079564194, 172597.70394001 174433.63779889003, 172598.2660748735 174435.35474717614, 172601.1998381591 174434.5913030442, 172601.19995467947 174434.5917172166, 172601.68394000002 174434.46579888, 172602.63794000942 174437.85679888783, 172603.5209395613 174441.3317971537, 172603.67147661696 174441.92469197488, 172604.18799165756 174443.95900234475, 172607.0539523896 174443.2048484512, 172608.01694001004 174447.05779888, 172602.61494001004 174448.18279888007, 172603.57694000003 174451.96779887998, 172591.37294001 174454.98979887998, 172593.09693550566 174460.86278353556, 172605.0632588789 174457.8183631897, 172608.39689087868 174456.97023519131, 172613.0762718963 174455.77972994547, 172613.07636302974 174455.78010138884, 172613.56094001004 174455.65679887997, 172614.32594000004 174458.77479888004, 172609.11894000994 174459.86879888005, 172606.47194360537 174460.59979788712, 172604.45794001 174461.15679888, 172605.3409823247 174464.7719721671, 172612.59480380098 174462.95596724018, 172612.7014123517 174462.92927763195, 172613.07994000003 174462.83479889008, 172613.61893907966 174464.88379535347, 172613.6189968665 174464.88401470726, 172614.04993903125 174466.51979517483, 172614.37794 174467.76679889, 172612.53894704106 174468.36579659986, 172612.53852629993 174468.36593398513, 172611.16394366286 174468.81479768714, 172608.52993999998 174469.67379888, 172609.11193880375 174471.76679455204, 172609.11197085044 174471.76690999718, 172609.56229931235 174473.38928541902, 172609.5649399964 174473.3987988771, 172612.91284623384 174485.5614581992, 172616.49161088464 174484.6038992107, 172617.37810321042 174484.36670035287, 172617.3781038362 174484.3667001854, 172617.40430078932 174484.35969066346, 172621.91801405355 174483.1519558644, 172625.84397284017 174482.10148660126, 172626.28639576584 174481.983107446, 172629.84245889643 174481.0316112079, 172629.84260632202 174481.0318919951, 172641.95148947238 174477.65292460908, 172641.9513229055 174477.65228320664, 172643.55453783524 174477.22348398916, 172649.45557890835 174475.6451792046, 172652.118800357 174474.93285825956, 172655.08757891503 174474.13881120458, 172669.09820291854 174470.39141919912, 172673.91823492196 174469.15141920003, 172674.05039449205 174469.04677954124, 172674.1582349241 174468.9614031985, 172675.5150722086 174468.60274051016, 172675.58914901028 174468.58315924928, 172676.93838271403 174468.22650647085, 172685.4841995281 174465.9675284286, 172690.08649093658 174464.75097119805, 172690.35773174433 174464.679270439, 172693.6036109403 174463.82124319673, 172695.45967493954 174467.2931151986, 172695.69615282057 174467.73546474247, 172695.8858936043 174468.09038905406, 172702.29378802062 174480.0768342967, 172712.67227422315 174477.65895398633, 172712.67215495606 174477.6584912053, 172719.8562189564 174475.80549920353, 172719.13622944942 174473.1791069913, 172719.19547385076 174473.1660017983, 172719.07393999997 174472.68079888003, 172722.78994000095 174471.8587988898, 172723.6209313099 174471.64980106562, 172723.62116079254 174471.6497431358, 172726.34993987996 174470.9607989128, 172727.68514120538 174470.623748284, 172728.34493999486 174470.45779889126, 172728.94593998056 174470.3107988972, 172729.36494001048 174470.20779888984, 172733.29694 174468.74879888006, 172732.51594000997 174463.94179888, 172736.18094000997 174462.86079888, 172736.12094 174460.75779888, 172739.38593999937 174460.04779889015, 172751.74194 174457.62979889003, 172751.82374942137 174457.8052091417, 172760.30108298364 174475.9976912029, 172767.25628262636 174472.6322513803, 172767.5851149932 174472.47314720228, 172767.50690699372 174472.13401120156, 172767.1188087445 174472.3620791199, 172766.30993999983 174470.7767988602, 172765.64794001004 174469.48679887998, 172766.51694001004 174469.12679887997, 172765.12794 174466.03679888998, 172764.34694001 174466.34679888003, 172762.84694005293 174463.15679897126, 172763.29320167168 174462.94189765144, 172764.2839314731 174462.46480300103, 172765.32593999998 174461.96179887993, 172761.1385378274 174453.29491927216, 172761.13853782744 174453.29491927216, 172760.09694000988 174451.01679888976, 172759.79494001003 174450.12279889, 172760.93594000998 174449.76179888003, 172761.82593999995 174450.27579889004, 172762.67400122888 174449.91177263303, 172765.15694 174448.84679888003, 172764.19994000997 174445.99879888, 172764.60994001062 174445.80279888492, 172764.33894001 174444.31479887993, 172763.51689098784 174441.74149918192, 172763.5168882326 174441.74150007046, 172763.51688823258 174441.74150007026, 172763.21993999998 174440.02779889002, 172761.17694 174440.68879888, 172759.74790522835 174436.7047019099, 172755.11890209024 174438.21366147915, 172754.95691696025 174437.6267152474, 172754.85751089564 174437.26601325686, 172754.6069400003 174436.3567988909, 172755.10336595034 174436.22560282986, 172756.19993908802 174435.93579913364, 172758.35593845724 174435.36579929787, 172760.84694000997 174434.70679888004, 172760.58894161868 174433.5358061814, 172760.14693999995 174431.53679888978, 172759.5329400001 174429.6077988801, 172759.52534339868 174429.53306474834, 172759.48582006822 174429.1442406328, 172759.76815493542 174429.05234718855, 172759.7528128644 174429.0162936086, 172759.12745483534 174427.54860076858, 172759.12745462733 174427.54860004058, 172759.1267469823 174427.54693917185, 172759.12695293076 174427.54684410253, 172758.76693612643 174426.28678529424, 172758.12194001 174424.02879888, 172758.32293999995 174423.95879888002, 172758.05193999998 174421.82179889004, 172756.6439400104 174422.12379887994, 172756.53950232168 174422.15535105282, 172755.98194000003 174422.32379888996, 172755.12451175836 174419.47773878835, 172753.83321806323 174419.78523359896, 172752.4939518636 174414.58684488994, 172751.20706697553 174414.83333916217, 172750.73129098117 174412.7877071612, 172748.95247497407 174413.2481231615, 172748.47247497732 174411.39813916016, 172753.23247498277 174410.11813915893, 172751.57647497955 174404.02937115356, 172750.80501897636 174401.19289115068, 172749.21920579113 174395.36230315745, 172749.2194832201 174395.36220860117, 172749.08793999997 174394.87879889001, 172750.24394001003 174394.48479888003, 172751.79493705663 174393.68580041145, 172753.32194001004 174392.89979888, 172754.02694001 174394.06179887996, 172759.86194000999 174390.84279887998, 172760.84694001003 174392.75779887996, 172762.75293454644 174391.80780159816, 172762.7540957816 174391.80722369105, 172764.6779369368 174390.84980040943, 172767.0349380484 174389.675799857, 172769.10393896094 174388.64579940226, 172770.8269400001 174387.78779888, 172772.41231297184 174387.0021096416, 172769.92245898946 174381.99321113512, 172769.86473163788 174381.87794843127, 172766.27740298968 174374.71225113448, 172766.12751504182 174374.37625125528, 172765.45154720507 174372.86111561494, 172764.5623949914 174370.86834713045, 172758.44661898166 174358.71346712485, 172758.08089647835 174357.9866221479, 172758.0812897689 174357.9865175769, 172757.8519399999 174357.5307988898, 172754.4110373197 174349.3873883099, 172754.41083817216 174349.3874620819, 172754.04609390008 174348.52429801252, 172753.7164504677 174347.74419976756, 172753.71289365587 174347.7351269625, 172752.91599497944 174345.84914711493, 172752.96828298277 174345.83532311398, 172752.74697099614 174345.2712271516, 172750.88521097507 174340.5253711095, 172749.90261897308 174337.94073110458, 172742.68309897187 174319.57548309487, 172729.2444429621 174323.76869909838, 172729.1040909663 174323.3482191004, 172719.76546695834 174325.91705109927, 172721.48245895657 174332.9833551049, 172723.08294328308 174339.57013976108, 172723.03791828503 174339.58436050604, 172723.15793999998 174340.07079887998, 172719.07994 174341.35879888994, 172719.0331842302 174340.8492201192, 172718.5874979483 174340.98998616525, 172718.5534989536 174340.6227151118, 172714.9709069505 174341.62623511252, 172702.72073094547 174345.05746711424, 172703.20898694542 174346.73209111392, 172703.9096589461 174349.13503511623, 172695.26953093708 174351.39500311756, 172694.93771905327 174349.74538306356, 172692.57990415473 174350.34580801197, 172692.57334559556 174350.34747709305, 172689.68390132912 174351.0828087242, 172689.6768192437 174351.08460978328, 172686.95894150986 174351.77579850602, 172684.89594078047 174352.3007986814, 172684.8828689878 174352.30412604674, 172683.3009262921 174352.70680236846, 172681.18281584515 174353.24583040207, 172679.3319479569 174353.71579686215, 172677.40094000465 174354.20779888882, 172677.27266865686 174353.73419735025, 172676.77394073328 174351.89280155062, 172676.06193873903 174349.26679423897, 172675.7409324217 174348.08277088706, 172675.25994054292 174346.30780088357, 172675.2596599193 174346.30676614863, 172674.46692653303 174343.38374918967, 172673.58194064876 174340.11780124725, 172672.77094000002 174337.12779888004, 172670.9499049531 174337.60880813404, 172670.52563620973 174337.72080595847, 172669.09919766168 174338.09735505903, 172669.08994002102 174338.09979887708, 172668.25594001057 174338.3197988899, 172663.54094 174339.43779888, 172663.9509396747 174340.9917976469, 172663.95246609734 174340.9975798821, 172664.37093995474 174342.5827987186, 172664.9449393093 174344.75679626403, 172665.47293987044 174346.75879839866, 172665.473080069 174346.7593299183, 172666.08593904617 174349.08279523588, 172666.0860074876 174349.08305431984, 172666.77093856825 174351.67579347026, 172667.44093999997 174354.21779888, 172665.21794001 174354.76179888, 172665.0101183685 174354.8126524625, 172663.37894000002 174355.21179888002, 172663.37873282918 174355.21184957805, 172661.5809427116 174355.65179822646, 172659.15894248072 174356.2437982761, 172656.24094000997 174356.95779889004, 172655.8289405051 174354.98780124754, 172655.30694000996 174352.49479888997, 172654.75393999997 174349.85379887992, 172653.44093999994 174347.26779887994, 172650.79094000012 174346.37779887998, 172649.39294039877 174346.74579877505, 172649.3911846923 174346.7462610297, 172648.1699417751 174347.06779842527, 172643.14494001 174348.38979889, 172642.93389291374 174348.44532466854, 172640.56794000996 174349.06779889, 172640.41789637046 174349.10727144754, 172638.06294 174349.72679888003, 172635.8089427633 174350.319798163, 172634.01694338908 174350.79179799, 172631.56094000998 174351.43779888997, 172631.68094001 174351.69779888, 172630.46894738195 174352.0517967368, 172630.4687520214 174352.05185395735, 172629.2809437475 174352.39979778518, 172627.68094000997 174352.86779889, 172628.10093847304 174354.1197943085, 172628.10107294662 174354.1201945294, 172628.6879379874 174355.86679290008, 172628.68799114702 174355.86695143604, 172629.43093933648 174358.08279688127, 172629.43133035954 174358.0839622848, 172630.24693959064 174360.5147976402, 172630.24792235918 174360.51772822303, 172630.85693939638 174362.3337970801, 172631.76094 174365.02779888996, 172632.43094001003 174364.86779888996, 172632.93494001002 174366.67479888993, 172630.87694000924 174367.2867988902, 172629.35094510994 174367.69579751312, 172629.35049890392 174367.69591735688, 172627.54894514213 174368.17979751158, 172627.52128803954 174368.18721035263, 172625.4409402792 174368.7447988152, 172625.43971959242 174368.74512604062, 172623.82194391786 174369.17879783243, 172621.82194405483 174369.715797794, 172621.82183787943 174369.71582625585, 172620.13194178292 174370.16879840213, 172618.52894290345 174370.59879811114, 172616.85694000009 174371.04679887995, 172613.67694 174372.43679888, 172612.2709414281 174372.87179843814, 172610.70894325845 174373.35479788246, 172608.85694 174373.92679889, 172608.25794049533 174371.89080052968, 172607.82694000003 174370.42679889002, 172607.51030628625 174370.515852122, 172607.38694001004 174370.06679887997, 172607.01194001 174368.70179888996, 172605.61394000004 174369.12679888998, 172604.29194001 174364.49979887996, 172605.79494001003 174364.27579888995, 172604.95794001003 174361.23079889003, 172604.15693999996 174358.31679887997, 172601.3829428521 174359.08279810517, 172600.24729543962 174359.3960325686, 172597.84457264078 174350.6279695617, 172597.51694001004 174350.71679888997, 172593.94294000993 174351.68579889, 172594.4599387648 174353.5957943269, 172594.89194001 174355.18879888, 172594.43694 174355.28679888998, 172595.10393895835 174357.58879525043, 172595.61693890326 174359.35679511022, 172596.36993943545 174361.95579694142, 172596.92693999998 174363.87679887997, 172594.25694 174364.45679887995, 172594.21693999998 174364.31679888006, 172593.00494592657 174364.6537972349, 172593.00452690053 174364.65391402238, 172592.00394302807 174364.932798036, 172590.26894162453 174365.41579843775, 172588.36994388918 174365.94479780665, 172588.36984125132 174365.94482635465, 172586.29894001002 174366.52079888002, 172585.7109407086 174364.2888015419, 172585.71082483808 174364.2883622034, 172585.01994076036 174361.66880173524, 172584.8667329185 174361.0872324162, 172584.37794 174359.23179888996, 172583.4569404406 174355.73580051467, 172582.56193999999 174352.34079887997, 172581.81194 174349.49579887997, 172578.96056568567 174350.36739802494, 172585.1382444169 174374.19050227254, 172585.0614705477 174374.21335843968, 172585.18994 174374.69679888996, 172581.69994000997 174375.73579888, 172581.62350512363 174375.3929519558, 172581.93994000004 174374.65479888, 172582.48094 174373.39279888003, 172580.61794 174366.54279888, 172576.77667659082 174367.3948403584, 172578.3008907684 174373.35775476237, 172578.52405885607 174374.23071513322, 172580.47195049844 174381.85118837637, 172580.4625612569 174381.85333750857, 172580.58694000004 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888003, 172576.23194 174376.15679888002, 172575.20993999997 174372.55179889, 172573.66458694366 174372.8308626458, 172574.0934668556 174374.3819471337, 172574.33365876754 174375.25074680167, 172574.7994377378 174376.93505831185, 172574.46694027368 174377.10679874866, 172573.55473542705 174377.38586125555, 172571.95794220705 174377.87279822002, 172569.12694000997 174378.73679888004, 172570.29693999997 174382.59679888, 172569.06894000657 174382.95779888806, 172568.98899089158 174382.9810527852, 172567.62494267538 174383.37779810186, 172566.1759413303 174383.7987985035, 172564.9709467131 174384.14879693012, 172563.53494001646 174384.5647988781, 172562.23594001002 174384.94279888997, 172561.03905731053 174385.28960586703, 172554.56188284606 174386.74853914225, 172555.21404284242 174388.99244314435, 172557.3838523062 174396.45835165278)),((172739.38594000007 174460.04779889, 172739.39373637483 174460.04610350684, 172739.392673916 174460.04121769255, 172739.3870486459 174460.03837656736, 172739.38261013498 174460.0403655549, 172739.3807950899 174460.03631378766, 172739.37623201194 174460.03835788142, 172739.37262919155 174460.04530889943, 172739.37358944913 174460.05021582366, 172739.3858038434 174460.04782553512, 172739.3859399994 174460.04779889015, 172739.38594000007 174460.04779889)))') - result = safe_union(polygon_a, polygon_b) #GEOS exception is catched + polygon_a = from_wkt( + "MULTIPOLYGON(((172767.25694 174472.63279888, 172766.30994001 174470.77679888, 172765.64794001 174469.48679888, 172766.51694001 174469.12679888, 172765.12794 174466.03679889, 172764.34694001 174466.34679888, 172762.84694001 174463.15679888, 172764.28394001 174462.46479889, 172765.32594 174461.96179888, 172761.13894 174453.29579888, 172760.09694001 174451.01679889, 172759.79494001 174450.12279889, 172760.93594001 174449.76179888, 172761.82594 174450.27579889, 172762.67394001 174449.91179889, 172765.15694 174448.84679888, 172764.19994001 174445.99879888, 172764.60994 174445.80279889, 172764.33894001 174444.31479888, 172763.51694001 174441.74179888, 172763.21994 174440.02779889, 172761.17694 174440.68879888, 172759.74794001 174436.70479888, 172759.02694001 174436.93979888, 172756.96694 174437.61179889, 172755.11894001 174438.21379888, 172754.95694001 174437.62679889, 172754.60694 174436.35679889, 172756.19994001 174435.93579889, 172758.35594 174435.36579889, 172760.84694001 174434.70679888, 172760.58894001 174433.53579888, 172760.14694 174431.53679889, 172759.53294 174429.60779888, 172759.38494 174428.15179888, 172759.12694001 174427.54679888, 172758.76694001 174426.28679889, 172758.12194001 174424.02879888, 172758.32294 174423.95879888, 172758.05194 174421.82179889, 172756.64394001 174422.12379888, 172755.98194 174422.32379889, 172755.12694001 174419.48579888, 172753.83594001 174419.79579889, 172752.49394001 174414.58679888, 172751.20794001 174414.83379888, 172750.65294001 174412.80779888, 172748.95294001 174413.24779889, 172748.47294 174411.39879889, 172753.23294001 174410.11879888, 172752.77094 174408.42079889, 172752.20594 174406.34079888, 172751.57694 174404.02979888, 172750.94994001 174401.72379889, 172750.44494 174399.86779889, 172749.65394 174396.95879888, 172749.08794 174394.87879889, 172750.24394001 174394.48479888, 172751.79494001 174393.68579889, 172753.32194001 174392.89979888, 172754.02694001 174394.06179888, 172759.86194001 174390.84279888, 172760.84694001 174392.75779888, 172762.75294 174391.80779888, 172764.67794001 174390.84979888, 172767.03494001 174389.67579888, 172769.10394001 174388.64579888, 172770.82694 174387.78779888, 172772.41294001 174387.00179889, 172771.70694001 174385.58179888, 172770.47494001 174383.10379888, 172769.86494001 174381.87779888, 172769.31094001 174380.77179889, 172768.51694001 174379.18579889, 172767.43494001 174377.02279888, 172766.27794001 174374.71279889, 172765.78994 174373.61879888, 172765.24294 174372.39279888, 172764.56294 174370.86879888, 172763.48394 174368.72379889, 172762.58994001 174366.94779889, 172761.36994 174364.52279888, 172760.27094 174362.33879888, 172759.15994001 174360.12979888, 172757.85194 174357.53079889, 172752.91594 174345.84979888, 172752.44494 174344.50079888, 172751.68294 174342.55779888, 172750.88594 174340.52579889, 172749.87694001 174337.94779888, 172748.82694 174335.20279888, 172747.72094 174332.38879888, 172746.51294001 174329.31579889, 172745.36494001 174326.39779888, 172743.82194001 174322.47179888, 172742.68394 174319.57579888, 172739.86294 174320.46079888, 172737.67194 174320.96779888, 172736.12194001 174321.39879889, 172733.90294001 174322.01479889, 172731.21594 174322.76179888, 172729.70094 174323.15779889, 172729.10494001 174323.34879888, 172727.50294 174323.86079888, 172724.60494001 174324.78679888, 172719.82894001 174326.31279889, 172720.17794001 174327.77779889, 172720.41094 174328.75779888, 172720.82494001 174330.49979889, 172721.08494 174331.56079889, 172721.42594 174332.98579888, 172721.70594 174334.18179888, 172722.03394001 174335.51479889, 172722.60994 174337.84979888, 172723.15794 174340.07079888, 172719.07994 174341.35879889, 172719.00094001 174340.49779889, 172718.62994001 174340.60179888, 172717.50294 174340.91679888, 172714.97094 174341.62679888, 172714.17294 174341.84979888, 172712.47094 174342.32679888, 172710.41394001 174342.90279889, 172708.33894001 174343.48379889, 172705.43894001 174344.29679888, 172702.72094 174345.05779888, 172703.36294 174347.25779888, 172703.90994001 174349.13479888, 172702.14294 174349.59779889, 172700.29694 174350.08079888, 172697.39194001 174350.83979889, 172695.26994001 174351.39479888, 172694.94394 174349.74379888, 172692.57994 174350.34579889, 172689.68394 174351.08279889, 172686.95894 174351.77579889, 172684.89594 174352.30079888, 172683.30094 174352.70679888, 172681.18294 174353.24579888, 172679.33194001 174353.71579888, 172677.40094 174354.20779889, 172676.77394001 174351.89279888, 172676.06194 174349.26679889, 172675.74094001 174348.08279889, 172675.25994 174346.30779888, 172674.46694 174343.38379889, 172673.58194001 174340.11779889, 172672.77094 174337.12779888, 172670.94994001 174337.60879888, 172669.08994001 174338.09979888, 172668.25594001 174338.31979889, 172663.54094 174339.43779888, 172663.95094 174340.99179888, 172664.37094 174342.58279889, 172664.94494 174344.75679888, 172665.47294 174346.75879889, 172666.08594001 174349.08279889, 172666.77094 174351.67579889, 172667.44094 174354.21779888, 172665.21794001 174354.76179888, 172663.37894 174355.21179888, 172661.58094 174355.65179889, 172659.15894001 174356.24379888, 172656.24094001 174356.95779889, 172655.82894001 174354.98779888, 172655.30694001 174352.49479889, 172654.75394 174349.85379888, 172653.44094 174347.26779888, 172650.79094 174346.37779888, 172649.39294 174346.74579888, 172648.16994001 174347.06779889, 172643.14494001 174348.38979889, 172640.56794001 174349.06779889, 172638.06294 174349.72679888, 172635.80894 174350.31979889, 172634.01694001 174350.79179888, 172631.56094001 174351.43779889, 172631.68094001 174351.69779888, 172630.46894001 174352.05179889, 172629.28094001 174352.39979888, 172627.68094001 174352.86779889, 172628.10094001 174354.11979889, 172628.68794 174355.86679889, 172629.43094001 174358.08279889, 172630.24694001 174360.51479889, 172630.85694 174362.33379888, 172631.76094 174365.02779889, 172632.43094001 174364.86779889, 172632.93494001 174366.67479889, 172630.87694001 174367.28679889, 172629.35094001 174367.69579888, 172627.54894001 174368.17979889, 172625.44094 174368.74479889, 172623.82194001 174369.17879888, 172621.82194001 174369.71579888, 172620.13194 174370.16879888, 172618.52894 174370.59879889, 172616.85694 174371.04679888, 172613.67694 174372.43679888, 172612.27094 174372.87179888, 172610.70894 174373.35479889, 172608.85694 174373.92679889, 172608.25794001 174371.89079888, 172607.82694 174370.42679889, 172607.50694 174370.51679889, 172607.38694001 174370.06679888, 172607.01194001 174368.70179889, 172605.61394 174369.12679889, 172604.29194001 174364.49979888, 172605.79494001 174364.27579889, 172604.95794001 174361.23079889, 172604.15694 174358.31679888, 172601.38294001 174359.08279889, 172599.73694001 174359.53679889, 172599.03094001 174356.96479888, 172598.45694001 174354.87679889, 172598.31094001 174353.65579888, 172597.92494001 174352.22579889, 172597.51694001 174350.71679889, 172593.94294001 174351.68579889, 172594.45994 174353.59579889, 172594.89194001 174355.18879888, 172594.43694 174355.28679889, 172595.10394001 174357.58879888, 172595.61694 174359.35679889, 172596.36994 174361.95579889, 172596.92694 174363.87679888, 172594.25694 174364.45679888, 172594.21694 174364.31679888, 172593.00494001 174364.65379888, 172592.00394 174364.93279888, 172590.26894 174365.41579889, 172588.36994 174365.94479889, 172586.29894001 174366.52079888, 172585.71094001 174364.28879889, 172585.01994001 174361.66879889, 172584.37794 174359.23179889, 172583.45694001 174355.73579888, 172582.56194 174352.34079888, 172581.81194 174349.49579888, 172578.83494 174350.40579889, 172579.40794 174352.63579888, 172579.78994 174354.11679888, 172580.28794001 174356.05279889, 172580.77094 174357.92779888, 172581.47694 174360.66679888, 172581.97094 174362.58679888, 172582.24294 174363.61779889, 172582.54194001 174364.74379888, 172582.91294001 174366.13879888, 172583.24094001 174367.37179888, 172583.56894 174368.60379888, 172583.98394 174370.16379889, 172584.46094001 174371.95479888, 172584.86494001 174373.47379888, 172585.18994 174374.69679889, 172581.69994001 174375.73579888, 172581.45894 174374.65479888, 172581.93994 174374.65479888, 172582.48094 174373.39279888, 172580.61794 174366.54279888, 172576.54694 174367.44579888, 172576.96094001 174368.82979888, 172577.49594 174370.61579889, 172578.20294001 174372.70579888, 172578.57394 174374.21879889, 172578.69794 174374.72879888, 172578.94194001 174375.71979888, 172579.21594 174376.83779888, 172579.48694001 174377.94179888, 172579.78194 174379.14479889, 172580.08194001 174380.37079888, 172580.58694 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888, 172576.23194 174376.15679888, 172575.20994 174372.55179889, 172573.66494 174372.83079889, 172574.33394 174375.25079888, 172574.79994001 174376.93479888, 172574.46694 174377.10679889, 172573.55494 174377.38579888, 172571.95794001 174377.87279889, 172569.12694001 174378.73679888, 172570.29694 174382.59679888, 172569.06894 174382.95779889, 172567.62494 174383.37779888, 172566.17594 174383.79879889, 172564.97094 174384.14879888, 172563.53494001 174384.56479888, 172562.23594001 174384.94279889, 172561.03494001 174385.29079889, 172559.35194 174385.66979888, 172558.39794001 174385.88479888, 172556.63694001 174386.28179888, 172554.56194 174386.74879888, 172554.93394 174388.02679888, 172555.33194001 174389.39779888, 172555.78394001 174390.95079888, 172556.25094001 174392.55979888, 172556.78094001 174394.38279888, 172557.38394001 174396.45779889, 172555.12994001 174410.66979888, 172554.04194001 174412.21079889, 172554.18094001 174413.74279889, 172554.35894 174415.69279889, 172554.59094 174418.23979888, 172554.80294001 174420.57479888, 172555.02794001 174423.04279888, 172555.93294 174422.97279889, 172557.54494001 174422.84879889, 172560.00094001 174422.89679889, 172562.04294 174422.83779889, 172563.99094001 174422.77979888, 172565.29094 174422.74079889, 172567.21594 174422.68179889, 172569.10194 174422.62379888, 172568.98294001 174421.27879888, 172568.88094001 174420.13579889, 172568.73194 174418.45579889, 172568.45294001 174415.31879888, 172570.64394 174415.21279889, 172570.64394001 174420.55979889, 172572.08594001 174420.43979888, 172572.08594001 174421.46179888, 172572.89894001 174421.52179889, 172572.93594001 174418.69679889, 172572.92794001 174415.53279888, 172575.20994 174415.51279889, 172575.27294001 174421.23079888, 172577.66994001 174421.37079888, 172577.71794001 174420.68179889, 172577.72494001 174418.93679889, 172577.73594001 174415.93279888, 172580.01694001 174415.87379888, 172579.83694 174420.49979889, 172581.27894 174420.49979889, 172581.16094 174421.60179888, 172582.17694 174421.66979888, 172582.13594 174422.43279888, 172582.06294 174423.81779889, 172581.85494001 174425.10579888, 172581.54394 174425.96979888, 172582.27094 174425.90879888, 172583.34994001 174425.81679888, 172584.44594001 174425.72479888, 172585.57394 174425.43879889, 172587.27294001 174425.00679888, 172589.82794001 174424.35879889, 172589.40294001 174423.53179888, 172589.03494001 174422.06079888, 172588.59694001 174420.30879889, 172588.35594 174419.34679888, 172587.97694 174417.82879889, 172587.78294 174417.05679889, 172587.61594001 174415.77979888, 172587.36494001 174414.35979888, 172587.75394 174413.42079888, 172587.86994 174411.44879889, 172592.26794 174410.32279888, 172592.57794001 174412.11779889, 172593.54694 174411.85679889, 172593.88294001 174413.17479889, 172596.71694 174412.45279888, 172597.50594001 174415.42779888, 172593.94094 174416.36279888, 172594.31794001 174417.67579888, 172595.57994 174417.37579888, 172595.88594 174418.96979888, 172599.56994 174418.29279888, 172600.39494001 174421.68079888, 172599.12494 174422.00279888, 172597.83994001 174422.32779888, 172595.25594001 174422.98279888, 172595.67794001 174424.90679888, 172598.81094001 174424.21879889, 172599.32294 174426.26379888, 172599.83994001 174428.32779888, 172600.28294 174430.09379889, 172599.53294 174430.30379888, 172598.94794 174431.12079888, 172598.50794001 174431.73679888, 172598.17194 174432.53079888, 172597.70394001 174433.63779889, 172598.26694001 174435.35479889, 172601.68394 174434.46579888, 172602.63794001 174437.85679889, 172603.52094 174441.33179888, 172604.18794 174443.95879889, 172607.05394 174443.20479888, 172608.01694001 174447.05779888, 172602.61494001 174448.18279888, 172603.57694 174451.96779888, 172591.37294001 174454.98979888, 172593.09694001 174460.86279888, 172596.00694 174460.12279889, 172599.45294001 174459.24579888, 172605.06394001 174457.81879888, 172608.39694 174456.97079889, 172613.56094001 174455.65679888, 172614.32594 174458.77479888, 172609.11894001 174459.86879888, 172606.47194001 174460.59979888, 172604.45794001 174461.15679888, 172605.34094 174464.77179889, 172607.57394 174464.20979889, 172609.99094001 174463.60579889, 172613.07994 174462.83479889, 172613.61894001 174464.88379889, 172614.04994001 174466.51979889, 172614.37794 174467.76679889, 172612.53894001 174468.36579889, 172611.16394001 174468.81479888, 172608.52994 174469.67379888, 172609.11194001 174471.76679889, 172609.56494 174473.39879889, 172612.91294001 174485.56179888, 172614.59894 174485.11079888, 172617.38894 174484.36379889, 172622.33194001 174483.04179888, 172625.99594 174482.06079889, 172629.84294001 174481.03179888, 172641.95194 174477.65279889, 172643.75494001 174477.16979888, 172645.38894 174476.73279888, 172647.53094001 174476.15979889, 172649.87894 174475.53179888, 172652.14894001 174474.92479889, 172655.08794 174474.13879889, 172656.82294 174473.67479889, 172659.20494 174473.03779889, 172661.12994001 174472.52279888, 172663.13094001 174471.98779888, 172666.07294 174471.20079888, 172669.09894 174470.39179889, 172670.32794001 174470.07579888, 172672.24694001 174469.58179889, 172673.91894 174469.15179888, 172674.58694 174468.84879889, 172675.52994 174468.59879889, 172677.88094001 174467.97779889, 172680.51794 174467.28079889, 172683.39194001 174466.52079888, 172686.88994 174465.59579889, 172690.08694 174464.75079888, 172693.60394001 174463.82179889, 172694.71594 174465.90079889, 172695.81494 174467.95779889, 172696.76694001 174469.73679889, 172698.74294 174473.43379889, 172700.00894001 174475.80279888, 172701.21194 174478.05279888, 172702.29394 174480.07679889, 172712.67294 174477.65879888, 172714.31294 174477.23479888, 172715.92294 174476.81879889, 172718.15094 174476.24279889, 172719.85594 174475.80279888, 172719.07394 174472.68079888, 172722.78994 174471.85879889, 172723.62094 174471.64979888, 172726.34994001 174470.96079888, 172727.68494001 174470.62379888, 172728.34494 174470.45779889, 172728.94594001 174470.31079889, 172729.36494001 174470.20779889, 172733.29694 174468.74879888, 172732.51594001 174463.94179888, 172736.18094001 174462.86079888, 172736.12094 174460.75779888, 172739.38594 174460.04779889, 172751.74194 174457.62979889, 172752.52594 174459.31079889, 172753.47194001 174461.34079888, 172754.32394 174463.17079889, 172755.22994001 174465.11479888, 172756.45494 174467.74379888, 172757.91194 174470.86979889, 172759.17194 174473.57379889, 172760.30194 174475.99779889, 172767.25694 174472.63279888)))" + ) + polygon_b = from_wkt( + "MULTIPOLYGON(((172557.3838523062 174396.45835165278, 172555.12905084348 174410.6693711578, 172554.04105084387 174412.2103631608, 172554.28937084228 174414.93676316369, 172555.0277388468 174423.0425551683, 172563.7369228527 174422.37100316587, 172569.0432908535 174421.9618511684, 172568.4963957805 174415.81728130922, 172568.4972705121 174415.81723898993, 172568.45294000994 174415.31879887995, 172570.64394 174415.21279888996, 172570.64394001 174420.55979889, 172572.08594000997 174420.43979888, 172572.08594000997 174420.94152719184, 172572.77495595193 174420.8841888285, 172572.71193637606 174416.03471118974, 172572.929204253 174416.03280700246, 172572.92794000998 174415.53279887998, 172575.20994000003 174415.51279889, 172575.27294001004 174421.23079888, 172577.6697196799 174421.37078601134, 172577.70199362023 174416.43384416474, 172577.73410833202 174416.4330134905, 172577.7358131635 174415.9674395041, 172577.73594001 174415.93279888004, 172578.87644000998 174415.90329888, 172580.01694000998 174415.87379888, 172579.83694 174420.49979889003, 172581.27894 174420.49979889003, 172581.22540097954 174420.99979889003, 172582.22334147422 174420.99979889003, 172582.17621886 174421.66917916582, 172582.0176908598 174424.652603168, 172581.5430028588 174425.96959516776, 172581.36988285926 174426.44985117015, 172583.22229886055 174426.393211171, 172584.53372231862 174426.04524331444, 172585.60137086362 174425.76191516966, 172589.6888588667 174424.67730716988, 172588.59657086435 174420.30905116722, 172587.97628287587 174417.82828320874, 172587.62773886323 174416.44255516306, 172587.57641086724 174416.43890716136, 172587.6150668636 174415.78034716102, 172587.75349886715 174413.420987159, 172587.86921086907 174411.4484431595, 172591.77150026744 174410.4497097941, 172592.26794067942 174410.3228028141, 172592.57794001006 174412.11779889002, 172593.54694000003 174411.85679889002, 172593.88294001002 174413.17479889, 172596.71693999998 174412.45279888005, 172597.50594000999 174415.42779887991, 172597.172895412 174415.51514718245, 172597.022295644 174415.5546452982, 172597.0224054087 174415.55505917643, 172593.93199883454 174416.33165895962, 172593.94094 174416.36279887997, 172594.31794001002 174417.67579888002, 172595.57994 174417.37579888004, 172595.88594000004 174418.96979887996, 172599.56993999996 174418.29279888, 172600.39494000998 174421.68079888003, 172599.91025387176 174421.80368780546, 172599.94715650496 174421.95523461731, 172596.69628287107 174422.8178511672, 172595.3009759594 174423.18812865848, 172595.67794001 174424.90679888, 172598.81094000905 174424.2187988902, 172598.92996166085 174424.6941881079, 172599.32293973575 174426.26379782447, 172599.32319430308 174426.26481412462, 172599.83993917855 174428.32779556068, 172600.28294000003 174430.09379889, 172599.53294 174430.30379888, 172598.9479399949 174431.12079888713, 172598.50794000993 174431.73679888, 172598.17194137024 174432.53079564194, 172597.70394001 174433.63779889003, 172598.2660748735 174435.35474717614, 172601.1998381591 174434.5913030442, 172601.19995467947 174434.5917172166, 172601.68394000002 174434.46579888, 172602.63794000942 174437.85679888783, 172603.5209395613 174441.3317971537, 172603.67147661696 174441.92469197488, 172604.18799165756 174443.95900234475, 172607.0539523896 174443.2048484512, 172608.01694001004 174447.05779888, 172602.61494001004 174448.18279888007, 172603.57694000003 174451.96779887998, 172591.37294001 174454.98979887998, 172593.09693550566 174460.86278353556, 172605.0632588789 174457.8183631897, 172608.39689087868 174456.97023519131, 172613.0762718963 174455.77972994547, 172613.07636302974 174455.78010138884, 172613.56094001004 174455.65679887997, 172614.32594000004 174458.77479888004, 172609.11894000994 174459.86879888005, 172606.47194360537 174460.59979788712, 172604.45794001 174461.15679888, 172605.3409823247 174464.7719721671, 172612.59480380098 174462.95596724018, 172612.7014123517 174462.92927763195, 172613.07994000003 174462.83479889008, 172613.61893907966 174464.88379535347, 172613.6189968665 174464.88401470726, 172614.04993903125 174466.51979517483, 172614.37794 174467.76679889, 172612.53894704106 174468.36579659986, 172612.53852629993 174468.36593398513, 172611.16394366286 174468.81479768714, 172608.52993999998 174469.67379888, 172609.11193880375 174471.76679455204, 172609.11197085044 174471.76690999718, 172609.56229931235 174473.38928541902, 172609.5649399964 174473.3987988771, 172612.91284623384 174485.5614581992, 172616.49161088464 174484.6038992107, 172617.37810321042 174484.36670035287, 172617.3781038362 174484.3667001854, 172617.40430078932 174484.35969066346, 172621.91801405355 174483.1519558644, 172625.84397284017 174482.10148660126, 172626.28639576584 174481.983107446, 172629.84245889643 174481.0316112079, 172629.84260632202 174481.0318919951, 172641.95148947238 174477.65292460908, 172641.9513229055 174477.65228320664, 172643.55453783524 174477.22348398916, 172649.45557890835 174475.6451792046, 172652.118800357 174474.93285825956, 172655.08757891503 174474.13881120458, 172669.09820291854 174470.39141919912, 172673.91823492196 174469.15141920003, 172674.05039449205 174469.04677954124, 172674.1582349241 174468.9614031985, 172675.5150722086 174468.60274051016, 172675.58914901028 174468.58315924928, 172676.93838271403 174468.22650647085, 172685.4841995281 174465.9675284286, 172690.08649093658 174464.75097119805, 172690.35773174433 174464.679270439, 172693.6036109403 174463.82124319673, 172695.45967493954 174467.2931151986, 172695.69615282057 174467.73546474247, 172695.8858936043 174468.09038905406, 172702.29378802062 174480.0768342967, 172712.67227422315 174477.65895398633, 172712.67215495606 174477.6584912053, 172719.8562189564 174475.80549920353, 172719.13622944942 174473.1791069913, 172719.19547385076 174473.1660017983, 172719.07393999997 174472.68079888003, 172722.78994000095 174471.8587988898, 172723.6209313099 174471.64980106562, 172723.62116079254 174471.6497431358, 172726.34993987996 174470.9607989128, 172727.68514120538 174470.623748284, 172728.34493999486 174470.45779889126, 172728.94593998056 174470.3107988972, 172729.36494001048 174470.20779888984, 172733.29694 174468.74879888006, 172732.51594000997 174463.94179888, 172736.18094000997 174462.86079888, 172736.12094 174460.75779888, 172739.38593999937 174460.04779889015, 172751.74194 174457.62979889003, 172751.82374942137 174457.8052091417, 172760.30108298364 174475.9976912029, 172767.25628262636 174472.6322513803, 172767.5851149932 174472.47314720228, 172767.50690699372 174472.13401120156, 172767.1188087445 174472.3620791199, 172766.30993999983 174470.7767988602, 172765.64794001004 174469.48679887998, 172766.51694001004 174469.12679887997, 172765.12794 174466.03679888998, 172764.34694001 174466.34679888003, 172762.84694005293 174463.15679897126, 172763.29320167168 174462.94189765144, 172764.2839314731 174462.46480300103, 172765.32593999998 174461.96179887993, 172761.1385378274 174453.29491927216, 172761.13853782744 174453.29491927216, 172760.09694000988 174451.01679888976, 172759.79494001003 174450.12279889, 172760.93594000998 174449.76179888003, 172761.82593999995 174450.27579889004, 172762.67400122888 174449.91177263303, 172765.15694 174448.84679888003, 172764.19994000997 174445.99879888, 172764.60994001062 174445.80279888492, 172764.33894001 174444.31479887993, 172763.51689098784 174441.74149918192, 172763.5168882326 174441.74150007046, 172763.51688823258 174441.74150007026, 172763.21993999998 174440.02779889002, 172761.17694 174440.68879888, 172759.74790522835 174436.7047019099, 172755.11890209024 174438.21366147915, 172754.95691696025 174437.6267152474, 172754.85751089564 174437.26601325686, 172754.6069400003 174436.3567988909, 172755.10336595034 174436.22560282986, 172756.19993908802 174435.93579913364, 172758.35593845724 174435.36579929787, 172760.84694000997 174434.70679888004, 172760.58894161868 174433.5358061814, 172760.14693999995 174431.53679888978, 172759.5329400001 174429.6077988801, 172759.52534339868 174429.53306474834, 172759.48582006822 174429.1442406328, 172759.76815493542 174429.05234718855, 172759.7528128644 174429.0162936086, 172759.12745483534 174427.54860076858, 172759.12745462733 174427.54860004058, 172759.1267469823 174427.54693917185, 172759.12695293076 174427.54684410253, 172758.76693612643 174426.28678529424, 172758.12194001 174424.02879888, 172758.32293999995 174423.95879888002, 172758.05193999998 174421.82179889004, 172756.6439400104 174422.12379887994, 172756.53950232168 174422.15535105282, 172755.98194000003 174422.32379888996, 172755.12451175836 174419.47773878835, 172753.83321806323 174419.78523359896, 172752.4939518636 174414.58684488994, 172751.20706697553 174414.83333916217, 172750.73129098117 174412.7877071612, 172748.95247497407 174413.2481231615, 172748.47247497732 174411.39813916016, 172753.23247498277 174410.11813915893, 172751.57647497955 174404.02937115356, 172750.80501897636 174401.19289115068, 172749.21920579113 174395.36230315745, 172749.2194832201 174395.36220860117, 172749.08793999997 174394.87879889001, 172750.24394001003 174394.48479888003, 172751.79493705663 174393.68580041145, 172753.32194001004 174392.89979888, 172754.02694001 174394.06179887996, 172759.86194000999 174390.84279887998, 172760.84694001003 174392.75779887996, 172762.75293454644 174391.80780159816, 172762.7540957816 174391.80722369105, 172764.6779369368 174390.84980040943, 172767.0349380484 174389.675799857, 172769.10393896094 174388.64579940226, 172770.8269400001 174387.78779888, 172772.41231297184 174387.0021096416, 172769.92245898946 174381.99321113512, 172769.86473163788 174381.87794843127, 172766.27740298968 174374.71225113448, 172766.12751504182 174374.37625125528, 172765.45154720507 174372.86111561494, 172764.5623949914 174370.86834713045, 172758.44661898166 174358.71346712485, 172758.08089647835 174357.9866221479, 172758.0812897689 174357.9865175769, 172757.8519399999 174357.5307988898, 172754.4110373197 174349.3873883099, 172754.41083817216 174349.3874620819, 172754.04609390008 174348.52429801252, 172753.7164504677 174347.74419976756, 172753.71289365587 174347.7351269625, 172752.91599497944 174345.84914711493, 172752.96828298277 174345.83532311398, 172752.74697099614 174345.2712271516, 172750.88521097507 174340.5253711095, 172749.90261897308 174337.94073110458, 172742.68309897187 174319.57548309487, 172729.2444429621 174323.76869909838, 172729.1040909663 174323.3482191004, 172719.76546695834 174325.91705109927, 172721.48245895657 174332.9833551049, 172723.08294328308 174339.57013976108, 172723.03791828503 174339.58436050604, 172723.15793999998 174340.07079887998, 172719.07994 174341.35879888994, 172719.0331842302 174340.8492201192, 172718.5874979483 174340.98998616525, 172718.5534989536 174340.6227151118, 172714.9709069505 174341.62623511252, 172702.72073094547 174345.05746711424, 172703.20898694542 174346.73209111392, 172703.9096589461 174349.13503511623, 172695.26953093708 174351.39500311756, 172694.93771905327 174349.74538306356, 172692.57990415473 174350.34580801197, 172692.57334559556 174350.34747709305, 172689.68390132912 174351.0828087242, 172689.6768192437 174351.08460978328, 172686.95894150986 174351.77579850602, 172684.89594078047 174352.3007986814, 172684.8828689878 174352.30412604674, 172683.3009262921 174352.70680236846, 172681.18281584515 174353.24583040207, 172679.3319479569 174353.71579686215, 172677.40094000465 174354.20779888882, 172677.27266865686 174353.73419735025, 172676.77394073328 174351.89280155062, 172676.06193873903 174349.26679423897, 172675.7409324217 174348.08277088706, 172675.25994054292 174346.30780088357, 172675.2596599193 174346.30676614863, 172674.46692653303 174343.38374918967, 172673.58194064876 174340.11780124725, 172672.77094000002 174337.12779888004, 172670.9499049531 174337.60880813404, 172670.52563620973 174337.72080595847, 172669.09919766168 174338.09735505903, 172669.08994002102 174338.09979887708, 172668.25594001057 174338.3197988899, 172663.54094 174339.43779888, 172663.9509396747 174340.9917976469, 172663.95246609734 174340.9975798821, 172664.37093995474 174342.5827987186, 172664.9449393093 174344.75679626403, 172665.47293987044 174346.75879839866, 172665.473080069 174346.7593299183, 172666.08593904617 174349.08279523588, 172666.0860074876 174349.08305431984, 172666.77093856825 174351.67579347026, 172667.44093999997 174354.21779888, 172665.21794001 174354.76179888, 172665.0101183685 174354.8126524625, 172663.37894000002 174355.21179888002, 172663.37873282918 174355.21184957805, 172661.5809427116 174355.65179822646, 172659.15894248072 174356.2437982761, 172656.24094000997 174356.95779889004, 172655.8289405051 174354.98780124754, 172655.30694000996 174352.49479888997, 172654.75393999997 174349.85379887992, 172653.44093999994 174347.26779887994, 172650.79094000012 174346.37779887998, 172649.39294039877 174346.74579877505, 172649.3911846923 174346.7462610297, 172648.1699417751 174347.06779842527, 172643.14494001 174348.38979889, 172642.93389291374 174348.44532466854, 172640.56794000996 174349.06779889, 172640.41789637046 174349.10727144754, 172638.06294 174349.72679888003, 172635.8089427633 174350.319798163, 172634.01694338908 174350.79179799, 172631.56094000998 174351.43779888997, 172631.68094001 174351.69779888, 172630.46894738195 174352.0517967368, 172630.4687520214 174352.05185395735, 172629.2809437475 174352.39979778518, 172627.68094000997 174352.86779889, 172628.10093847304 174354.1197943085, 172628.10107294662 174354.1201945294, 172628.6879379874 174355.86679290008, 172628.68799114702 174355.86695143604, 172629.43093933648 174358.08279688127, 172629.43133035954 174358.0839622848, 172630.24693959064 174360.5147976402, 172630.24792235918 174360.51772822303, 172630.85693939638 174362.3337970801, 172631.76094 174365.02779888996, 172632.43094001003 174364.86779888996, 172632.93494001002 174366.67479888993, 172630.87694000924 174367.2867988902, 172629.35094510994 174367.69579751312, 172629.35049890392 174367.69591735688, 172627.54894514213 174368.17979751158, 172627.52128803954 174368.18721035263, 172625.4409402792 174368.7447988152, 172625.43971959242 174368.74512604062, 172623.82194391786 174369.17879783243, 172621.82194405483 174369.715797794, 172621.82183787943 174369.71582625585, 172620.13194178292 174370.16879840213, 172618.52894290345 174370.59879811114, 172616.85694000009 174371.04679887995, 172613.67694 174372.43679888, 172612.2709414281 174372.87179843814, 172610.70894325845 174373.35479788246, 172608.85694 174373.92679889, 172608.25794049533 174371.89080052968, 172607.82694000003 174370.42679889002, 172607.51030628625 174370.515852122, 172607.38694001004 174370.06679887997, 172607.01194001 174368.70179888996, 172605.61394000004 174369.12679888998, 172604.29194001 174364.49979887996, 172605.79494001003 174364.27579888995, 172604.95794001003 174361.23079889003, 172604.15693999996 174358.31679887997, 172601.3829428521 174359.08279810517, 172600.24729543962 174359.3960325686, 172597.84457264078 174350.6279695617, 172597.51694001004 174350.71679888997, 172593.94294000993 174351.68579889, 172594.4599387648 174353.5957943269, 172594.89194001 174355.18879888, 172594.43694 174355.28679888998, 172595.10393895835 174357.58879525043, 172595.61693890326 174359.35679511022, 172596.36993943545 174361.95579694142, 172596.92693999998 174363.87679887997, 172594.25694 174364.45679887995, 172594.21693999998 174364.31679888006, 172593.00494592657 174364.6537972349, 172593.00452690053 174364.65391402238, 172592.00394302807 174364.932798036, 172590.26894162453 174365.41579843775, 172588.36994388918 174365.94479780665, 172588.36984125132 174365.94482635465, 172586.29894001002 174366.52079888002, 172585.7109407086 174364.2888015419, 172585.71082483808 174364.2883622034, 172585.01994076036 174361.66880173524, 172584.8667329185 174361.0872324162, 172584.37794 174359.23179888996, 172583.4569404406 174355.73580051467, 172582.56193999999 174352.34079887997, 172581.81194 174349.49579887997, 172578.96056568567 174350.36739802494, 172585.1382444169 174374.19050227254, 172585.0614705477 174374.21335843968, 172585.18994 174374.69679888996, 172581.69994000997 174375.73579888, 172581.62350512363 174375.3929519558, 172581.93994000004 174374.65479888, 172582.48094 174373.39279888003, 172580.61794 174366.54279888, 172576.77667659082 174367.3948403584, 172578.3008907684 174373.35775476237, 172578.52405885607 174374.23071513322, 172580.47195049844 174381.85118837637, 172580.4625612569 174381.85333750857, 172580.58694000004 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888003, 172576.23194 174376.15679888002, 172575.20993999997 174372.55179889, 172573.66458694366 174372.8308626458, 172574.0934668556 174374.3819471337, 172574.33365876754 174375.25074680167, 172574.7994377378 174376.93505831185, 172574.46694027368 174377.10679874866, 172573.55473542705 174377.38586125555, 172571.95794220705 174377.87279822002, 172569.12694000997 174378.73679888004, 172570.29693999997 174382.59679888, 172569.06894000657 174382.95779888806, 172568.98899089158 174382.9810527852, 172567.62494267538 174383.37779810186, 172566.1759413303 174383.7987985035, 172564.9709467131 174384.14879693012, 172563.53494001646 174384.5647988781, 172562.23594001002 174384.94279888997, 172561.03905731053 174385.28960586703, 172554.56188284606 174386.74853914225, 172555.21404284242 174388.99244314435, 172557.3838523062 174396.45835165278)),((172739.38594000007 174460.04779889, 172739.39373637483 174460.04610350684, 172739.392673916 174460.04121769255, 172739.3870486459 174460.03837656736, 172739.38261013498 174460.0403655549, 172739.3807950899 174460.03631378766, 172739.37623201194 174460.03835788142, 172739.37262919155 174460.04530889943, 172739.37358944913 174460.05021582366, 172739.3858038434 174460.04782553512, 172739.3859399994 174460.04779889015, 172739.38594000007 174460.04779889)))" + ) + result = safe_union(polygon_a, polygon_b) # GEOS exception is catched self.assertTrue(result.is_valid) def test_safe_intersection(self): @@ -67,10 +73,15 @@ def test_safe_intersection(self): def test_safe_intersection_geos_exception(self): """Tests safe_intersection with a geos exception.""" - polygon_a = from_wkt('MULTIPOLYGON(((172767.25694 174472.63279888, 172766.30994001 174470.77679888, 172765.64794001 174469.48679888, 172766.51694001 174469.12679888, 172765.12794 174466.03679889, 172764.34694001 174466.34679888, 172762.84694001 174463.15679888, 172764.28394001 174462.46479889, 172765.32594 174461.96179888, 172761.13894 174453.29579888, 172760.09694001 174451.01679889, 172759.79494001 174450.12279889, 172760.93594001 174449.76179888, 172761.82594 174450.27579889, 172762.67394001 174449.91179889, 172765.15694 174448.84679888, 172764.19994001 174445.99879888, 172764.60994 174445.80279889, 172764.33894001 174444.31479888, 172763.51694001 174441.74179888, 172763.21994 174440.02779889, 172761.17694 174440.68879888, 172759.74794001 174436.70479888, 172759.02694001 174436.93979888, 172756.96694 174437.61179889, 172755.11894001 174438.21379888, 172754.95694001 174437.62679889, 172754.60694 174436.35679889, 172756.19994001 174435.93579889, 172758.35594 174435.36579889, 172760.84694001 174434.70679888, 172760.58894001 174433.53579888, 172760.14694 174431.53679889, 172759.53294 174429.60779888, 172759.38494 174428.15179888, 172759.12694001 174427.54679888, 172758.76694001 174426.28679889, 172758.12194001 174424.02879888, 172758.32294 174423.95879888, 172758.05194 174421.82179889, 172756.64394001 174422.12379888, 172755.98194 174422.32379889, 172755.12694001 174419.48579888, 172753.83594001 174419.79579889, 172752.49394001 174414.58679888, 172751.20794001 174414.83379888, 172750.65294001 174412.80779888, 172748.95294001 174413.24779889, 172748.47294 174411.39879889, 172753.23294001 174410.11879888, 172752.77094 174408.42079889, 172752.20594 174406.34079888, 172751.57694 174404.02979888, 172750.94994001 174401.72379889, 172750.44494 174399.86779889, 172749.65394 174396.95879888, 172749.08794 174394.87879889, 172750.24394001 174394.48479888, 172751.79494001 174393.68579889, 172753.32194001 174392.89979888, 172754.02694001 174394.06179888, 172759.86194001 174390.84279888, 172760.84694001 174392.75779888, 172762.75294 174391.80779888, 172764.67794001 174390.84979888, 172767.03494001 174389.67579888, 172769.10394001 174388.64579888, 172770.82694 174387.78779888, 172772.41294001 174387.00179889, 172771.70694001 174385.58179888, 172770.47494001 174383.10379888, 172769.86494001 174381.87779888, 172769.31094001 174380.77179889, 172768.51694001 174379.18579889, 172767.43494001 174377.02279888, 172766.27794001 174374.71279889, 172765.78994 174373.61879888, 172765.24294 174372.39279888, 172764.56294 174370.86879888, 172763.48394 174368.72379889, 172762.58994001 174366.94779889, 172761.36994 174364.52279888, 172760.27094 174362.33879888, 172759.15994001 174360.12979888, 172757.85194 174357.53079889, 172752.91594 174345.84979888, 172752.44494 174344.50079888, 172751.68294 174342.55779888, 172750.88594 174340.52579889, 172749.87694001 174337.94779888, 172748.82694 174335.20279888, 172747.72094 174332.38879888, 172746.51294001 174329.31579889, 172745.36494001 174326.39779888, 172743.82194001 174322.47179888, 172742.68394 174319.57579888, 172739.86294 174320.46079888, 172737.67194 174320.96779888, 172736.12194001 174321.39879889, 172733.90294001 174322.01479889, 172731.21594 174322.76179888, 172729.70094 174323.15779889, 172729.10494001 174323.34879888, 172727.50294 174323.86079888, 172724.60494001 174324.78679888, 172719.82894001 174326.31279889, 172720.17794001 174327.77779889, 172720.41094 174328.75779888, 172720.82494001 174330.49979889, 172721.08494 174331.56079889, 172721.42594 174332.98579888, 172721.70594 174334.18179888, 172722.03394001 174335.51479889, 172722.60994 174337.84979888, 172723.15794 174340.07079888, 172719.07994 174341.35879889, 172719.00094001 174340.49779889, 172718.62994001 174340.60179888, 172717.50294 174340.91679888, 172714.97094 174341.62679888, 172714.17294 174341.84979888, 172712.47094 174342.32679888, 172710.41394001 174342.90279889, 172708.33894001 174343.48379889, 172705.43894001 174344.29679888, 172702.72094 174345.05779888, 172703.36294 174347.25779888, 172703.90994001 174349.13479888, 172702.14294 174349.59779889, 172700.29694 174350.08079888, 172697.39194001 174350.83979889, 172695.26994001 174351.39479888, 172694.94394 174349.74379888, 172692.57994 174350.34579889, 172689.68394 174351.08279889, 172686.95894 174351.77579889, 172684.89594 174352.30079888, 172683.30094 174352.70679888, 172681.18294 174353.24579888, 172679.33194001 174353.71579888, 172677.40094 174354.20779889, 172676.77394001 174351.89279888, 172676.06194 174349.26679889, 172675.74094001 174348.08279889, 172675.25994 174346.30779888, 172674.46694 174343.38379889, 172673.58194001 174340.11779889, 172672.77094 174337.12779888, 172670.94994001 174337.60879888, 172669.08994001 174338.09979888, 172668.25594001 174338.31979889, 172663.54094 174339.43779888, 172663.95094 174340.99179888, 172664.37094 174342.58279889, 172664.94494 174344.75679888, 172665.47294 174346.75879889, 172666.08594001 174349.08279889, 172666.77094 174351.67579889, 172667.44094 174354.21779888, 172665.21794001 174354.76179888, 172663.37894 174355.21179888, 172661.58094 174355.65179889, 172659.15894001 174356.24379888, 172656.24094001 174356.95779889, 172655.82894001 174354.98779888, 172655.30694001 174352.49479889, 172654.75394 174349.85379888, 172653.44094 174347.26779888, 172650.79094 174346.37779888, 172649.39294 174346.74579888, 172648.16994001 174347.06779889, 172643.14494001 174348.38979889, 172640.56794001 174349.06779889, 172638.06294 174349.72679888, 172635.80894 174350.31979889, 172634.01694001 174350.79179888, 172631.56094001 174351.43779889, 172631.68094001 174351.69779888, 172630.46894001 174352.05179889, 172629.28094001 174352.39979888, 172627.68094001 174352.86779889, 172628.10094001 174354.11979889, 172628.68794 174355.86679889, 172629.43094001 174358.08279889, 172630.24694001 174360.51479889, 172630.85694 174362.33379888, 172631.76094 174365.02779889, 172632.43094001 174364.86779889, 172632.93494001 174366.67479889, 172630.87694001 174367.28679889, 172629.35094001 174367.69579888, 172627.54894001 174368.17979889, 172625.44094 174368.74479889, 172623.82194001 174369.17879888, 172621.82194001 174369.71579888, 172620.13194 174370.16879888, 172618.52894 174370.59879889, 172616.85694 174371.04679888, 172613.67694 174372.43679888, 172612.27094 174372.87179888, 172610.70894 174373.35479889, 172608.85694 174373.92679889, 172608.25794001 174371.89079888, 172607.82694 174370.42679889, 172607.50694 174370.51679889, 172607.38694001 174370.06679888, 172607.01194001 174368.70179889, 172605.61394 174369.12679889, 172604.29194001 174364.49979888, 172605.79494001 174364.27579889, 172604.95794001 174361.23079889, 172604.15694 174358.31679888, 172601.38294001 174359.08279889, 172599.73694001 174359.53679889, 172599.03094001 174356.96479888, 172598.45694001 174354.87679889, 172598.31094001 174353.65579888, 172597.92494001 174352.22579889, 172597.51694001 174350.71679889, 172593.94294001 174351.68579889, 172594.45994 174353.59579889, 172594.89194001 174355.18879888, 172594.43694 174355.28679889, 172595.10394001 174357.58879888, 172595.61694 174359.35679889, 172596.36994 174361.95579889, 172596.92694 174363.87679888, 172594.25694 174364.45679888, 172594.21694 174364.31679888, 172593.00494001 174364.65379888, 172592.00394 174364.93279888, 172590.26894 174365.41579889, 172588.36994 174365.94479889, 172586.29894001 174366.52079888, 172585.71094001 174364.28879889, 172585.01994001 174361.66879889, 172584.37794 174359.23179889, 172583.45694001 174355.73579888, 172582.56194 174352.34079888, 172581.81194 174349.49579888, 172578.83494 174350.40579889, 172579.40794 174352.63579888, 172579.78994 174354.11679888, 172580.28794001 174356.05279889, 172580.77094 174357.92779888, 172581.47694 174360.66679888, 172581.97094 174362.58679888, 172582.24294 174363.61779889, 172582.54194001 174364.74379888, 172582.91294001 174366.13879888, 172583.24094001 174367.37179888, 172583.56894 174368.60379888, 172583.98394 174370.16379889, 172584.46094001 174371.95479888, 172584.86494001 174373.47379888, 172585.18994 174374.69679889, 172581.69994001 174375.73579888, 172581.45894 174374.65479888, 172581.93994 174374.65479888, 172582.48094 174373.39279888, 172580.61794 174366.54279888, 172576.54694 174367.44579888, 172576.96094001 174368.82979888, 172577.49594 174370.61579889, 172578.20294001 174372.70579888, 172578.57394 174374.21879889, 172578.69794 174374.72879888, 172578.94194001 174375.71979888, 172579.21594 174376.83779888, 172579.48694001 174377.94179888, 172579.78194 174379.14479889, 172580.08194001 174380.37079888, 172580.58694 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888, 172576.23194 174376.15679888, 172575.20994 174372.55179889, 172573.66494 174372.83079889, 172574.33394 174375.25079888, 172574.79994001 174376.93479888, 172574.46694 174377.10679889, 172573.55494 174377.38579888, 172571.95794001 174377.87279889, 172569.12694001 174378.73679888, 172570.29694 174382.59679888, 172569.06894 174382.95779889, 172567.62494 174383.37779888, 172566.17594 174383.79879889, 172564.97094 174384.14879888, 172563.53494001 174384.56479888, 172562.23594001 174384.94279889, 172561.03494001 174385.29079889, 172559.35194 174385.66979888, 172558.39794001 174385.88479888, 172556.63694001 174386.28179888, 172554.56194 174386.74879888, 172554.93394 174388.02679888, 172555.33194001 174389.39779888, 172555.78394001 174390.95079888, 172556.25094001 174392.55979888, 172556.78094001 174394.38279888, 172557.38394001 174396.45779889, 172555.12994001 174410.66979888, 172554.04194001 174412.21079889, 172554.18094001 174413.74279889, 172554.35894 174415.69279889, 172554.59094 174418.23979888, 172554.80294001 174420.57479888, 172555.02794001 174423.04279888, 172555.93294 174422.97279889, 172557.54494001 174422.84879889, 172560.00094001 174422.89679889, 172562.04294 174422.83779889, 172563.99094001 174422.77979888, 172565.29094 174422.74079889, 172567.21594 174422.68179889, 172569.10194 174422.62379888, 172568.98294001 174421.27879888, 172568.88094001 174420.13579889, 172568.73194 174418.45579889, 172568.45294001 174415.31879888, 172570.64394 174415.21279889, 172570.64394001 174420.55979889, 172572.08594001 174420.43979888, 172572.08594001 174421.46179888, 172572.89894001 174421.52179889, 172572.93594001 174418.69679889, 172572.92794001 174415.53279888, 172575.20994 174415.51279889, 172575.27294001 174421.23079888, 172577.66994001 174421.37079888, 172577.71794001 174420.68179889, 172577.72494001 174418.93679889, 172577.73594001 174415.93279888, 172580.01694001 174415.87379888, 172579.83694 174420.49979889, 172581.27894 174420.49979889, 172581.16094 174421.60179888, 172582.17694 174421.66979888, 172582.13594 174422.43279888, 172582.06294 174423.81779889, 172581.85494001 174425.10579888, 172581.54394 174425.96979888, 172582.27094 174425.90879888, 172583.34994001 174425.81679888, 172584.44594001 174425.72479888, 172585.57394 174425.43879889, 172587.27294001 174425.00679888, 172589.82794001 174424.35879889, 172589.40294001 174423.53179888, 172589.03494001 174422.06079888, 172588.59694001 174420.30879889, 172588.35594 174419.34679888, 172587.97694 174417.82879889, 172587.78294 174417.05679889, 172587.61594001 174415.77979888, 172587.36494001 174414.35979888, 172587.75394 174413.42079888, 172587.86994 174411.44879889, 172592.26794 174410.32279888, 172592.57794001 174412.11779889, 172593.54694 174411.85679889, 172593.88294001 174413.17479889, 172596.71694 174412.45279888, 172597.50594001 174415.42779888, 172593.94094 174416.36279888, 172594.31794001 174417.67579888, 172595.57994 174417.37579888, 172595.88594 174418.96979888, 172599.56994 174418.29279888, 172600.39494001 174421.68079888, 172599.12494 174422.00279888, 172597.83994001 174422.32779888, 172595.25594001 174422.98279888, 172595.67794001 174424.90679888, 172598.81094001 174424.21879889, 172599.32294 174426.26379888, 172599.83994001 174428.32779888, 172600.28294 174430.09379889, 172599.53294 174430.30379888, 172598.94794 174431.12079888, 172598.50794001 174431.73679888, 172598.17194 174432.53079888, 172597.70394001 174433.63779889, 172598.26694001 174435.35479889, 172601.68394 174434.46579888, 172602.63794001 174437.85679889, 172603.52094 174441.33179888, 172604.18794 174443.95879889, 172607.05394 174443.20479888, 172608.01694001 174447.05779888, 172602.61494001 174448.18279888, 172603.57694 174451.96779888, 172591.37294001 174454.98979888, 172593.09694001 174460.86279888, 172596.00694 174460.12279889, 172599.45294001 174459.24579888, 172605.06394001 174457.81879888, 172608.39694 174456.97079889, 172613.56094001 174455.65679888, 172614.32594 174458.77479888, 172609.11894001 174459.86879888, 172606.47194001 174460.59979888, 172604.45794001 174461.15679888, 172605.34094 174464.77179889, 172607.57394 174464.20979889, 172609.99094001 174463.60579889, 172613.07994 174462.83479889, 172613.61894001 174464.88379889, 172614.04994001 174466.51979889, 172614.37794 174467.76679889, 172612.53894001 174468.36579889, 172611.16394001 174468.81479888, 172608.52994 174469.67379888, 172609.11194001 174471.76679889, 172609.56494 174473.39879889, 172612.91294001 174485.56179888, 172614.59894 174485.11079888, 172617.38894 174484.36379889, 172622.33194001 174483.04179888, 172625.99594 174482.06079889, 172629.84294001 174481.03179888, 172641.95194 174477.65279889, 172643.75494001 174477.16979888, 172645.38894 174476.73279888, 172647.53094001 174476.15979889, 172649.87894 174475.53179888, 172652.14894001 174474.92479889, 172655.08794 174474.13879889, 172656.82294 174473.67479889, 172659.20494 174473.03779889, 172661.12994001 174472.52279888, 172663.13094001 174471.98779888, 172666.07294 174471.20079888, 172669.09894 174470.39179889, 172670.32794001 174470.07579888, 172672.24694001 174469.58179889, 172673.91894 174469.15179888, 172674.58694 174468.84879889, 172675.52994 174468.59879889, 172677.88094001 174467.97779889, 172680.51794 174467.28079889, 172683.39194001 174466.52079888, 172686.88994 174465.59579889, 172690.08694 174464.75079888, 172693.60394001 174463.82179889, 172694.71594 174465.90079889, 172695.81494 174467.95779889, 172696.76694001 174469.73679889, 172698.74294 174473.43379889, 172700.00894001 174475.80279888, 172701.21194 174478.05279888, 172702.29394 174480.07679889, 172712.67294 174477.65879888, 172714.31294 174477.23479888, 172715.92294 174476.81879889, 172718.15094 174476.24279889, 172719.85594 174475.80279888, 172719.07394 174472.68079888, 172722.78994 174471.85879889, 172723.62094 174471.64979888, 172726.34994001 174470.96079888, 172727.68494001 174470.62379888, 172728.34494 174470.45779889, 172728.94594001 174470.31079889, 172729.36494001 174470.20779889, 172733.29694 174468.74879888, 172732.51594001 174463.94179888, 172736.18094001 174462.86079888, 172736.12094 174460.75779888, 172739.38594 174460.04779889, 172751.74194 174457.62979889, 172752.52594 174459.31079889, 172753.47194001 174461.34079888, 172754.32394 174463.17079889, 172755.22994001 174465.11479888, 172756.45494 174467.74379888, 172757.91194 174470.86979889, 172759.17194 174473.57379889, 172760.30194 174475.99779889, 172767.25694 174472.63279888)))') - polygon_b = from_wkt('MULTIPOLYGON(((172557.3838523062 174396.45835165278, 172555.12905084348 174410.6693711578, 172554.04105084387 174412.2103631608, 172554.28937084228 174414.93676316369, 172555.0277388468 174423.0425551683, 172563.7369228527 174422.37100316587, 172569.0432908535 174421.9618511684, 172568.4963957805 174415.81728130922, 172568.4972705121 174415.81723898993, 172568.45294000994 174415.31879887995, 172570.64394 174415.21279888996, 172570.64394001 174420.55979889, 172572.08594000997 174420.43979888, 172572.08594000997 174420.94152719184, 172572.77495595193 174420.8841888285, 172572.71193637606 174416.03471118974, 172572.929204253 174416.03280700246, 172572.92794000998 174415.53279887998, 172575.20994000003 174415.51279889, 172575.27294001004 174421.23079888, 172577.6697196799 174421.37078601134, 172577.70199362023 174416.43384416474, 172577.73410833202 174416.4330134905, 172577.7358131635 174415.9674395041, 172577.73594001 174415.93279888004, 172578.87644000998 174415.90329888, 172580.01694000998 174415.87379888, 172579.83694 174420.49979889003, 172581.27894 174420.49979889003, 172581.22540097954 174420.99979889003, 172582.22334147422 174420.99979889003, 172582.17621886 174421.66917916582, 172582.0176908598 174424.652603168, 172581.5430028588 174425.96959516776, 172581.36988285926 174426.44985117015, 172583.22229886055 174426.393211171, 172584.53372231862 174426.04524331444, 172585.60137086362 174425.76191516966, 172589.6888588667 174424.67730716988, 172588.59657086435 174420.30905116722, 172587.97628287587 174417.82828320874, 172587.62773886323 174416.44255516306, 172587.57641086724 174416.43890716136, 172587.6150668636 174415.78034716102, 172587.75349886715 174413.420987159, 172587.86921086907 174411.4484431595, 172591.77150026744 174410.4497097941, 172592.26794067942 174410.3228028141, 172592.57794001006 174412.11779889002, 172593.54694000003 174411.85679889002, 172593.88294001002 174413.17479889, 172596.71693999998 174412.45279888005, 172597.50594000999 174415.42779887991, 172597.172895412 174415.51514718245, 172597.022295644 174415.5546452982, 172597.0224054087 174415.55505917643, 172593.93199883454 174416.33165895962, 172593.94094 174416.36279887997, 172594.31794001002 174417.67579888002, 172595.57994 174417.37579888004, 172595.88594000004 174418.96979887996, 172599.56993999996 174418.29279888, 172600.39494000998 174421.68079888003, 172599.91025387176 174421.80368780546, 172599.94715650496 174421.95523461731, 172596.69628287107 174422.8178511672, 172595.3009759594 174423.18812865848, 172595.67794001 174424.90679888, 172598.81094000905 174424.2187988902, 172598.92996166085 174424.6941881079, 172599.32293973575 174426.26379782447, 172599.32319430308 174426.26481412462, 172599.83993917855 174428.32779556068, 172600.28294000003 174430.09379889, 172599.53294 174430.30379888, 172598.9479399949 174431.12079888713, 172598.50794000993 174431.73679888, 172598.17194137024 174432.53079564194, 172597.70394001 174433.63779889003, 172598.2660748735 174435.35474717614, 172601.1998381591 174434.5913030442, 172601.19995467947 174434.5917172166, 172601.68394000002 174434.46579888, 172602.63794000942 174437.85679888783, 172603.5209395613 174441.3317971537, 172603.67147661696 174441.92469197488, 172604.18799165756 174443.95900234475, 172607.0539523896 174443.2048484512, 172608.01694001004 174447.05779888, 172602.61494001004 174448.18279888007, 172603.57694000003 174451.96779887998, 172591.37294001 174454.98979887998, 172593.09693550566 174460.86278353556, 172605.0632588789 174457.8183631897, 172608.39689087868 174456.97023519131, 172613.0762718963 174455.77972994547, 172613.07636302974 174455.78010138884, 172613.56094001004 174455.65679887997, 172614.32594000004 174458.77479888004, 172609.11894000994 174459.86879888005, 172606.47194360537 174460.59979788712, 172604.45794001 174461.15679888, 172605.3409823247 174464.7719721671, 172612.59480380098 174462.95596724018, 172612.7014123517 174462.92927763195, 172613.07994000003 174462.83479889008, 172613.61893907966 174464.88379535347, 172613.6189968665 174464.88401470726, 172614.04993903125 174466.51979517483, 172614.37794 174467.76679889, 172612.53894704106 174468.36579659986, 172612.53852629993 174468.36593398513, 172611.16394366286 174468.81479768714, 172608.52993999998 174469.67379888, 172609.11193880375 174471.76679455204, 172609.11197085044 174471.76690999718, 172609.56229931235 174473.38928541902, 172609.5649399964 174473.3987988771, 172612.91284623384 174485.5614581992, 172616.49161088464 174484.6038992107, 172617.37810321042 174484.36670035287, 172617.3781038362 174484.3667001854, 172617.40430078932 174484.35969066346, 172621.91801405355 174483.1519558644, 172625.84397284017 174482.10148660126, 172626.28639576584 174481.983107446, 172629.84245889643 174481.0316112079, 172629.84260632202 174481.0318919951, 172641.95148947238 174477.65292460908, 172641.9513229055 174477.65228320664, 172643.55453783524 174477.22348398916, 172649.45557890835 174475.6451792046, 172652.118800357 174474.93285825956, 172655.08757891503 174474.13881120458, 172669.09820291854 174470.39141919912, 172673.91823492196 174469.15141920003, 172674.05039449205 174469.04677954124, 172674.1582349241 174468.9614031985, 172675.5150722086 174468.60274051016, 172675.58914901028 174468.58315924928, 172676.93838271403 174468.22650647085, 172685.4841995281 174465.9675284286, 172690.08649093658 174464.75097119805, 172690.35773174433 174464.679270439, 172693.6036109403 174463.82124319673, 172695.45967493954 174467.2931151986, 172695.69615282057 174467.73546474247, 172695.8858936043 174468.09038905406, 172702.29378802062 174480.0768342967, 172712.67227422315 174477.65895398633, 172712.67215495606 174477.6584912053, 172719.8562189564 174475.80549920353, 172719.13622944942 174473.1791069913, 172719.19547385076 174473.1660017983, 172719.07393999997 174472.68079888003, 172722.78994000095 174471.8587988898, 172723.6209313099 174471.64980106562, 172723.62116079254 174471.6497431358, 172726.34993987996 174470.9607989128, 172727.68514120538 174470.623748284, 172728.34493999486 174470.45779889126, 172728.94593998056 174470.3107988972, 172729.36494001048 174470.20779888984, 172733.29694 174468.74879888006, 172732.51594000997 174463.94179888, 172736.18094000997 174462.86079888, 172736.12094 174460.75779888, 172739.38593999937 174460.04779889015, 172751.74194 174457.62979889003, 172751.82374942137 174457.8052091417, 172760.30108298364 174475.9976912029, 172767.25628262636 174472.6322513803, 172767.5851149932 174472.47314720228, 172767.50690699372 174472.13401120156, 172767.1188087445 174472.3620791199, 172766.30993999983 174470.7767988602, 172765.64794001004 174469.48679887998, 172766.51694001004 174469.12679887997, 172765.12794 174466.03679888998, 172764.34694001 174466.34679888003, 172762.84694005293 174463.15679897126, 172763.29320167168 174462.94189765144, 172764.2839314731 174462.46480300103, 172765.32593999998 174461.96179887993, 172761.1385378274 174453.29491927216, 172761.13853782744 174453.29491927216, 172760.09694000988 174451.01679888976, 172759.79494001003 174450.12279889, 172760.93594000998 174449.76179888003, 172761.82593999995 174450.27579889004, 172762.67400122888 174449.91177263303, 172765.15694 174448.84679888003, 172764.19994000997 174445.99879888, 172764.60994001062 174445.80279888492, 172764.33894001 174444.31479887993, 172763.51689098784 174441.74149918192, 172763.5168882326 174441.74150007046, 172763.51688823258 174441.74150007026, 172763.21993999998 174440.02779889002, 172761.17694 174440.68879888, 172759.74790522835 174436.7047019099, 172755.11890209024 174438.21366147915, 172754.95691696025 174437.6267152474, 172754.85751089564 174437.26601325686, 172754.6069400003 174436.3567988909, 172755.10336595034 174436.22560282986, 172756.19993908802 174435.93579913364, 172758.35593845724 174435.36579929787, 172760.84694000997 174434.70679888004, 172760.58894161868 174433.5358061814, 172760.14693999995 174431.53679888978, 172759.5329400001 174429.6077988801, 172759.52534339868 174429.53306474834, 172759.48582006822 174429.1442406328, 172759.76815493542 174429.05234718855, 172759.7528128644 174429.0162936086, 172759.12745483534 174427.54860076858, 172759.12745462733 174427.54860004058, 172759.1267469823 174427.54693917185, 172759.12695293076 174427.54684410253, 172758.76693612643 174426.28678529424, 172758.12194001 174424.02879888, 172758.32293999995 174423.95879888002, 172758.05193999998 174421.82179889004, 172756.6439400104 174422.12379887994, 172756.53950232168 174422.15535105282, 172755.98194000003 174422.32379888996, 172755.12451175836 174419.47773878835, 172753.83321806323 174419.78523359896, 172752.4939518636 174414.58684488994, 172751.20706697553 174414.83333916217, 172750.73129098117 174412.7877071612, 172748.95247497407 174413.2481231615, 172748.47247497732 174411.39813916016, 172753.23247498277 174410.11813915893, 172751.57647497955 174404.02937115356, 172750.80501897636 174401.19289115068, 172749.21920579113 174395.36230315745, 172749.2194832201 174395.36220860117, 172749.08793999997 174394.87879889001, 172750.24394001003 174394.48479888003, 172751.79493705663 174393.68580041145, 172753.32194001004 174392.89979888, 172754.02694001 174394.06179887996, 172759.86194000999 174390.84279887998, 172760.84694001003 174392.75779887996, 172762.75293454644 174391.80780159816, 172762.7540957816 174391.80722369105, 172764.6779369368 174390.84980040943, 172767.0349380484 174389.675799857, 172769.10393896094 174388.64579940226, 172770.8269400001 174387.78779888, 172772.41231297184 174387.0021096416, 172769.92245898946 174381.99321113512, 172769.86473163788 174381.87794843127, 172766.27740298968 174374.71225113448, 172766.12751504182 174374.37625125528, 172765.45154720507 174372.86111561494, 172764.5623949914 174370.86834713045, 172758.44661898166 174358.71346712485, 172758.08089647835 174357.9866221479, 172758.0812897689 174357.9865175769, 172757.8519399999 174357.5307988898, 172754.4110373197 174349.3873883099, 172754.41083817216 174349.3874620819, 172754.04609390008 174348.52429801252, 172753.7164504677 174347.74419976756, 172753.71289365587 174347.7351269625, 172752.91599497944 174345.84914711493, 172752.96828298277 174345.83532311398, 172752.74697099614 174345.2712271516, 172750.88521097507 174340.5253711095, 172749.90261897308 174337.94073110458, 172742.68309897187 174319.57548309487, 172729.2444429621 174323.76869909838, 172729.1040909663 174323.3482191004, 172719.76546695834 174325.91705109927, 172721.48245895657 174332.9833551049, 172723.08294328308 174339.57013976108, 172723.03791828503 174339.58436050604, 172723.15793999998 174340.07079887998, 172719.07994 174341.35879888994, 172719.0331842302 174340.8492201192, 172718.5874979483 174340.98998616525, 172718.5534989536 174340.6227151118, 172714.9709069505 174341.62623511252, 172702.72073094547 174345.05746711424, 172703.20898694542 174346.73209111392, 172703.9096589461 174349.13503511623, 172695.26953093708 174351.39500311756, 172694.93771905327 174349.74538306356, 172692.57990415473 174350.34580801197, 172692.57334559556 174350.34747709305, 172689.68390132912 174351.0828087242, 172689.6768192437 174351.08460978328, 172686.95894150986 174351.77579850602, 172684.89594078047 174352.3007986814, 172684.8828689878 174352.30412604674, 172683.3009262921 174352.70680236846, 172681.18281584515 174353.24583040207, 172679.3319479569 174353.71579686215, 172677.40094000465 174354.20779888882, 172677.27266865686 174353.73419735025, 172676.77394073328 174351.89280155062, 172676.06193873903 174349.26679423897, 172675.7409324217 174348.08277088706, 172675.25994054292 174346.30780088357, 172675.2596599193 174346.30676614863, 172674.46692653303 174343.38374918967, 172673.58194064876 174340.11780124725, 172672.77094000002 174337.12779888004, 172670.9499049531 174337.60880813404, 172670.52563620973 174337.72080595847, 172669.09919766168 174338.09735505903, 172669.08994002102 174338.09979887708, 172668.25594001057 174338.3197988899, 172663.54094 174339.43779888, 172663.9509396747 174340.9917976469, 172663.95246609734 174340.9975798821, 172664.37093995474 174342.5827987186, 172664.9449393093 174344.75679626403, 172665.47293987044 174346.75879839866, 172665.473080069 174346.7593299183, 172666.08593904617 174349.08279523588, 172666.0860074876 174349.08305431984, 172666.77093856825 174351.67579347026, 172667.44093999997 174354.21779888, 172665.21794001 174354.76179888, 172665.0101183685 174354.8126524625, 172663.37894000002 174355.21179888002, 172663.37873282918 174355.21184957805, 172661.5809427116 174355.65179822646, 172659.15894248072 174356.2437982761, 172656.24094000997 174356.95779889004, 172655.8289405051 174354.98780124754, 172655.30694000996 174352.49479888997, 172654.75393999997 174349.85379887992, 172653.44093999994 174347.26779887994, 172650.79094000012 174346.37779887998, 172649.39294039877 174346.74579877505, 172649.3911846923 174346.7462610297, 172648.1699417751 174347.06779842527, 172643.14494001 174348.38979889, 172642.93389291374 174348.44532466854, 172640.56794000996 174349.06779889, 172640.41789637046 174349.10727144754, 172638.06294 174349.72679888003, 172635.8089427633 174350.319798163, 172634.01694338908 174350.79179799, 172631.56094000998 174351.43779888997, 172631.68094001 174351.69779888, 172630.46894738195 174352.0517967368, 172630.4687520214 174352.05185395735, 172629.2809437475 174352.39979778518, 172627.68094000997 174352.86779889, 172628.10093847304 174354.1197943085, 172628.10107294662 174354.1201945294, 172628.6879379874 174355.86679290008, 172628.68799114702 174355.86695143604, 172629.43093933648 174358.08279688127, 172629.43133035954 174358.0839622848, 172630.24693959064 174360.5147976402, 172630.24792235918 174360.51772822303, 172630.85693939638 174362.3337970801, 172631.76094 174365.02779888996, 172632.43094001003 174364.86779888996, 172632.93494001002 174366.67479888993, 172630.87694000924 174367.2867988902, 172629.35094510994 174367.69579751312, 172629.35049890392 174367.69591735688, 172627.54894514213 174368.17979751158, 172627.52128803954 174368.18721035263, 172625.4409402792 174368.7447988152, 172625.43971959242 174368.74512604062, 172623.82194391786 174369.17879783243, 172621.82194405483 174369.715797794, 172621.82183787943 174369.71582625585, 172620.13194178292 174370.16879840213, 172618.52894290345 174370.59879811114, 172616.85694000009 174371.04679887995, 172613.67694 174372.43679888, 172612.2709414281 174372.87179843814, 172610.70894325845 174373.35479788246, 172608.85694 174373.92679889, 172608.25794049533 174371.89080052968, 172607.82694000003 174370.42679889002, 172607.51030628625 174370.515852122, 172607.38694001004 174370.06679887997, 172607.01194001 174368.70179888996, 172605.61394000004 174369.12679888998, 172604.29194001 174364.49979887996, 172605.79494001003 174364.27579888995, 172604.95794001003 174361.23079889003, 172604.15693999996 174358.31679887997, 172601.3829428521 174359.08279810517, 172600.24729543962 174359.3960325686, 172597.84457264078 174350.6279695617, 172597.51694001004 174350.71679888997, 172593.94294000993 174351.68579889, 172594.4599387648 174353.5957943269, 172594.89194001 174355.18879888, 172594.43694 174355.28679888998, 172595.10393895835 174357.58879525043, 172595.61693890326 174359.35679511022, 172596.36993943545 174361.95579694142, 172596.92693999998 174363.87679887997, 172594.25694 174364.45679887995, 172594.21693999998 174364.31679888006, 172593.00494592657 174364.6537972349, 172593.00452690053 174364.65391402238, 172592.00394302807 174364.932798036, 172590.26894162453 174365.41579843775, 172588.36994388918 174365.94479780665, 172588.36984125132 174365.94482635465, 172586.29894001002 174366.52079888002, 172585.7109407086 174364.2888015419, 172585.71082483808 174364.2883622034, 172585.01994076036 174361.66880173524, 172584.8667329185 174361.0872324162, 172584.37794 174359.23179888996, 172583.4569404406 174355.73580051467, 172582.56193999999 174352.34079887997, 172581.81194 174349.49579887997, 172578.96056568567 174350.36739802494, 172585.1382444169 174374.19050227254, 172585.0614705477 174374.21335843968, 172585.18994 174374.69679888996, 172581.69994000997 174375.73579888, 172581.62350512363 174375.3929519558, 172581.93994000004 174374.65479888, 172582.48094 174373.39279888003, 172580.61794 174366.54279888, 172576.77667659082 174367.3948403584, 172578.3008907684 174373.35775476237, 172578.52405885607 174374.23071513322, 172580.47195049844 174381.85118837637, 172580.4625612569 174381.85333750857, 172580.58694000004 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888003, 172576.23194 174376.15679888002, 172575.20993999997 174372.55179889, 172573.66458694366 174372.8308626458, 172574.0934668556 174374.3819471337, 172574.33365876754 174375.25074680167, 172574.7994377378 174376.93505831185, 172574.46694027368 174377.10679874866, 172573.55473542705 174377.38586125555, 172571.95794220705 174377.87279822002, 172569.12694000997 174378.73679888004, 172570.29693999997 174382.59679888, 172569.06894000657 174382.95779888806, 172568.98899089158 174382.9810527852, 172567.62494267538 174383.37779810186, 172566.1759413303 174383.7987985035, 172564.9709467131 174384.14879693012, 172563.53494001646 174384.5647988781, 172562.23594001002 174384.94279888997, 172561.03905731053 174385.28960586703, 172554.56188284606 174386.74853914225, 172555.21404284242 174388.99244314435, 172557.3838523062 174396.45835165278)),((172739.38594000007 174460.04779889, 172739.39373637483 174460.04610350684, 172739.392673916 174460.04121769255, 172739.3870486459 174460.03837656736, 172739.38261013498 174460.0403655549, 172739.3807950899 174460.03631378766, 172739.37623201194 174460.03835788142, 172739.37262919155 174460.04530889943, 172739.37358944913 174460.05021582366, 172739.3858038434 174460.04782553512, 172739.3859399994 174460.04779889015, 172739.38594000007 174460.04779889)))') - result = safe_intersection(polygon_a, polygon_b) #GEOS exception is catched + polygon_a = from_wkt( + "MULTIPOLYGON(((172767.25694 174472.63279888, 172766.30994001 174470.77679888, 172765.64794001 174469.48679888, 172766.51694001 174469.12679888, 172765.12794 174466.03679889, 172764.34694001 174466.34679888, 172762.84694001 174463.15679888, 172764.28394001 174462.46479889, 172765.32594 174461.96179888, 172761.13894 174453.29579888, 172760.09694001 174451.01679889, 172759.79494001 174450.12279889, 172760.93594001 174449.76179888, 172761.82594 174450.27579889, 172762.67394001 174449.91179889, 172765.15694 174448.84679888, 172764.19994001 174445.99879888, 172764.60994 174445.80279889, 172764.33894001 174444.31479888, 172763.51694001 174441.74179888, 172763.21994 174440.02779889, 172761.17694 174440.68879888, 172759.74794001 174436.70479888, 172759.02694001 174436.93979888, 172756.96694 174437.61179889, 172755.11894001 174438.21379888, 172754.95694001 174437.62679889, 172754.60694 174436.35679889, 172756.19994001 174435.93579889, 172758.35594 174435.36579889, 172760.84694001 174434.70679888, 172760.58894001 174433.53579888, 172760.14694 174431.53679889, 172759.53294 174429.60779888, 172759.38494 174428.15179888, 172759.12694001 174427.54679888, 172758.76694001 174426.28679889, 172758.12194001 174424.02879888, 172758.32294 174423.95879888, 172758.05194 174421.82179889, 172756.64394001 174422.12379888, 172755.98194 174422.32379889, 172755.12694001 174419.48579888, 172753.83594001 174419.79579889, 172752.49394001 174414.58679888, 172751.20794001 174414.83379888, 172750.65294001 174412.80779888, 172748.95294001 174413.24779889, 172748.47294 174411.39879889, 172753.23294001 174410.11879888, 172752.77094 174408.42079889, 172752.20594 174406.34079888, 172751.57694 174404.02979888, 172750.94994001 174401.72379889, 172750.44494 174399.86779889, 172749.65394 174396.95879888, 172749.08794 174394.87879889, 172750.24394001 174394.48479888, 172751.79494001 174393.68579889, 172753.32194001 174392.89979888, 172754.02694001 174394.06179888, 172759.86194001 174390.84279888, 172760.84694001 174392.75779888, 172762.75294 174391.80779888, 172764.67794001 174390.84979888, 172767.03494001 174389.67579888, 172769.10394001 174388.64579888, 172770.82694 174387.78779888, 172772.41294001 174387.00179889, 172771.70694001 174385.58179888, 172770.47494001 174383.10379888, 172769.86494001 174381.87779888, 172769.31094001 174380.77179889, 172768.51694001 174379.18579889, 172767.43494001 174377.02279888, 172766.27794001 174374.71279889, 172765.78994 174373.61879888, 172765.24294 174372.39279888, 172764.56294 174370.86879888, 172763.48394 174368.72379889, 172762.58994001 174366.94779889, 172761.36994 174364.52279888, 172760.27094 174362.33879888, 172759.15994001 174360.12979888, 172757.85194 174357.53079889, 172752.91594 174345.84979888, 172752.44494 174344.50079888, 172751.68294 174342.55779888, 172750.88594 174340.52579889, 172749.87694001 174337.94779888, 172748.82694 174335.20279888, 172747.72094 174332.38879888, 172746.51294001 174329.31579889, 172745.36494001 174326.39779888, 172743.82194001 174322.47179888, 172742.68394 174319.57579888, 172739.86294 174320.46079888, 172737.67194 174320.96779888, 172736.12194001 174321.39879889, 172733.90294001 174322.01479889, 172731.21594 174322.76179888, 172729.70094 174323.15779889, 172729.10494001 174323.34879888, 172727.50294 174323.86079888, 172724.60494001 174324.78679888, 172719.82894001 174326.31279889, 172720.17794001 174327.77779889, 172720.41094 174328.75779888, 172720.82494001 174330.49979889, 172721.08494 174331.56079889, 172721.42594 174332.98579888, 172721.70594 174334.18179888, 172722.03394001 174335.51479889, 172722.60994 174337.84979888, 172723.15794 174340.07079888, 172719.07994 174341.35879889, 172719.00094001 174340.49779889, 172718.62994001 174340.60179888, 172717.50294 174340.91679888, 172714.97094 174341.62679888, 172714.17294 174341.84979888, 172712.47094 174342.32679888, 172710.41394001 174342.90279889, 172708.33894001 174343.48379889, 172705.43894001 174344.29679888, 172702.72094 174345.05779888, 172703.36294 174347.25779888, 172703.90994001 174349.13479888, 172702.14294 174349.59779889, 172700.29694 174350.08079888, 172697.39194001 174350.83979889, 172695.26994001 174351.39479888, 172694.94394 174349.74379888, 172692.57994 174350.34579889, 172689.68394 174351.08279889, 172686.95894 174351.77579889, 172684.89594 174352.30079888, 172683.30094 174352.70679888, 172681.18294 174353.24579888, 172679.33194001 174353.71579888, 172677.40094 174354.20779889, 172676.77394001 174351.89279888, 172676.06194 174349.26679889, 172675.74094001 174348.08279889, 172675.25994 174346.30779888, 172674.46694 174343.38379889, 172673.58194001 174340.11779889, 172672.77094 174337.12779888, 172670.94994001 174337.60879888, 172669.08994001 174338.09979888, 172668.25594001 174338.31979889, 172663.54094 174339.43779888, 172663.95094 174340.99179888, 172664.37094 174342.58279889, 172664.94494 174344.75679888, 172665.47294 174346.75879889, 172666.08594001 174349.08279889, 172666.77094 174351.67579889, 172667.44094 174354.21779888, 172665.21794001 174354.76179888, 172663.37894 174355.21179888, 172661.58094 174355.65179889, 172659.15894001 174356.24379888, 172656.24094001 174356.95779889, 172655.82894001 174354.98779888, 172655.30694001 174352.49479889, 172654.75394 174349.85379888, 172653.44094 174347.26779888, 172650.79094 174346.37779888, 172649.39294 174346.74579888, 172648.16994001 174347.06779889, 172643.14494001 174348.38979889, 172640.56794001 174349.06779889, 172638.06294 174349.72679888, 172635.80894 174350.31979889, 172634.01694001 174350.79179888, 172631.56094001 174351.43779889, 172631.68094001 174351.69779888, 172630.46894001 174352.05179889, 172629.28094001 174352.39979888, 172627.68094001 174352.86779889, 172628.10094001 174354.11979889, 172628.68794 174355.86679889, 172629.43094001 174358.08279889, 172630.24694001 174360.51479889, 172630.85694 174362.33379888, 172631.76094 174365.02779889, 172632.43094001 174364.86779889, 172632.93494001 174366.67479889, 172630.87694001 174367.28679889, 172629.35094001 174367.69579888, 172627.54894001 174368.17979889, 172625.44094 174368.74479889, 172623.82194001 174369.17879888, 172621.82194001 174369.71579888, 172620.13194 174370.16879888, 172618.52894 174370.59879889, 172616.85694 174371.04679888, 172613.67694 174372.43679888, 172612.27094 174372.87179888, 172610.70894 174373.35479889, 172608.85694 174373.92679889, 172608.25794001 174371.89079888, 172607.82694 174370.42679889, 172607.50694 174370.51679889, 172607.38694001 174370.06679888, 172607.01194001 174368.70179889, 172605.61394 174369.12679889, 172604.29194001 174364.49979888, 172605.79494001 174364.27579889, 172604.95794001 174361.23079889, 172604.15694 174358.31679888, 172601.38294001 174359.08279889, 172599.73694001 174359.53679889, 172599.03094001 174356.96479888, 172598.45694001 174354.87679889, 172598.31094001 174353.65579888, 172597.92494001 174352.22579889, 172597.51694001 174350.71679889, 172593.94294001 174351.68579889, 172594.45994 174353.59579889, 172594.89194001 174355.18879888, 172594.43694 174355.28679889, 172595.10394001 174357.58879888, 172595.61694 174359.35679889, 172596.36994 174361.95579889, 172596.92694 174363.87679888, 172594.25694 174364.45679888, 172594.21694 174364.31679888, 172593.00494001 174364.65379888, 172592.00394 174364.93279888, 172590.26894 174365.41579889, 172588.36994 174365.94479889, 172586.29894001 174366.52079888, 172585.71094001 174364.28879889, 172585.01994001 174361.66879889, 172584.37794 174359.23179889, 172583.45694001 174355.73579888, 172582.56194 174352.34079888, 172581.81194 174349.49579888, 172578.83494 174350.40579889, 172579.40794 174352.63579888, 172579.78994 174354.11679888, 172580.28794001 174356.05279889, 172580.77094 174357.92779888, 172581.47694 174360.66679888, 172581.97094 174362.58679888, 172582.24294 174363.61779889, 172582.54194001 174364.74379888, 172582.91294001 174366.13879888, 172583.24094001 174367.37179888, 172583.56894 174368.60379888, 172583.98394 174370.16379889, 172584.46094001 174371.95479888, 172584.86494001 174373.47379888, 172585.18994 174374.69679889, 172581.69994001 174375.73579888, 172581.45894 174374.65479888, 172581.93994 174374.65479888, 172582.48094 174373.39279888, 172580.61794 174366.54279888, 172576.54694 174367.44579888, 172576.96094001 174368.82979888, 172577.49594 174370.61579889, 172578.20294001 174372.70579888, 172578.57394 174374.21879889, 172578.69794 174374.72879888, 172578.94194001 174375.71979888, 172579.21594 174376.83779888, 172579.48694001 174377.94179888, 172579.78194 174379.14479889, 172580.08194001 174380.37079888, 172580.58694 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888, 172576.23194 174376.15679888, 172575.20994 174372.55179889, 172573.66494 174372.83079889, 172574.33394 174375.25079888, 172574.79994001 174376.93479888, 172574.46694 174377.10679889, 172573.55494 174377.38579888, 172571.95794001 174377.87279889, 172569.12694001 174378.73679888, 172570.29694 174382.59679888, 172569.06894 174382.95779889, 172567.62494 174383.37779888, 172566.17594 174383.79879889, 172564.97094 174384.14879888, 172563.53494001 174384.56479888, 172562.23594001 174384.94279889, 172561.03494001 174385.29079889, 172559.35194 174385.66979888, 172558.39794001 174385.88479888, 172556.63694001 174386.28179888, 172554.56194 174386.74879888, 172554.93394 174388.02679888, 172555.33194001 174389.39779888, 172555.78394001 174390.95079888, 172556.25094001 174392.55979888, 172556.78094001 174394.38279888, 172557.38394001 174396.45779889, 172555.12994001 174410.66979888, 172554.04194001 174412.21079889, 172554.18094001 174413.74279889, 172554.35894 174415.69279889, 172554.59094 174418.23979888, 172554.80294001 174420.57479888, 172555.02794001 174423.04279888, 172555.93294 174422.97279889, 172557.54494001 174422.84879889, 172560.00094001 174422.89679889, 172562.04294 174422.83779889, 172563.99094001 174422.77979888, 172565.29094 174422.74079889, 172567.21594 174422.68179889, 172569.10194 174422.62379888, 172568.98294001 174421.27879888, 172568.88094001 174420.13579889, 172568.73194 174418.45579889, 172568.45294001 174415.31879888, 172570.64394 174415.21279889, 172570.64394001 174420.55979889, 172572.08594001 174420.43979888, 172572.08594001 174421.46179888, 172572.89894001 174421.52179889, 172572.93594001 174418.69679889, 172572.92794001 174415.53279888, 172575.20994 174415.51279889, 172575.27294001 174421.23079888, 172577.66994001 174421.37079888, 172577.71794001 174420.68179889, 172577.72494001 174418.93679889, 172577.73594001 174415.93279888, 172580.01694001 174415.87379888, 172579.83694 174420.49979889, 172581.27894 174420.49979889, 172581.16094 174421.60179888, 172582.17694 174421.66979888, 172582.13594 174422.43279888, 172582.06294 174423.81779889, 172581.85494001 174425.10579888, 172581.54394 174425.96979888, 172582.27094 174425.90879888, 172583.34994001 174425.81679888, 172584.44594001 174425.72479888, 172585.57394 174425.43879889, 172587.27294001 174425.00679888, 172589.82794001 174424.35879889, 172589.40294001 174423.53179888, 172589.03494001 174422.06079888, 172588.59694001 174420.30879889, 172588.35594 174419.34679888, 172587.97694 174417.82879889, 172587.78294 174417.05679889, 172587.61594001 174415.77979888, 172587.36494001 174414.35979888, 172587.75394 174413.42079888, 172587.86994 174411.44879889, 172592.26794 174410.32279888, 172592.57794001 174412.11779889, 172593.54694 174411.85679889, 172593.88294001 174413.17479889, 172596.71694 174412.45279888, 172597.50594001 174415.42779888, 172593.94094 174416.36279888, 172594.31794001 174417.67579888, 172595.57994 174417.37579888, 172595.88594 174418.96979888, 172599.56994 174418.29279888, 172600.39494001 174421.68079888, 172599.12494 174422.00279888, 172597.83994001 174422.32779888, 172595.25594001 174422.98279888, 172595.67794001 174424.90679888, 172598.81094001 174424.21879889, 172599.32294 174426.26379888, 172599.83994001 174428.32779888, 172600.28294 174430.09379889, 172599.53294 174430.30379888, 172598.94794 174431.12079888, 172598.50794001 174431.73679888, 172598.17194 174432.53079888, 172597.70394001 174433.63779889, 172598.26694001 174435.35479889, 172601.68394 174434.46579888, 172602.63794001 174437.85679889, 172603.52094 174441.33179888, 172604.18794 174443.95879889, 172607.05394 174443.20479888, 172608.01694001 174447.05779888, 172602.61494001 174448.18279888, 172603.57694 174451.96779888, 172591.37294001 174454.98979888, 172593.09694001 174460.86279888, 172596.00694 174460.12279889, 172599.45294001 174459.24579888, 172605.06394001 174457.81879888, 172608.39694 174456.97079889, 172613.56094001 174455.65679888, 172614.32594 174458.77479888, 172609.11894001 174459.86879888, 172606.47194001 174460.59979888, 172604.45794001 174461.15679888, 172605.34094 174464.77179889, 172607.57394 174464.20979889, 172609.99094001 174463.60579889, 172613.07994 174462.83479889, 172613.61894001 174464.88379889, 172614.04994001 174466.51979889, 172614.37794 174467.76679889, 172612.53894001 174468.36579889, 172611.16394001 174468.81479888, 172608.52994 174469.67379888, 172609.11194001 174471.76679889, 172609.56494 174473.39879889, 172612.91294001 174485.56179888, 172614.59894 174485.11079888, 172617.38894 174484.36379889, 172622.33194001 174483.04179888, 172625.99594 174482.06079889, 172629.84294001 174481.03179888, 172641.95194 174477.65279889, 172643.75494001 174477.16979888, 172645.38894 174476.73279888, 172647.53094001 174476.15979889, 172649.87894 174475.53179888, 172652.14894001 174474.92479889, 172655.08794 174474.13879889, 172656.82294 174473.67479889, 172659.20494 174473.03779889, 172661.12994001 174472.52279888, 172663.13094001 174471.98779888, 172666.07294 174471.20079888, 172669.09894 174470.39179889, 172670.32794001 174470.07579888, 172672.24694001 174469.58179889, 172673.91894 174469.15179888, 172674.58694 174468.84879889, 172675.52994 174468.59879889, 172677.88094001 174467.97779889, 172680.51794 174467.28079889, 172683.39194001 174466.52079888, 172686.88994 174465.59579889, 172690.08694 174464.75079888, 172693.60394001 174463.82179889, 172694.71594 174465.90079889, 172695.81494 174467.95779889, 172696.76694001 174469.73679889, 172698.74294 174473.43379889, 172700.00894001 174475.80279888, 172701.21194 174478.05279888, 172702.29394 174480.07679889, 172712.67294 174477.65879888, 172714.31294 174477.23479888, 172715.92294 174476.81879889, 172718.15094 174476.24279889, 172719.85594 174475.80279888, 172719.07394 174472.68079888, 172722.78994 174471.85879889, 172723.62094 174471.64979888, 172726.34994001 174470.96079888, 172727.68494001 174470.62379888, 172728.34494 174470.45779889, 172728.94594001 174470.31079889, 172729.36494001 174470.20779889, 172733.29694 174468.74879888, 172732.51594001 174463.94179888, 172736.18094001 174462.86079888, 172736.12094 174460.75779888, 172739.38594 174460.04779889, 172751.74194 174457.62979889, 172752.52594 174459.31079889, 172753.47194001 174461.34079888, 172754.32394 174463.17079889, 172755.22994001 174465.11479888, 172756.45494 174467.74379888, 172757.91194 174470.86979889, 172759.17194 174473.57379889, 172760.30194 174475.99779889, 172767.25694 174472.63279888)))" + ) + polygon_b = from_wkt( + "MULTIPOLYGON(((172557.3838523062 174396.45835165278, 172555.12905084348 174410.6693711578, 172554.04105084387 174412.2103631608, 172554.28937084228 174414.93676316369, 172555.0277388468 174423.0425551683, 172563.7369228527 174422.37100316587, 172569.0432908535 174421.9618511684, 172568.4963957805 174415.81728130922, 172568.4972705121 174415.81723898993, 172568.45294000994 174415.31879887995, 172570.64394 174415.21279888996, 172570.64394001 174420.55979889, 172572.08594000997 174420.43979888, 172572.08594000997 174420.94152719184, 172572.77495595193 174420.8841888285, 172572.71193637606 174416.03471118974, 172572.929204253 174416.03280700246, 172572.92794000998 174415.53279887998, 172575.20994000003 174415.51279889, 172575.27294001004 174421.23079888, 172577.6697196799 174421.37078601134, 172577.70199362023 174416.43384416474, 172577.73410833202 174416.4330134905, 172577.7358131635 174415.9674395041, 172577.73594001 174415.93279888004, 172578.87644000998 174415.90329888, 172580.01694000998 174415.87379888, 172579.83694 174420.49979889003, 172581.27894 174420.49979889003, 172581.22540097954 174420.99979889003, 172582.22334147422 174420.99979889003, 172582.17621886 174421.66917916582, 172582.0176908598 174424.652603168, 172581.5430028588 174425.96959516776, 172581.36988285926 174426.44985117015, 172583.22229886055 174426.393211171, 172584.53372231862 174426.04524331444, 172585.60137086362 174425.76191516966, 172589.6888588667 174424.67730716988, 172588.59657086435 174420.30905116722, 172587.97628287587 174417.82828320874, 172587.62773886323 174416.44255516306, 172587.57641086724 174416.43890716136, 172587.6150668636 174415.78034716102, 172587.75349886715 174413.420987159, 172587.86921086907 174411.4484431595, 172591.77150026744 174410.4497097941, 172592.26794067942 174410.3228028141, 172592.57794001006 174412.11779889002, 172593.54694000003 174411.85679889002, 172593.88294001002 174413.17479889, 172596.71693999998 174412.45279888005, 172597.50594000999 174415.42779887991, 172597.172895412 174415.51514718245, 172597.022295644 174415.5546452982, 172597.0224054087 174415.55505917643, 172593.93199883454 174416.33165895962, 172593.94094 174416.36279887997, 172594.31794001002 174417.67579888002, 172595.57994 174417.37579888004, 172595.88594000004 174418.96979887996, 172599.56993999996 174418.29279888, 172600.39494000998 174421.68079888003, 172599.91025387176 174421.80368780546, 172599.94715650496 174421.95523461731, 172596.69628287107 174422.8178511672, 172595.3009759594 174423.18812865848, 172595.67794001 174424.90679888, 172598.81094000905 174424.2187988902, 172598.92996166085 174424.6941881079, 172599.32293973575 174426.26379782447, 172599.32319430308 174426.26481412462, 172599.83993917855 174428.32779556068, 172600.28294000003 174430.09379889, 172599.53294 174430.30379888, 172598.9479399949 174431.12079888713, 172598.50794000993 174431.73679888, 172598.17194137024 174432.53079564194, 172597.70394001 174433.63779889003, 172598.2660748735 174435.35474717614, 172601.1998381591 174434.5913030442, 172601.19995467947 174434.5917172166, 172601.68394000002 174434.46579888, 172602.63794000942 174437.85679888783, 172603.5209395613 174441.3317971537, 172603.67147661696 174441.92469197488, 172604.18799165756 174443.95900234475, 172607.0539523896 174443.2048484512, 172608.01694001004 174447.05779888, 172602.61494001004 174448.18279888007, 172603.57694000003 174451.96779887998, 172591.37294001 174454.98979887998, 172593.09693550566 174460.86278353556, 172605.0632588789 174457.8183631897, 172608.39689087868 174456.97023519131, 172613.0762718963 174455.77972994547, 172613.07636302974 174455.78010138884, 172613.56094001004 174455.65679887997, 172614.32594000004 174458.77479888004, 172609.11894000994 174459.86879888005, 172606.47194360537 174460.59979788712, 172604.45794001 174461.15679888, 172605.3409823247 174464.7719721671, 172612.59480380098 174462.95596724018, 172612.7014123517 174462.92927763195, 172613.07994000003 174462.83479889008, 172613.61893907966 174464.88379535347, 172613.6189968665 174464.88401470726, 172614.04993903125 174466.51979517483, 172614.37794 174467.76679889, 172612.53894704106 174468.36579659986, 172612.53852629993 174468.36593398513, 172611.16394366286 174468.81479768714, 172608.52993999998 174469.67379888, 172609.11193880375 174471.76679455204, 172609.11197085044 174471.76690999718, 172609.56229931235 174473.38928541902, 172609.5649399964 174473.3987988771, 172612.91284623384 174485.5614581992, 172616.49161088464 174484.6038992107, 172617.37810321042 174484.36670035287, 172617.3781038362 174484.3667001854, 172617.40430078932 174484.35969066346, 172621.91801405355 174483.1519558644, 172625.84397284017 174482.10148660126, 172626.28639576584 174481.983107446, 172629.84245889643 174481.0316112079, 172629.84260632202 174481.0318919951, 172641.95148947238 174477.65292460908, 172641.9513229055 174477.65228320664, 172643.55453783524 174477.22348398916, 172649.45557890835 174475.6451792046, 172652.118800357 174474.93285825956, 172655.08757891503 174474.13881120458, 172669.09820291854 174470.39141919912, 172673.91823492196 174469.15141920003, 172674.05039449205 174469.04677954124, 172674.1582349241 174468.9614031985, 172675.5150722086 174468.60274051016, 172675.58914901028 174468.58315924928, 172676.93838271403 174468.22650647085, 172685.4841995281 174465.9675284286, 172690.08649093658 174464.75097119805, 172690.35773174433 174464.679270439, 172693.6036109403 174463.82124319673, 172695.45967493954 174467.2931151986, 172695.69615282057 174467.73546474247, 172695.8858936043 174468.09038905406, 172702.29378802062 174480.0768342967, 172712.67227422315 174477.65895398633, 172712.67215495606 174477.6584912053, 172719.8562189564 174475.80549920353, 172719.13622944942 174473.1791069913, 172719.19547385076 174473.1660017983, 172719.07393999997 174472.68079888003, 172722.78994000095 174471.8587988898, 172723.6209313099 174471.64980106562, 172723.62116079254 174471.6497431358, 172726.34993987996 174470.9607989128, 172727.68514120538 174470.623748284, 172728.34493999486 174470.45779889126, 172728.94593998056 174470.3107988972, 172729.36494001048 174470.20779888984, 172733.29694 174468.74879888006, 172732.51594000997 174463.94179888, 172736.18094000997 174462.86079888, 172736.12094 174460.75779888, 172739.38593999937 174460.04779889015, 172751.74194 174457.62979889003, 172751.82374942137 174457.8052091417, 172760.30108298364 174475.9976912029, 172767.25628262636 174472.6322513803, 172767.5851149932 174472.47314720228, 172767.50690699372 174472.13401120156, 172767.1188087445 174472.3620791199, 172766.30993999983 174470.7767988602, 172765.64794001004 174469.48679887998, 172766.51694001004 174469.12679887997, 172765.12794 174466.03679888998, 172764.34694001 174466.34679888003, 172762.84694005293 174463.15679897126, 172763.29320167168 174462.94189765144, 172764.2839314731 174462.46480300103, 172765.32593999998 174461.96179887993, 172761.1385378274 174453.29491927216, 172761.13853782744 174453.29491927216, 172760.09694000988 174451.01679888976, 172759.79494001003 174450.12279889, 172760.93594000998 174449.76179888003, 172761.82593999995 174450.27579889004, 172762.67400122888 174449.91177263303, 172765.15694 174448.84679888003, 172764.19994000997 174445.99879888, 172764.60994001062 174445.80279888492, 172764.33894001 174444.31479887993, 172763.51689098784 174441.74149918192, 172763.5168882326 174441.74150007046, 172763.51688823258 174441.74150007026, 172763.21993999998 174440.02779889002, 172761.17694 174440.68879888, 172759.74790522835 174436.7047019099, 172755.11890209024 174438.21366147915, 172754.95691696025 174437.6267152474, 172754.85751089564 174437.26601325686, 172754.6069400003 174436.3567988909, 172755.10336595034 174436.22560282986, 172756.19993908802 174435.93579913364, 172758.35593845724 174435.36579929787, 172760.84694000997 174434.70679888004, 172760.58894161868 174433.5358061814, 172760.14693999995 174431.53679888978, 172759.5329400001 174429.6077988801, 172759.52534339868 174429.53306474834, 172759.48582006822 174429.1442406328, 172759.76815493542 174429.05234718855, 172759.7528128644 174429.0162936086, 172759.12745483534 174427.54860076858, 172759.12745462733 174427.54860004058, 172759.1267469823 174427.54693917185, 172759.12695293076 174427.54684410253, 172758.76693612643 174426.28678529424, 172758.12194001 174424.02879888, 172758.32293999995 174423.95879888002, 172758.05193999998 174421.82179889004, 172756.6439400104 174422.12379887994, 172756.53950232168 174422.15535105282, 172755.98194000003 174422.32379888996, 172755.12451175836 174419.47773878835, 172753.83321806323 174419.78523359896, 172752.4939518636 174414.58684488994, 172751.20706697553 174414.83333916217, 172750.73129098117 174412.7877071612, 172748.95247497407 174413.2481231615, 172748.47247497732 174411.39813916016, 172753.23247498277 174410.11813915893, 172751.57647497955 174404.02937115356, 172750.80501897636 174401.19289115068, 172749.21920579113 174395.36230315745, 172749.2194832201 174395.36220860117, 172749.08793999997 174394.87879889001, 172750.24394001003 174394.48479888003, 172751.79493705663 174393.68580041145, 172753.32194001004 174392.89979888, 172754.02694001 174394.06179887996, 172759.86194000999 174390.84279887998, 172760.84694001003 174392.75779887996, 172762.75293454644 174391.80780159816, 172762.7540957816 174391.80722369105, 172764.6779369368 174390.84980040943, 172767.0349380484 174389.675799857, 172769.10393896094 174388.64579940226, 172770.8269400001 174387.78779888, 172772.41231297184 174387.0021096416, 172769.92245898946 174381.99321113512, 172769.86473163788 174381.87794843127, 172766.27740298968 174374.71225113448, 172766.12751504182 174374.37625125528, 172765.45154720507 174372.86111561494, 172764.5623949914 174370.86834713045, 172758.44661898166 174358.71346712485, 172758.08089647835 174357.9866221479, 172758.0812897689 174357.9865175769, 172757.8519399999 174357.5307988898, 172754.4110373197 174349.3873883099, 172754.41083817216 174349.3874620819, 172754.04609390008 174348.52429801252, 172753.7164504677 174347.74419976756, 172753.71289365587 174347.7351269625, 172752.91599497944 174345.84914711493, 172752.96828298277 174345.83532311398, 172752.74697099614 174345.2712271516, 172750.88521097507 174340.5253711095, 172749.90261897308 174337.94073110458, 172742.68309897187 174319.57548309487, 172729.2444429621 174323.76869909838, 172729.1040909663 174323.3482191004, 172719.76546695834 174325.91705109927, 172721.48245895657 174332.9833551049, 172723.08294328308 174339.57013976108, 172723.03791828503 174339.58436050604, 172723.15793999998 174340.07079887998, 172719.07994 174341.35879888994, 172719.0331842302 174340.8492201192, 172718.5874979483 174340.98998616525, 172718.5534989536 174340.6227151118, 172714.9709069505 174341.62623511252, 172702.72073094547 174345.05746711424, 172703.20898694542 174346.73209111392, 172703.9096589461 174349.13503511623, 172695.26953093708 174351.39500311756, 172694.93771905327 174349.74538306356, 172692.57990415473 174350.34580801197, 172692.57334559556 174350.34747709305, 172689.68390132912 174351.0828087242, 172689.6768192437 174351.08460978328, 172686.95894150986 174351.77579850602, 172684.89594078047 174352.3007986814, 172684.8828689878 174352.30412604674, 172683.3009262921 174352.70680236846, 172681.18281584515 174353.24583040207, 172679.3319479569 174353.71579686215, 172677.40094000465 174354.20779888882, 172677.27266865686 174353.73419735025, 172676.77394073328 174351.89280155062, 172676.06193873903 174349.26679423897, 172675.7409324217 174348.08277088706, 172675.25994054292 174346.30780088357, 172675.2596599193 174346.30676614863, 172674.46692653303 174343.38374918967, 172673.58194064876 174340.11780124725, 172672.77094000002 174337.12779888004, 172670.9499049531 174337.60880813404, 172670.52563620973 174337.72080595847, 172669.09919766168 174338.09735505903, 172669.08994002102 174338.09979887708, 172668.25594001057 174338.3197988899, 172663.54094 174339.43779888, 172663.9509396747 174340.9917976469, 172663.95246609734 174340.9975798821, 172664.37093995474 174342.5827987186, 172664.9449393093 174344.75679626403, 172665.47293987044 174346.75879839866, 172665.473080069 174346.7593299183, 172666.08593904617 174349.08279523588, 172666.0860074876 174349.08305431984, 172666.77093856825 174351.67579347026, 172667.44093999997 174354.21779888, 172665.21794001 174354.76179888, 172665.0101183685 174354.8126524625, 172663.37894000002 174355.21179888002, 172663.37873282918 174355.21184957805, 172661.5809427116 174355.65179822646, 172659.15894248072 174356.2437982761, 172656.24094000997 174356.95779889004, 172655.8289405051 174354.98780124754, 172655.30694000996 174352.49479888997, 172654.75393999997 174349.85379887992, 172653.44093999994 174347.26779887994, 172650.79094000012 174346.37779887998, 172649.39294039877 174346.74579877505, 172649.3911846923 174346.7462610297, 172648.1699417751 174347.06779842527, 172643.14494001 174348.38979889, 172642.93389291374 174348.44532466854, 172640.56794000996 174349.06779889, 172640.41789637046 174349.10727144754, 172638.06294 174349.72679888003, 172635.8089427633 174350.319798163, 172634.01694338908 174350.79179799, 172631.56094000998 174351.43779888997, 172631.68094001 174351.69779888, 172630.46894738195 174352.0517967368, 172630.4687520214 174352.05185395735, 172629.2809437475 174352.39979778518, 172627.68094000997 174352.86779889, 172628.10093847304 174354.1197943085, 172628.10107294662 174354.1201945294, 172628.6879379874 174355.86679290008, 172628.68799114702 174355.86695143604, 172629.43093933648 174358.08279688127, 172629.43133035954 174358.0839622848, 172630.24693959064 174360.5147976402, 172630.24792235918 174360.51772822303, 172630.85693939638 174362.3337970801, 172631.76094 174365.02779888996, 172632.43094001003 174364.86779888996, 172632.93494001002 174366.67479888993, 172630.87694000924 174367.2867988902, 172629.35094510994 174367.69579751312, 172629.35049890392 174367.69591735688, 172627.54894514213 174368.17979751158, 172627.52128803954 174368.18721035263, 172625.4409402792 174368.7447988152, 172625.43971959242 174368.74512604062, 172623.82194391786 174369.17879783243, 172621.82194405483 174369.715797794, 172621.82183787943 174369.71582625585, 172620.13194178292 174370.16879840213, 172618.52894290345 174370.59879811114, 172616.85694000009 174371.04679887995, 172613.67694 174372.43679888, 172612.2709414281 174372.87179843814, 172610.70894325845 174373.35479788246, 172608.85694 174373.92679889, 172608.25794049533 174371.89080052968, 172607.82694000003 174370.42679889002, 172607.51030628625 174370.515852122, 172607.38694001004 174370.06679887997, 172607.01194001 174368.70179888996, 172605.61394000004 174369.12679888998, 172604.29194001 174364.49979887996, 172605.79494001003 174364.27579888995, 172604.95794001003 174361.23079889003, 172604.15693999996 174358.31679887997, 172601.3829428521 174359.08279810517, 172600.24729543962 174359.3960325686, 172597.84457264078 174350.6279695617, 172597.51694001004 174350.71679888997, 172593.94294000993 174351.68579889, 172594.4599387648 174353.5957943269, 172594.89194001 174355.18879888, 172594.43694 174355.28679888998, 172595.10393895835 174357.58879525043, 172595.61693890326 174359.35679511022, 172596.36993943545 174361.95579694142, 172596.92693999998 174363.87679887997, 172594.25694 174364.45679887995, 172594.21693999998 174364.31679888006, 172593.00494592657 174364.6537972349, 172593.00452690053 174364.65391402238, 172592.00394302807 174364.932798036, 172590.26894162453 174365.41579843775, 172588.36994388918 174365.94479780665, 172588.36984125132 174365.94482635465, 172586.29894001002 174366.52079888002, 172585.7109407086 174364.2888015419, 172585.71082483808 174364.2883622034, 172585.01994076036 174361.66880173524, 172584.8667329185 174361.0872324162, 172584.37794 174359.23179888996, 172583.4569404406 174355.73580051467, 172582.56193999999 174352.34079887997, 172581.81194 174349.49579887997, 172578.96056568567 174350.36739802494, 172585.1382444169 174374.19050227254, 172585.0614705477 174374.21335843968, 172585.18994 174374.69679888996, 172581.69994000997 174375.73579888, 172581.62350512363 174375.3929519558, 172581.93994000004 174374.65479888, 172582.48094 174373.39279888003, 172580.61794 174366.54279888, 172576.77667659082 174367.3948403584, 172578.3008907684 174373.35775476237, 172578.52405885607 174374.23071513322, 172580.47195049844 174381.85118837637, 172580.4625612569 174381.85333750857, 172580.58694000004 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888003, 172576.23194 174376.15679888002, 172575.20993999997 174372.55179889, 172573.66458694366 174372.8308626458, 172574.0934668556 174374.3819471337, 172574.33365876754 174375.25074680167, 172574.7994377378 174376.93505831185, 172574.46694027368 174377.10679874866, 172573.55473542705 174377.38586125555, 172571.95794220705 174377.87279822002, 172569.12694000997 174378.73679888004, 172570.29693999997 174382.59679888, 172569.06894000657 174382.95779888806, 172568.98899089158 174382.9810527852, 172567.62494267538 174383.37779810186, 172566.1759413303 174383.7987985035, 172564.9709467131 174384.14879693012, 172563.53494001646 174384.5647988781, 172562.23594001002 174384.94279888997, 172561.03905731053 174385.28960586703, 172554.56188284606 174386.74853914225, 172555.21404284242 174388.99244314435, 172557.3838523062 174396.45835165278)),((172739.38594000007 174460.04779889, 172739.39373637483 174460.04610350684, 172739.392673916 174460.04121769255, 172739.3870486459 174460.03837656736, 172739.38261013498 174460.0403655549, 172739.3807950899 174460.03631378766, 172739.37623201194 174460.03835788142, 172739.37262919155 174460.04530889943, 172739.37358944913 174460.05021582366, 172739.3858038434 174460.04782553512, 172739.3859399994 174460.04779889015, 172739.38594000007 174460.04779889)))" + ) + result = safe_intersection(polygon_a, polygon_b) # GEOS exception is catched self.assertTrue(result.is_valid) + def test_safe_difference(self): """Tests safe_difference with a polygon contained within another.""" polygon_a = Polygon([(0, 0), (1, 0), (1, 1), (0, 1)]) @@ -81,15 +92,15 @@ def test_safe_difference(self): def test_safe_difference_geos_exception(self): """Tests safe_difference with a geos exception.""" - polygon_a = from_wkt('MULTIPOLYGON(((172767.25694 174472.63279888, 172766.30994001 174470.77679888, 172765.64794001 174469.48679888, 172766.51694001 174469.12679888, 172765.12794 174466.03679889, 172764.34694001 174466.34679888, 172762.84694001 174463.15679888, 172764.28394001 174462.46479889, 172765.32594 174461.96179888, 172761.13894 174453.29579888, 172760.09694001 174451.01679889, 172759.79494001 174450.12279889, 172760.93594001 174449.76179888, 172761.82594 174450.27579889, 172762.67394001 174449.91179889, 172765.15694 174448.84679888, 172764.19994001 174445.99879888, 172764.60994 174445.80279889, 172764.33894001 174444.31479888, 172763.51694001 174441.74179888, 172763.21994 174440.02779889, 172761.17694 174440.68879888, 172759.74794001 174436.70479888, 172759.02694001 174436.93979888, 172756.96694 174437.61179889, 172755.11894001 174438.21379888, 172754.95694001 174437.62679889, 172754.60694 174436.35679889, 172756.19994001 174435.93579889, 172758.35594 174435.36579889, 172760.84694001 174434.70679888, 172760.58894001 174433.53579888, 172760.14694 174431.53679889, 172759.53294 174429.60779888, 172759.38494 174428.15179888, 172759.12694001 174427.54679888, 172758.76694001 174426.28679889, 172758.12194001 174424.02879888, 172758.32294 174423.95879888, 172758.05194 174421.82179889, 172756.64394001 174422.12379888, 172755.98194 174422.32379889, 172755.12694001 174419.48579888, 172753.83594001 174419.79579889, 172752.49394001 174414.58679888, 172751.20794001 174414.83379888, 172750.65294001 174412.80779888, 172748.95294001 174413.24779889, 172748.47294 174411.39879889, 172753.23294001 174410.11879888, 172752.77094 174408.42079889, 172752.20594 174406.34079888, 172751.57694 174404.02979888, 172750.94994001 174401.72379889, 172750.44494 174399.86779889, 172749.65394 174396.95879888, 172749.08794 174394.87879889, 172750.24394001 174394.48479888, 172751.79494001 174393.68579889, 172753.32194001 174392.89979888, 172754.02694001 174394.06179888, 172759.86194001 174390.84279888, 172760.84694001 174392.75779888, 172762.75294 174391.80779888, 172764.67794001 174390.84979888, 172767.03494001 174389.67579888, 172769.10394001 174388.64579888, 172770.82694 174387.78779888, 172772.41294001 174387.00179889, 172771.70694001 174385.58179888, 172770.47494001 174383.10379888, 172769.86494001 174381.87779888, 172769.31094001 174380.77179889, 172768.51694001 174379.18579889, 172767.43494001 174377.02279888, 172766.27794001 174374.71279889, 172765.78994 174373.61879888, 172765.24294 174372.39279888, 172764.56294 174370.86879888, 172763.48394 174368.72379889, 172762.58994001 174366.94779889, 172761.36994 174364.52279888, 172760.27094 174362.33879888, 172759.15994001 174360.12979888, 172757.85194 174357.53079889, 172752.91594 174345.84979888, 172752.44494 174344.50079888, 172751.68294 174342.55779888, 172750.88594 174340.52579889, 172749.87694001 174337.94779888, 172748.82694 174335.20279888, 172747.72094 174332.38879888, 172746.51294001 174329.31579889, 172745.36494001 174326.39779888, 172743.82194001 174322.47179888, 172742.68394 174319.57579888, 172739.86294 174320.46079888, 172737.67194 174320.96779888, 172736.12194001 174321.39879889, 172733.90294001 174322.01479889, 172731.21594 174322.76179888, 172729.70094 174323.15779889, 172729.10494001 174323.34879888, 172727.50294 174323.86079888, 172724.60494001 174324.78679888, 172719.82894001 174326.31279889, 172720.17794001 174327.77779889, 172720.41094 174328.75779888, 172720.82494001 174330.49979889, 172721.08494 174331.56079889, 172721.42594 174332.98579888, 172721.70594 174334.18179888, 172722.03394001 174335.51479889, 172722.60994 174337.84979888, 172723.15794 174340.07079888, 172719.07994 174341.35879889, 172719.00094001 174340.49779889, 172718.62994001 174340.60179888, 172717.50294 174340.91679888, 172714.97094 174341.62679888, 172714.17294 174341.84979888, 172712.47094 174342.32679888, 172710.41394001 174342.90279889, 172708.33894001 174343.48379889, 172705.43894001 174344.29679888, 172702.72094 174345.05779888, 172703.36294 174347.25779888, 172703.90994001 174349.13479888, 172702.14294 174349.59779889, 172700.29694 174350.08079888, 172697.39194001 174350.83979889, 172695.26994001 174351.39479888, 172694.94394 174349.74379888, 172692.57994 174350.34579889, 172689.68394 174351.08279889, 172686.95894 174351.77579889, 172684.89594 174352.30079888, 172683.30094 174352.70679888, 172681.18294 174353.24579888, 172679.33194001 174353.71579888, 172677.40094 174354.20779889, 172676.77394001 174351.89279888, 172676.06194 174349.26679889, 172675.74094001 174348.08279889, 172675.25994 174346.30779888, 172674.46694 174343.38379889, 172673.58194001 174340.11779889, 172672.77094 174337.12779888, 172670.94994001 174337.60879888, 172669.08994001 174338.09979888, 172668.25594001 174338.31979889, 172663.54094 174339.43779888, 172663.95094 174340.99179888, 172664.37094 174342.58279889, 172664.94494 174344.75679888, 172665.47294 174346.75879889, 172666.08594001 174349.08279889, 172666.77094 174351.67579889, 172667.44094 174354.21779888, 172665.21794001 174354.76179888, 172663.37894 174355.21179888, 172661.58094 174355.65179889, 172659.15894001 174356.24379888, 172656.24094001 174356.95779889, 172655.82894001 174354.98779888, 172655.30694001 174352.49479889, 172654.75394 174349.85379888, 172653.44094 174347.26779888, 172650.79094 174346.37779888, 172649.39294 174346.74579888, 172648.16994001 174347.06779889, 172643.14494001 174348.38979889, 172640.56794001 174349.06779889, 172638.06294 174349.72679888, 172635.80894 174350.31979889, 172634.01694001 174350.79179888, 172631.56094001 174351.43779889, 172631.68094001 174351.69779888, 172630.46894001 174352.05179889, 172629.28094001 174352.39979888, 172627.68094001 174352.86779889, 172628.10094001 174354.11979889, 172628.68794 174355.86679889, 172629.43094001 174358.08279889, 172630.24694001 174360.51479889, 172630.85694 174362.33379888, 172631.76094 174365.02779889, 172632.43094001 174364.86779889, 172632.93494001 174366.67479889, 172630.87694001 174367.28679889, 172629.35094001 174367.69579888, 172627.54894001 174368.17979889, 172625.44094 174368.74479889, 172623.82194001 174369.17879888, 172621.82194001 174369.71579888, 172620.13194 174370.16879888, 172618.52894 174370.59879889, 172616.85694 174371.04679888, 172613.67694 174372.43679888, 172612.27094 174372.87179888, 172610.70894 174373.35479889, 172608.85694 174373.92679889, 172608.25794001 174371.89079888, 172607.82694 174370.42679889, 172607.50694 174370.51679889, 172607.38694001 174370.06679888, 172607.01194001 174368.70179889, 172605.61394 174369.12679889, 172604.29194001 174364.49979888, 172605.79494001 174364.27579889, 172604.95794001 174361.23079889, 172604.15694 174358.31679888, 172601.38294001 174359.08279889, 172599.73694001 174359.53679889, 172599.03094001 174356.96479888, 172598.45694001 174354.87679889, 172598.31094001 174353.65579888, 172597.92494001 174352.22579889, 172597.51694001 174350.71679889, 172593.94294001 174351.68579889, 172594.45994 174353.59579889, 172594.89194001 174355.18879888, 172594.43694 174355.28679889, 172595.10394001 174357.58879888, 172595.61694 174359.35679889, 172596.36994 174361.95579889, 172596.92694 174363.87679888, 172594.25694 174364.45679888, 172594.21694 174364.31679888, 172593.00494001 174364.65379888, 172592.00394 174364.93279888, 172590.26894 174365.41579889, 172588.36994 174365.94479889, 172586.29894001 174366.52079888, 172585.71094001 174364.28879889, 172585.01994001 174361.66879889, 172584.37794 174359.23179889, 172583.45694001 174355.73579888, 172582.56194 174352.34079888, 172581.81194 174349.49579888, 172578.83494 174350.40579889, 172579.40794 174352.63579888, 172579.78994 174354.11679888, 172580.28794001 174356.05279889, 172580.77094 174357.92779888, 172581.47694 174360.66679888, 172581.97094 174362.58679888, 172582.24294 174363.61779889, 172582.54194001 174364.74379888, 172582.91294001 174366.13879888, 172583.24094001 174367.37179888, 172583.56894 174368.60379888, 172583.98394 174370.16379889, 172584.46094001 174371.95479888, 172584.86494001 174373.47379888, 172585.18994 174374.69679889, 172581.69994001 174375.73579888, 172581.45894 174374.65479888, 172581.93994 174374.65479888, 172582.48094 174373.39279888, 172580.61794 174366.54279888, 172576.54694 174367.44579888, 172576.96094001 174368.82979888, 172577.49594 174370.61579889, 172578.20294001 174372.70579888, 172578.57394 174374.21879889, 172578.69794 174374.72879888, 172578.94194001 174375.71979888, 172579.21594 174376.83779888, 172579.48694001 174377.94179888, 172579.78194 174379.14479889, 172580.08194001 174380.37079888, 172580.58694 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888, 172576.23194 174376.15679888, 172575.20994 174372.55179889, 172573.66494 174372.83079889, 172574.33394 174375.25079888, 172574.79994001 174376.93479888, 172574.46694 174377.10679889, 172573.55494 174377.38579888, 172571.95794001 174377.87279889, 172569.12694001 174378.73679888, 172570.29694 174382.59679888, 172569.06894 174382.95779889, 172567.62494 174383.37779888, 172566.17594 174383.79879889, 172564.97094 174384.14879888, 172563.53494001 174384.56479888, 172562.23594001 174384.94279889, 172561.03494001 174385.29079889, 172559.35194 174385.66979888, 172558.39794001 174385.88479888, 172556.63694001 174386.28179888, 172554.56194 174386.74879888, 172554.93394 174388.02679888, 172555.33194001 174389.39779888, 172555.78394001 174390.95079888, 172556.25094001 174392.55979888, 172556.78094001 174394.38279888, 172557.38394001 174396.45779889, 172555.12994001 174410.66979888, 172554.04194001 174412.21079889, 172554.18094001 174413.74279889, 172554.35894 174415.69279889, 172554.59094 174418.23979888, 172554.80294001 174420.57479888, 172555.02794001 174423.04279888, 172555.93294 174422.97279889, 172557.54494001 174422.84879889, 172560.00094001 174422.89679889, 172562.04294 174422.83779889, 172563.99094001 174422.77979888, 172565.29094 174422.74079889, 172567.21594 174422.68179889, 172569.10194 174422.62379888, 172568.98294001 174421.27879888, 172568.88094001 174420.13579889, 172568.73194 174418.45579889, 172568.45294001 174415.31879888, 172570.64394 174415.21279889, 172570.64394001 174420.55979889, 172572.08594001 174420.43979888, 172572.08594001 174421.46179888, 172572.89894001 174421.52179889, 172572.93594001 174418.69679889, 172572.92794001 174415.53279888, 172575.20994 174415.51279889, 172575.27294001 174421.23079888, 172577.66994001 174421.37079888, 172577.71794001 174420.68179889, 172577.72494001 174418.93679889, 172577.73594001 174415.93279888, 172580.01694001 174415.87379888, 172579.83694 174420.49979889, 172581.27894 174420.49979889, 172581.16094 174421.60179888, 172582.17694 174421.66979888, 172582.13594 174422.43279888, 172582.06294 174423.81779889, 172581.85494001 174425.10579888, 172581.54394 174425.96979888, 172582.27094 174425.90879888, 172583.34994001 174425.81679888, 172584.44594001 174425.72479888, 172585.57394 174425.43879889, 172587.27294001 174425.00679888, 172589.82794001 174424.35879889, 172589.40294001 174423.53179888, 172589.03494001 174422.06079888, 172588.59694001 174420.30879889, 172588.35594 174419.34679888, 172587.97694 174417.82879889, 172587.78294 174417.05679889, 172587.61594001 174415.77979888, 172587.36494001 174414.35979888, 172587.75394 174413.42079888, 172587.86994 174411.44879889, 172592.26794 174410.32279888, 172592.57794001 174412.11779889, 172593.54694 174411.85679889, 172593.88294001 174413.17479889, 172596.71694 174412.45279888, 172597.50594001 174415.42779888, 172593.94094 174416.36279888, 172594.31794001 174417.67579888, 172595.57994 174417.37579888, 172595.88594 174418.96979888, 172599.56994 174418.29279888, 172600.39494001 174421.68079888, 172599.12494 174422.00279888, 172597.83994001 174422.32779888, 172595.25594001 174422.98279888, 172595.67794001 174424.90679888, 172598.81094001 174424.21879889, 172599.32294 174426.26379888, 172599.83994001 174428.32779888, 172600.28294 174430.09379889, 172599.53294 174430.30379888, 172598.94794 174431.12079888, 172598.50794001 174431.73679888, 172598.17194 174432.53079888, 172597.70394001 174433.63779889, 172598.26694001 174435.35479889, 172601.68394 174434.46579888, 172602.63794001 174437.85679889, 172603.52094 174441.33179888, 172604.18794 174443.95879889, 172607.05394 174443.20479888, 172608.01694001 174447.05779888, 172602.61494001 174448.18279888, 172603.57694 174451.96779888, 172591.37294001 174454.98979888, 172593.09694001 174460.86279888, 172596.00694 174460.12279889, 172599.45294001 174459.24579888, 172605.06394001 174457.81879888, 172608.39694 174456.97079889, 172613.56094001 174455.65679888, 172614.32594 174458.77479888, 172609.11894001 174459.86879888, 172606.47194001 174460.59979888, 172604.45794001 174461.15679888, 172605.34094 174464.77179889, 172607.57394 174464.20979889, 172609.99094001 174463.60579889, 172613.07994 174462.83479889, 172613.61894001 174464.88379889, 172614.04994001 174466.51979889, 172614.37794 174467.76679889, 172612.53894001 174468.36579889, 172611.16394001 174468.81479888, 172608.52994 174469.67379888, 172609.11194001 174471.76679889, 172609.56494 174473.39879889, 172612.91294001 174485.56179888, 172614.59894 174485.11079888, 172617.38894 174484.36379889, 172622.33194001 174483.04179888, 172625.99594 174482.06079889, 172629.84294001 174481.03179888, 172641.95194 174477.65279889, 172643.75494001 174477.16979888, 172645.38894 174476.73279888, 172647.53094001 174476.15979889, 172649.87894 174475.53179888, 172652.14894001 174474.92479889, 172655.08794 174474.13879889, 172656.82294 174473.67479889, 172659.20494 174473.03779889, 172661.12994001 174472.52279888, 172663.13094001 174471.98779888, 172666.07294 174471.20079888, 172669.09894 174470.39179889, 172670.32794001 174470.07579888, 172672.24694001 174469.58179889, 172673.91894 174469.15179888, 172674.58694 174468.84879889, 172675.52994 174468.59879889, 172677.88094001 174467.97779889, 172680.51794 174467.28079889, 172683.39194001 174466.52079888, 172686.88994 174465.59579889, 172690.08694 174464.75079888, 172693.60394001 174463.82179889, 172694.71594 174465.90079889, 172695.81494 174467.95779889, 172696.76694001 174469.73679889, 172698.74294 174473.43379889, 172700.00894001 174475.80279888, 172701.21194 174478.05279888, 172702.29394 174480.07679889, 172712.67294 174477.65879888, 172714.31294 174477.23479888, 172715.92294 174476.81879889, 172718.15094 174476.24279889, 172719.85594 174475.80279888, 172719.07394 174472.68079888, 172722.78994 174471.85879889, 172723.62094 174471.64979888, 172726.34994001 174470.96079888, 172727.68494001 174470.62379888, 172728.34494 174470.45779889, 172728.94594001 174470.31079889, 172729.36494001 174470.20779889, 172733.29694 174468.74879888, 172732.51594001 174463.94179888, 172736.18094001 174462.86079888, 172736.12094 174460.75779888, 172739.38594 174460.04779889, 172751.74194 174457.62979889, 172752.52594 174459.31079889, 172753.47194001 174461.34079888, 172754.32394 174463.17079889, 172755.22994001 174465.11479888, 172756.45494 174467.74379888, 172757.91194 174470.86979889, 172759.17194 174473.57379889, 172760.30194 174475.99779889, 172767.25694 174472.63279888)))') - polygon_b = from_wkt('MULTIPOLYGON(((172557.3838523062 174396.45835165278, 172555.12905084348 174410.6693711578, 172554.04105084387 174412.2103631608, 172554.28937084228 174414.93676316369, 172555.0277388468 174423.0425551683, 172563.7369228527 174422.37100316587, 172569.0432908535 174421.9618511684, 172568.4963957805 174415.81728130922, 172568.4972705121 174415.81723898993, 172568.45294000994 174415.31879887995, 172570.64394 174415.21279888996, 172570.64394001 174420.55979889, 172572.08594000997 174420.43979888, 172572.08594000997 174420.94152719184, 172572.77495595193 174420.8841888285, 172572.71193637606 174416.03471118974, 172572.929204253 174416.03280700246, 172572.92794000998 174415.53279887998, 172575.20994000003 174415.51279889, 172575.27294001004 174421.23079888, 172577.6697196799 174421.37078601134, 172577.70199362023 174416.43384416474, 172577.73410833202 174416.4330134905, 172577.7358131635 174415.9674395041, 172577.73594001 174415.93279888004, 172578.87644000998 174415.90329888, 172580.01694000998 174415.87379888, 172579.83694 174420.49979889003, 172581.27894 174420.49979889003, 172581.22540097954 174420.99979889003, 172582.22334147422 174420.99979889003, 172582.17621886 174421.66917916582, 172582.0176908598 174424.652603168, 172581.5430028588 174425.96959516776, 172581.36988285926 174426.44985117015, 172583.22229886055 174426.393211171, 172584.53372231862 174426.04524331444, 172585.60137086362 174425.76191516966, 172589.6888588667 174424.67730716988, 172588.59657086435 174420.30905116722, 172587.97628287587 174417.82828320874, 172587.62773886323 174416.44255516306, 172587.57641086724 174416.43890716136, 172587.6150668636 174415.78034716102, 172587.75349886715 174413.420987159, 172587.86921086907 174411.4484431595, 172591.77150026744 174410.4497097941, 172592.26794067942 174410.3228028141, 172592.57794001006 174412.11779889002, 172593.54694000003 174411.85679889002, 172593.88294001002 174413.17479889, 172596.71693999998 174412.45279888005, 172597.50594000999 174415.42779887991, 172597.172895412 174415.51514718245, 172597.022295644 174415.5546452982, 172597.0224054087 174415.55505917643, 172593.93199883454 174416.33165895962, 172593.94094 174416.36279887997, 172594.31794001002 174417.67579888002, 172595.57994 174417.37579888004, 172595.88594000004 174418.96979887996, 172599.56993999996 174418.29279888, 172600.39494000998 174421.68079888003, 172599.91025387176 174421.80368780546, 172599.94715650496 174421.95523461731, 172596.69628287107 174422.8178511672, 172595.3009759594 174423.18812865848, 172595.67794001 174424.90679888, 172598.81094000905 174424.2187988902, 172598.92996166085 174424.6941881079, 172599.32293973575 174426.26379782447, 172599.32319430308 174426.26481412462, 172599.83993917855 174428.32779556068, 172600.28294000003 174430.09379889, 172599.53294 174430.30379888, 172598.9479399949 174431.12079888713, 172598.50794000993 174431.73679888, 172598.17194137024 174432.53079564194, 172597.70394001 174433.63779889003, 172598.2660748735 174435.35474717614, 172601.1998381591 174434.5913030442, 172601.19995467947 174434.5917172166, 172601.68394000002 174434.46579888, 172602.63794000942 174437.85679888783, 172603.5209395613 174441.3317971537, 172603.67147661696 174441.92469197488, 172604.18799165756 174443.95900234475, 172607.0539523896 174443.2048484512, 172608.01694001004 174447.05779888, 172602.61494001004 174448.18279888007, 172603.57694000003 174451.96779887998, 172591.37294001 174454.98979887998, 172593.09693550566 174460.86278353556, 172605.0632588789 174457.8183631897, 172608.39689087868 174456.97023519131, 172613.0762718963 174455.77972994547, 172613.07636302974 174455.78010138884, 172613.56094001004 174455.65679887997, 172614.32594000004 174458.77479888004, 172609.11894000994 174459.86879888005, 172606.47194360537 174460.59979788712, 172604.45794001 174461.15679888, 172605.3409823247 174464.7719721671, 172612.59480380098 174462.95596724018, 172612.7014123517 174462.92927763195, 172613.07994000003 174462.83479889008, 172613.61893907966 174464.88379535347, 172613.6189968665 174464.88401470726, 172614.04993903125 174466.51979517483, 172614.37794 174467.76679889, 172612.53894704106 174468.36579659986, 172612.53852629993 174468.36593398513, 172611.16394366286 174468.81479768714, 172608.52993999998 174469.67379888, 172609.11193880375 174471.76679455204, 172609.11197085044 174471.76690999718, 172609.56229931235 174473.38928541902, 172609.5649399964 174473.3987988771, 172612.91284623384 174485.5614581992, 172616.49161088464 174484.6038992107, 172617.37810321042 174484.36670035287, 172617.3781038362 174484.3667001854, 172617.40430078932 174484.35969066346, 172621.91801405355 174483.1519558644, 172625.84397284017 174482.10148660126, 172626.28639576584 174481.983107446, 172629.84245889643 174481.0316112079, 172629.84260632202 174481.0318919951, 172641.95148947238 174477.65292460908, 172641.9513229055 174477.65228320664, 172643.55453783524 174477.22348398916, 172649.45557890835 174475.6451792046, 172652.118800357 174474.93285825956, 172655.08757891503 174474.13881120458, 172669.09820291854 174470.39141919912, 172673.91823492196 174469.15141920003, 172674.05039449205 174469.04677954124, 172674.1582349241 174468.9614031985, 172675.5150722086 174468.60274051016, 172675.58914901028 174468.58315924928, 172676.93838271403 174468.22650647085, 172685.4841995281 174465.9675284286, 172690.08649093658 174464.75097119805, 172690.35773174433 174464.679270439, 172693.6036109403 174463.82124319673, 172695.45967493954 174467.2931151986, 172695.69615282057 174467.73546474247, 172695.8858936043 174468.09038905406, 172702.29378802062 174480.0768342967, 172712.67227422315 174477.65895398633, 172712.67215495606 174477.6584912053, 172719.8562189564 174475.80549920353, 172719.13622944942 174473.1791069913, 172719.19547385076 174473.1660017983, 172719.07393999997 174472.68079888003, 172722.78994000095 174471.8587988898, 172723.6209313099 174471.64980106562, 172723.62116079254 174471.6497431358, 172726.34993987996 174470.9607989128, 172727.68514120538 174470.623748284, 172728.34493999486 174470.45779889126, 172728.94593998056 174470.3107988972, 172729.36494001048 174470.20779888984, 172733.29694 174468.74879888006, 172732.51594000997 174463.94179888, 172736.18094000997 174462.86079888, 172736.12094 174460.75779888, 172739.38593999937 174460.04779889015, 172751.74194 174457.62979889003, 172751.82374942137 174457.8052091417, 172760.30108298364 174475.9976912029, 172767.25628262636 174472.6322513803, 172767.5851149932 174472.47314720228, 172767.50690699372 174472.13401120156, 172767.1188087445 174472.3620791199, 172766.30993999983 174470.7767988602, 172765.64794001004 174469.48679887998, 172766.51694001004 174469.12679887997, 172765.12794 174466.03679888998, 172764.34694001 174466.34679888003, 172762.84694005293 174463.15679897126, 172763.29320167168 174462.94189765144, 172764.2839314731 174462.46480300103, 172765.32593999998 174461.96179887993, 172761.1385378274 174453.29491927216, 172761.13853782744 174453.29491927216, 172760.09694000988 174451.01679888976, 172759.79494001003 174450.12279889, 172760.93594000998 174449.76179888003, 172761.82593999995 174450.27579889004, 172762.67400122888 174449.91177263303, 172765.15694 174448.84679888003, 172764.19994000997 174445.99879888, 172764.60994001062 174445.80279888492, 172764.33894001 174444.31479887993, 172763.51689098784 174441.74149918192, 172763.5168882326 174441.74150007046, 172763.51688823258 174441.74150007026, 172763.21993999998 174440.02779889002, 172761.17694 174440.68879888, 172759.74790522835 174436.7047019099, 172755.11890209024 174438.21366147915, 172754.95691696025 174437.6267152474, 172754.85751089564 174437.26601325686, 172754.6069400003 174436.3567988909, 172755.10336595034 174436.22560282986, 172756.19993908802 174435.93579913364, 172758.35593845724 174435.36579929787, 172760.84694000997 174434.70679888004, 172760.58894161868 174433.5358061814, 172760.14693999995 174431.53679888978, 172759.5329400001 174429.6077988801, 172759.52534339868 174429.53306474834, 172759.48582006822 174429.1442406328, 172759.76815493542 174429.05234718855, 172759.7528128644 174429.0162936086, 172759.12745483534 174427.54860076858, 172759.12745462733 174427.54860004058, 172759.1267469823 174427.54693917185, 172759.12695293076 174427.54684410253, 172758.76693612643 174426.28678529424, 172758.12194001 174424.02879888, 172758.32293999995 174423.95879888002, 172758.05193999998 174421.82179889004, 172756.6439400104 174422.12379887994, 172756.53950232168 174422.15535105282, 172755.98194000003 174422.32379888996, 172755.12451175836 174419.47773878835, 172753.83321806323 174419.78523359896, 172752.4939518636 174414.58684488994, 172751.20706697553 174414.83333916217, 172750.73129098117 174412.7877071612, 172748.95247497407 174413.2481231615, 172748.47247497732 174411.39813916016, 172753.23247498277 174410.11813915893, 172751.57647497955 174404.02937115356, 172750.80501897636 174401.19289115068, 172749.21920579113 174395.36230315745, 172749.2194832201 174395.36220860117, 172749.08793999997 174394.87879889001, 172750.24394001003 174394.48479888003, 172751.79493705663 174393.68580041145, 172753.32194001004 174392.89979888, 172754.02694001 174394.06179887996, 172759.86194000999 174390.84279887998, 172760.84694001003 174392.75779887996, 172762.75293454644 174391.80780159816, 172762.7540957816 174391.80722369105, 172764.6779369368 174390.84980040943, 172767.0349380484 174389.675799857, 172769.10393896094 174388.64579940226, 172770.8269400001 174387.78779888, 172772.41231297184 174387.0021096416, 172769.92245898946 174381.99321113512, 172769.86473163788 174381.87794843127, 172766.27740298968 174374.71225113448, 172766.12751504182 174374.37625125528, 172765.45154720507 174372.86111561494, 172764.5623949914 174370.86834713045, 172758.44661898166 174358.71346712485, 172758.08089647835 174357.9866221479, 172758.0812897689 174357.9865175769, 172757.8519399999 174357.5307988898, 172754.4110373197 174349.3873883099, 172754.41083817216 174349.3874620819, 172754.04609390008 174348.52429801252, 172753.7164504677 174347.74419976756, 172753.71289365587 174347.7351269625, 172752.91599497944 174345.84914711493, 172752.96828298277 174345.83532311398, 172752.74697099614 174345.2712271516, 172750.88521097507 174340.5253711095, 172749.90261897308 174337.94073110458, 172742.68309897187 174319.57548309487, 172729.2444429621 174323.76869909838, 172729.1040909663 174323.3482191004, 172719.76546695834 174325.91705109927, 172721.48245895657 174332.9833551049, 172723.08294328308 174339.57013976108, 172723.03791828503 174339.58436050604, 172723.15793999998 174340.07079887998, 172719.07994 174341.35879888994, 172719.0331842302 174340.8492201192, 172718.5874979483 174340.98998616525, 172718.5534989536 174340.6227151118, 172714.9709069505 174341.62623511252, 172702.72073094547 174345.05746711424, 172703.20898694542 174346.73209111392, 172703.9096589461 174349.13503511623, 172695.26953093708 174351.39500311756, 172694.93771905327 174349.74538306356, 172692.57990415473 174350.34580801197, 172692.57334559556 174350.34747709305, 172689.68390132912 174351.0828087242, 172689.6768192437 174351.08460978328, 172686.95894150986 174351.77579850602, 172684.89594078047 174352.3007986814, 172684.8828689878 174352.30412604674, 172683.3009262921 174352.70680236846, 172681.18281584515 174353.24583040207, 172679.3319479569 174353.71579686215, 172677.40094000465 174354.20779888882, 172677.27266865686 174353.73419735025, 172676.77394073328 174351.89280155062, 172676.06193873903 174349.26679423897, 172675.7409324217 174348.08277088706, 172675.25994054292 174346.30780088357, 172675.2596599193 174346.30676614863, 172674.46692653303 174343.38374918967, 172673.58194064876 174340.11780124725, 172672.77094000002 174337.12779888004, 172670.9499049531 174337.60880813404, 172670.52563620973 174337.72080595847, 172669.09919766168 174338.09735505903, 172669.08994002102 174338.09979887708, 172668.25594001057 174338.3197988899, 172663.54094 174339.43779888, 172663.9509396747 174340.9917976469, 172663.95246609734 174340.9975798821, 172664.37093995474 174342.5827987186, 172664.9449393093 174344.75679626403, 172665.47293987044 174346.75879839866, 172665.473080069 174346.7593299183, 172666.08593904617 174349.08279523588, 172666.0860074876 174349.08305431984, 172666.77093856825 174351.67579347026, 172667.44093999997 174354.21779888, 172665.21794001 174354.76179888, 172665.0101183685 174354.8126524625, 172663.37894000002 174355.21179888002, 172663.37873282918 174355.21184957805, 172661.5809427116 174355.65179822646, 172659.15894248072 174356.2437982761, 172656.24094000997 174356.95779889004, 172655.8289405051 174354.98780124754, 172655.30694000996 174352.49479888997, 172654.75393999997 174349.85379887992, 172653.44093999994 174347.26779887994, 172650.79094000012 174346.37779887998, 172649.39294039877 174346.74579877505, 172649.3911846923 174346.7462610297, 172648.1699417751 174347.06779842527, 172643.14494001 174348.38979889, 172642.93389291374 174348.44532466854, 172640.56794000996 174349.06779889, 172640.41789637046 174349.10727144754, 172638.06294 174349.72679888003, 172635.8089427633 174350.319798163, 172634.01694338908 174350.79179799, 172631.56094000998 174351.43779888997, 172631.68094001 174351.69779888, 172630.46894738195 174352.0517967368, 172630.4687520214 174352.05185395735, 172629.2809437475 174352.39979778518, 172627.68094000997 174352.86779889, 172628.10093847304 174354.1197943085, 172628.10107294662 174354.1201945294, 172628.6879379874 174355.86679290008, 172628.68799114702 174355.86695143604, 172629.43093933648 174358.08279688127, 172629.43133035954 174358.0839622848, 172630.24693959064 174360.5147976402, 172630.24792235918 174360.51772822303, 172630.85693939638 174362.3337970801, 172631.76094 174365.02779888996, 172632.43094001003 174364.86779888996, 172632.93494001002 174366.67479888993, 172630.87694000924 174367.2867988902, 172629.35094510994 174367.69579751312, 172629.35049890392 174367.69591735688, 172627.54894514213 174368.17979751158, 172627.52128803954 174368.18721035263, 172625.4409402792 174368.7447988152, 172625.43971959242 174368.74512604062, 172623.82194391786 174369.17879783243, 172621.82194405483 174369.715797794, 172621.82183787943 174369.71582625585, 172620.13194178292 174370.16879840213, 172618.52894290345 174370.59879811114, 172616.85694000009 174371.04679887995, 172613.67694 174372.43679888, 172612.2709414281 174372.87179843814, 172610.70894325845 174373.35479788246, 172608.85694 174373.92679889, 172608.25794049533 174371.89080052968, 172607.82694000003 174370.42679889002, 172607.51030628625 174370.515852122, 172607.38694001004 174370.06679887997, 172607.01194001 174368.70179888996, 172605.61394000004 174369.12679888998, 172604.29194001 174364.49979887996, 172605.79494001003 174364.27579888995, 172604.95794001003 174361.23079889003, 172604.15693999996 174358.31679887997, 172601.3829428521 174359.08279810517, 172600.24729543962 174359.3960325686, 172597.84457264078 174350.6279695617, 172597.51694001004 174350.71679888997, 172593.94294000993 174351.68579889, 172594.4599387648 174353.5957943269, 172594.89194001 174355.18879888, 172594.43694 174355.28679888998, 172595.10393895835 174357.58879525043, 172595.61693890326 174359.35679511022, 172596.36993943545 174361.95579694142, 172596.92693999998 174363.87679887997, 172594.25694 174364.45679887995, 172594.21693999998 174364.31679888006, 172593.00494592657 174364.6537972349, 172593.00452690053 174364.65391402238, 172592.00394302807 174364.932798036, 172590.26894162453 174365.41579843775, 172588.36994388918 174365.94479780665, 172588.36984125132 174365.94482635465, 172586.29894001002 174366.52079888002, 172585.7109407086 174364.2888015419, 172585.71082483808 174364.2883622034, 172585.01994076036 174361.66880173524, 172584.8667329185 174361.0872324162, 172584.37794 174359.23179888996, 172583.4569404406 174355.73580051467, 172582.56193999999 174352.34079887997, 172581.81194 174349.49579887997, 172578.96056568567 174350.36739802494, 172585.1382444169 174374.19050227254, 172585.0614705477 174374.21335843968, 172585.18994 174374.69679888996, 172581.69994000997 174375.73579888, 172581.62350512363 174375.3929519558, 172581.93994000004 174374.65479888, 172582.48094 174373.39279888003, 172580.61794 174366.54279888, 172576.77667659082 174367.3948403584, 172578.3008907684 174373.35775476237, 172578.52405885607 174374.23071513322, 172580.47195049844 174381.85118837637, 172580.4625612569 174381.85333750857, 172580.58694000004 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888003, 172576.23194 174376.15679888002, 172575.20993999997 174372.55179889, 172573.66458694366 174372.8308626458, 172574.0934668556 174374.3819471337, 172574.33365876754 174375.25074680167, 172574.7994377378 174376.93505831185, 172574.46694027368 174377.10679874866, 172573.55473542705 174377.38586125555, 172571.95794220705 174377.87279822002, 172569.12694000997 174378.73679888004, 172570.29693999997 174382.59679888, 172569.06894000657 174382.95779888806, 172568.98899089158 174382.9810527852, 172567.62494267538 174383.37779810186, 172566.1759413303 174383.7987985035, 172564.9709467131 174384.14879693012, 172563.53494001646 174384.5647988781, 172562.23594001002 174384.94279888997, 172561.03905731053 174385.28960586703, 172554.56188284606 174386.74853914225, 172555.21404284242 174388.99244314435, 172557.3838523062 174396.45835165278)),((172739.38594000007 174460.04779889, 172739.39373637483 174460.04610350684, 172739.392673916 174460.04121769255, 172739.3870486459 174460.03837656736, 172739.38261013498 174460.0403655549, 172739.3807950899 174460.03631378766, 172739.37623201194 174460.03835788142, 172739.37262919155 174460.04530889943, 172739.37358944913 174460.05021582366, 172739.3858038434 174460.04782553512, 172739.3859399994 174460.04779889015, 172739.38594000007 174460.04779889)))') - result = safe_difference(polygon_a, polygon_b) #GEOS exception is catched + polygon_a = from_wkt( + "MULTIPOLYGON(((172767.25694 174472.63279888, 172766.30994001 174470.77679888, 172765.64794001 174469.48679888, 172766.51694001 174469.12679888, 172765.12794 174466.03679889, 172764.34694001 174466.34679888, 172762.84694001 174463.15679888, 172764.28394001 174462.46479889, 172765.32594 174461.96179888, 172761.13894 174453.29579888, 172760.09694001 174451.01679889, 172759.79494001 174450.12279889, 172760.93594001 174449.76179888, 172761.82594 174450.27579889, 172762.67394001 174449.91179889, 172765.15694 174448.84679888, 172764.19994001 174445.99879888, 172764.60994 174445.80279889, 172764.33894001 174444.31479888, 172763.51694001 174441.74179888, 172763.21994 174440.02779889, 172761.17694 174440.68879888, 172759.74794001 174436.70479888, 172759.02694001 174436.93979888, 172756.96694 174437.61179889, 172755.11894001 174438.21379888, 172754.95694001 174437.62679889, 172754.60694 174436.35679889, 172756.19994001 174435.93579889, 172758.35594 174435.36579889, 172760.84694001 174434.70679888, 172760.58894001 174433.53579888, 172760.14694 174431.53679889, 172759.53294 174429.60779888, 172759.38494 174428.15179888, 172759.12694001 174427.54679888, 172758.76694001 174426.28679889, 172758.12194001 174424.02879888, 172758.32294 174423.95879888, 172758.05194 174421.82179889, 172756.64394001 174422.12379888, 172755.98194 174422.32379889, 172755.12694001 174419.48579888, 172753.83594001 174419.79579889, 172752.49394001 174414.58679888, 172751.20794001 174414.83379888, 172750.65294001 174412.80779888, 172748.95294001 174413.24779889, 172748.47294 174411.39879889, 172753.23294001 174410.11879888, 172752.77094 174408.42079889, 172752.20594 174406.34079888, 172751.57694 174404.02979888, 172750.94994001 174401.72379889, 172750.44494 174399.86779889, 172749.65394 174396.95879888, 172749.08794 174394.87879889, 172750.24394001 174394.48479888, 172751.79494001 174393.68579889, 172753.32194001 174392.89979888, 172754.02694001 174394.06179888, 172759.86194001 174390.84279888, 172760.84694001 174392.75779888, 172762.75294 174391.80779888, 172764.67794001 174390.84979888, 172767.03494001 174389.67579888, 172769.10394001 174388.64579888, 172770.82694 174387.78779888, 172772.41294001 174387.00179889, 172771.70694001 174385.58179888, 172770.47494001 174383.10379888, 172769.86494001 174381.87779888, 172769.31094001 174380.77179889, 172768.51694001 174379.18579889, 172767.43494001 174377.02279888, 172766.27794001 174374.71279889, 172765.78994 174373.61879888, 172765.24294 174372.39279888, 172764.56294 174370.86879888, 172763.48394 174368.72379889, 172762.58994001 174366.94779889, 172761.36994 174364.52279888, 172760.27094 174362.33879888, 172759.15994001 174360.12979888, 172757.85194 174357.53079889, 172752.91594 174345.84979888, 172752.44494 174344.50079888, 172751.68294 174342.55779888, 172750.88594 174340.52579889, 172749.87694001 174337.94779888, 172748.82694 174335.20279888, 172747.72094 174332.38879888, 172746.51294001 174329.31579889, 172745.36494001 174326.39779888, 172743.82194001 174322.47179888, 172742.68394 174319.57579888, 172739.86294 174320.46079888, 172737.67194 174320.96779888, 172736.12194001 174321.39879889, 172733.90294001 174322.01479889, 172731.21594 174322.76179888, 172729.70094 174323.15779889, 172729.10494001 174323.34879888, 172727.50294 174323.86079888, 172724.60494001 174324.78679888, 172719.82894001 174326.31279889, 172720.17794001 174327.77779889, 172720.41094 174328.75779888, 172720.82494001 174330.49979889, 172721.08494 174331.56079889, 172721.42594 174332.98579888, 172721.70594 174334.18179888, 172722.03394001 174335.51479889, 172722.60994 174337.84979888, 172723.15794 174340.07079888, 172719.07994 174341.35879889, 172719.00094001 174340.49779889, 172718.62994001 174340.60179888, 172717.50294 174340.91679888, 172714.97094 174341.62679888, 172714.17294 174341.84979888, 172712.47094 174342.32679888, 172710.41394001 174342.90279889, 172708.33894001 174343.48379889, 172705.43894001 174344.29679888, 172702.72094 174345.05779888, 172703.36294 174347.25779888, 172703.90994001 174349.13479888, 172702.14294 174349.59779889, 172700.29694 174350.08079888, 172697.39194001 174350.83979889, 172695.26994001 174351.39479888, 172694.94394 174349.74379888, 172692.57994 174350.34579889, 172689.68394 174351.08279889, 172686.95894 174351.77579889, 172684.89594 174352.30079888, 172683.30094 174352.70679888, 172681.18294 174353.24579888, 172679.33194001 174353.71579888, 172677.40094 174354.20779889, 172676.77394001 174351.89279888, 172676.06194 174349.26679889, 172675.74094001 174348.08279889, 172675.25994 174346.30779888, 172674.46694 174343.38379889, 172673.58194001 174340.11779889, 172672.77094 174337.12779888, 172670.94994001 174337.60879888, 172669.08994001 174338.09979888, 172668.25594001 174338.31979889, 172663.54094 174339.43779888, 172663.95094 174340.99179888, 172664.37094 174342.58279889, 172664.94494 174344.75679888, 172665.47294 174346.75879889, 172666.08594001 174349.08279889, 172666.77094 174351.67579889, 172667.44094 174354.21779888, 172665.21794001 174354.76179888, 172663.37894 174355.21179888, 172661.58094 174355.65179889, 172659.15894001 174356.24379888, 172656.24094001 174356.95779889, 172655.82894001 174354.98779888, 172655.30694001 174352.49479889, 172654.75394 174349.85379888, 172653.44094 174347.26779888, 172650.79094 174346.37779888, 172649.39294 174346.74579888, 172648.16994001 174347.06779889, 172643.14494001 174348.38979889, 172640.56794001 174349.06779889, 172638.06294 174349.72679888, 172635.80894 174350.31979889, 172634.01694001 174350.79179888, 172631.56094001 174351.43779889, 172631.68094001 174351.69779888, 172630.46894001 174352.05179889, 172629.28094001 174352.39979888, 172627.68094001 174352.86779889, 172628.10094001 174354.11979889, 172628.68794 174355.86679889, 172629.43094001 174358.08279889, 172630.24694001 174360.51479889, 172630.85694 174362.33379888, 172631.76094 174365.02779889, 172632.43094001 174364.86779889, 172632.93494001 174366.67479889, 172630.87694001 174367.28679889, 172629.35094001 174367.69579888, 172627.54894001 174368.17979889, 172625.44094 174368.74479889, 172623.82194001 174369.17879888, 172621.82194001 174369.71579888, 172620.13194 174370.16879888, 172618.52894 174370.59879889, 172616.85694 174371.04679888, 172613.67694 174372.43679888, 172612.27094 174372.87179888, 172610.70894 174373.35479889, 172608.85694 174373.92679889, 172608.25794001 174371.89079888, 172607.82694 174370.42679889, 172607.50694 174370.51679889, 172607.38694001 174370.06679888, 172607.01194001 174368.70179889, 172605.61394 174369.12679889, 172604.29194001 174364.49979888, 172605.79494001 174364.27579889, 172604.95794001 174361.23079889, 172604.15694 174358.31679888, 172601.38294001 174359.08279889, 172599.73694001 174359.53679889, 172599.03094001 174356.96479888, 172598.45694001 174354.87679889, 172598.31094001 174353.65579888, 172597.92494001 174352.22579889, 172597.51694001 174350.71679889, 172593.94294001 174351.68579889, 172594.45994 174353.59579889, 172594.89194001 174355.18879888, 172594.43694 174355.28679889, 172595.10394001 174357.58879888, 172595.61694 174359.35679889, 172596.36994 174361.95579889, 172596.92694 174363.87679888, 172594.25694 174364.45679888, 172594.21694 174364.31679888, 172593.00494001 174364.65379888, 172592.00394 174364.93279888, 172590.26894 174365.41579889, 172588.36994 174365.94479889, 172586.29894001 174366.52079888, 172585.71094001 174364.28879889, 172585.01994001 174361.66879889, 172584.37794 174359.23179889, 172583.45694001 174355.73579888, 172582.56194 174352.34079888, 172581.81194 174349.49579888, 172578.83494 174350.40579889, 172579.40794 174352.63579888, 172579.78994 174354.11679888, 172580.28794001 174356.05279889, 172580.77094 174357.92779888, 172581.47694 174360.66679888, 172581.97094 174362.58679888, 172582.24294 174363.61779889, 172582.54194001 174364.74379888, 172582.91294001 174366.13879888, 172583.24094001 174367.37179888, 172583.56894 174368.60379888, 172583.98394 174370.16379889, 172584.46094001 174371.95479888, 172584.86494001 174373.47379888, 172585.18994 174374.69679889, 172581.69994001 174375.73579888, 172581.45894 174374.65479888, 172581.93994 174374.65479888, 172582.48094 174373.39279888, 172580.61794 174366.54279888, 172576.54694 174367.44579888, 172576.96094001 174368.82979888, 172577.49594 174370.61579889, 172578.20294001 174372.70579888, 172578.57394 174374.21879889, 172578.69794 174374.72879888, 172578.94194001 174375.71979888, 172579.21594 174376.83779888, 172579.48694001 174377.94179888, 172579.78194 174379.14479889, 172580.08194001 174380.37079888, 172580.58694 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888, 172576.23194 174376.15679888, 172575.20994 174372.55179889, 172573.66494 174372.83079889, 172574.33394 174375.25079888, 172574.79994001 174376.93479888, 172574.46694 174377.10679889, 172573.55494 174377.38579888, 172571.95794001 174377.87279889, 172569.12694001 174378.73679888, 172570.29694 174382.59679888, 172569.06894 174382.95779889, 172567.62494 174383.37779888, 172566.17594 174383.79879889, 172564.97094 174384.14879888, 172563.53494001 174384.56479888, 172562.23594001 174384.94279889, 172561.03494001 174385.29079889, 172559.35194 174385.66979888, 172558.39794001 174385.88479888, 172556.63694001 174386.28179888, 172554.56194 174386.74879888, 172554.93394 174388.02679888, 172555.33194001 174389.39779888, 172555.78394001 174390.95079888, 172556.25094001 174392.55979888, 172556.78094001 174394.38279888, 172557.38394001 174396.45779889, 172555.12994001 174410.66979888, 172554.04194001 174412.21079889, 172554.18094001 174413.74279889, 172554.35894 174415.69279889, 172554.59094 174418.23979888, 172554.80294001 174420.57479888, 172555.02794001 174423.04279888, 172555.93294 174422.97279889, 172557.54494001 174422.84879889, 172560.00094001 174422.89679889, 172562.04294 174422.83779889, 172563.99094001 174422.77979888, 172565.29094 174422.74079889, 172567.21594 174422.68179889, 172569.10194 174422.62379888, 172568.98294001 174421.27879888, 172568.88094001 174420.13579889, 172568.73194 174418.45579889, 172568.45294001 174415.31879888, 172570.64394 174415.21279889, 172570.64394001 174420.55979889, 172572.08594001 174420.43979888, 172572.08594001 174421.46179888, 172572.89894001 174421.52179889, 172572.93594001 174418.69679889, 172572.92794001 174415.53279888, 172575.20994 174415.51279889, 172575.27294001 174421.23079888, 172577.66994001 174421.37079888, 172577.71794001 174420.68179889, 172577.72494001 174418.93679889, 172577.73594001 174415.93279888, 172580.01694001 174415.87379888, 172579.83694 174420.49979889, 172581.27894 174420.49979889, 172581.16094 174421.60179888, 172582.17694 174421.66979888, 172582.13594 174422.43279888, 172582.06294 174423.81779889, 172581.85494001 174425.10579888, 172581.54394 174425.96979888, 172582.27094 174425.90879888, 172583.34994001 174425.81679888, 172584.44594001 174425.72479888, 172585.57394 174425.43879889, 172587.27294001 174425.00679888, 172589.82794001 174424.35879889, 172589.40294001 174423.53179888, 172589.03494001 174422.06079888, 172588.59694001 174420.30879889, 172588.35594 174419.34679888, 172587.97694 174417.82879889, 172587.78294 174417.05679889, 172587.61594001 174415.77979888, 172587.36494001 174414.35979888, 172587.75394 174413.42079888, 172587.86994 174411.44879889, 172592.26794 174410.32279888, 172592.57794001 174412.11779889, 172593.54694 174411.85679889, 172593.88294001 174413.17479889, 172596.71694 174412.45279888, 172597.50594001 174415.42779888, 172593.94094 174416.36279888, 172594.31794001 174417.67579888, 172595.57994 174417.37579888, 172595.88594 174418.96979888, 172599.56994 174418.29279888, 172600.39494001 174421.68079888, 172599.12494 174422.00279888, 172597.83994001 174422.32779888, 172595.25594001 174422.98279888, 172595.67794001 174424.90679888, 172598.81094001 174424.21879889, 172599.32294 174426.26379888, 172599.83994001 174428.32779888, 172600.28294 174430.09379889, 172599.53294 174430.30379888, 172598.94794 174431.12079888, 172598.50794001 174431.73679888, 172598.17194 174432.53079888, 172597.70394001 174433.63779889, 172598.26694001 174435.35479889, 172601.68394 174434.46579888, 172602.63794001 174437.85679889, 172603.52094 174441.33179888, 172604.18794 174443.95879889, 172607.05394 174443.20479888, 172608.01694001 174447.05779888, 172602.61494001 174448.18279888, 172603.57694 174451.96779888, 172591.37294001 174454.98979888, 172593.09694001 174460.86279888, 172596.00694 174460.12279889, 172599.45294001 174459.24579888, 172605.06394001 174457.81879888, 172608.39694 174456.97079889, 172613.56094001 174455.65679888, 172614.32594 174458.77479888, 172609.11894001 174459.86879888, 172606.47194001 174460.59979888, 172604.45794001 174461.15679888, 172605.34094 174464.77179889, 172607.57394 174464.20979889, 172609.99094001 174463.60579889, 172613.07994 174462.83479889, 172613.61894001 174464.88379889, 172614.04994001 174466.51979889, 172614.37794 174467.76679889, 172612.53894001 174468.36579889, 172611.16394001 174468.81479888, 172608.52994 174469.67379888, 172609.11194001 174471.76679889, 172609.56494 174473.39879889, 172612.91294001 174485.56179888, 172614.59894 174485.11079888, 172617.38894 174484.36379889, 172622.33194001 174483.04179888, 172625.99594 174482.06079889, 172629.84294001 174481.03179888, 172641.95194 174477.65279889, 172643.75494001 174477.16979888, 172645.38894 174476.73279888, 172647.53094001 174476.15979889, 172649.87894 174475.53179888, 172652.14894001 174474.92479889, 172655.08794 174474.13879889, 172656.82294 174473.67479889, 172659.20494 174473.03779889, 172661.12994001 174472.52279888, 172663.13094001 174471.98779888, 172666.07294 174471.20079888, 172669.09894 174470.39179889, 172670.32794001 174470.07579888, 172672.24694001 174469.58179889, 172673.91894 174469.15179888, 172674.58694 174468.84879889, 172675.52994 174468.59879889, 172677.88094001 174467.97779889, 172680.51794 174467.28079889, 172683.39194001 174466.52079888, 172686.88994 174465.59579889, 172690.08694 174464.75079888, 172693.60394001 174463.82179889, 172694.71594 174465.90079889, 172695.81494 174467.95779889, 172696.76694001 174469.73679889, 172698.74294 174473.43379889, 172700.00894001 174475.80279888, 172701.21194 174478.05279888, 172702.29394 174480.07679889, 172712.67294 174477.65879888, 172714.31294 174477.23479888, 172715.92294 174476.81879889, 172718.15094 174476.24279889, 172719.85594 174475.80279888, 172719.07394 174472.68079888, 172722.78994 174471.85879889, 172723.62094 174471.64979888, 172726.34994001 174470.96079888, 172727.68494001 174470.62379888, 172728.34494 174470.45779889, 172728.94594001 174470.31079889, 172729.36494001 174470.20779889, 172733.29694 174468.74879888, 172732.51594001 174463.94179888, 172736.18094001 174462.86079888, 172736.12094 174460.75779888, 172739.38594 174460.04779889, 172751.74194 174457.62979889, 172752.52594 174459.31079889, 172753.47194001 174461.34079888, 172754.32394 174463.17079889, 172755.22994001 174465.11479888, 172756.45494 174467.74379888, 172757.91194 174470.86979889, 172759.17194 174473.57379889, 172760.30194 174475.99779889, 172767.25694 174472.63279888)))" + ) + polygon_b = from_wkt( + "MULTIPOLYGON(((172557.3838523062 174396.45835165278, 172555.12905084348 174410.6693711578, 172554.04105084387 174412.2103631608, 172554.28937084228 174414.93676316369, 172555.0277388468 174423.0425551683, 172563.7369228527 174422.37100316587, 172569.0432908535 174421.9618511684, 172568.4963957805 174415.81728130922, 172568.4972705121 174415.81723898993, 172568.45294000994 174415.31879887995, 172570.64394 174415.21279888996, 172570.64394001 174420.55979889, 172572.08594000997 174420.43979888, 172572.08594000997 174420.94152719184, 172572.77495595193 174420.8841888285, 172572.71193637606 174416.03471118974, 172572.929204253 174416.03280700246, 172572.92794000998 174415.53279887998, 172575.20994000003 174415.51279889, 172575.27294001004 174421.23079888, 172577.6697196799 174421.37078601134, 172577.70199362023 174416.43384416474, 172577.73410833202 174416.4330134905, 172577.7358131635 174415.9674395041, 172577.73594001 174415.93279888004, 172578.87644000998 174415.90329888, 172580.01694000998 174415.87379888, 172579.83694 174420.49979889003, 172581.27894 174420.49979889003, 172581.22540097954 174420.99979889003, 172582.22334147422 174420.99979889003, 172582.17621886 174421.66917916582, 172582.0176908598 174424.652603168, 172581.5430028588 174425.96959516776, 172581.36988285926 174426.44985117015, 172583.22229886055 174426.393211171, 172584.53372231862 174426.04524331444, 172585.60137086362 174425.76191516966, 172589.6888588667 174424.67730716988, 172588.59657086435 174420.30905116722, 172587.97628287587 174417.82828320874, 172587.62773886323 174416.44255516306, 172587.57641086724 174416.43890716136, 172587.6150668636 174415.78034716102, 172587.75349886715 174413.420987159, 172587.86921086907 174411.4484431595, 172591.77150026744 174410.4497097941, 172592.26794067942 174410.3228028141, 172592.57794001006 174412.11779889002, 172593.54694000003 174411.85679889002, 172593.88294001002 174413.17479889, 172596.71693999998 174412.45279888005, 172597.50594000999 174415.42779887991, 172597.172895412 174415.51514718245, 172597.022295644 174415.5546452982, 172597.0224054087 174415.55505917643, 172593.93199883454 174416.33165895962, 172593.94094 174416.36279887997, 172594.31794001002 174417.67579888002, 172595.57994 174417.37579888004, 172595.88594000004 174418.96979887996, 172599.56993999996 174418.29279888, 172600.39494000998 174421.68079888003, 172599.91025387176 174421.80368780546, 172599.94715650496 174421.95523461731, 172596.69628287107 174422.8178511672, 172595.3009759594 174423.18812865848, 172595.67794001 174424.90679888, 172598.81094000905 174424.2187988902, 172598.92996166085 174424.6941881079, 172599.32293973575 174426.26379782447, 172599.32319430308 174426.26481412462, 172599.83993917855 174428.32779556068, 172600.28294000003 174430.09379889, 172599.53294 174430.30379888, 172598.9479399949 174431.12079888713, 172598.50794000993 174431.73679888, 172598.17194137024 174432.53079564194, 172597.70394001 174433.63779889003, 172598.2660748735 174435.35474717614, 172601.1998381591 174434.5913030442, 172601.19995467947 174434.5917172166, 172601.68394000002 174434.46579888, 172602.63794000942 174437.85679888783, 172603.5209395613 174441.3317971537, 172603.67147661696 174441.92469197488, 172604.18799165756 174443.95900234475, 172607.0539523896 174443.2048484512, 172608.01694001004 174447.05779888, 172602.61494001004 174448.18279888007, 172603.57694000003 174451.96779887998, 172591.37294001 174454.98979887998, 172593.09693550566 174460.86278353556, 172605.0632588789 174457.8183631897, 172608.39689087868 174456.97023519131, 172613.0762718963 174455.77972994547, 172613.07636302974 174455.78010138884, 172613.56094001004 174455.65679887997, 172614.32594000004 174458.77479888004, 172609.11894000994 174459.86879888005, 172606.47194360537 174460.59979788712, 172604.45794001 174461.15679888, 172605.3409823247 174464.7719721671, 172612.59480380098 174462.95596724018, 172612.7014123517 174462.92927763195, 172613.07994000003 174462.83479889008, 172613.61893907966 174464.88379535347, 172613.6189968665 174464.88401470726, 172614.04993903125 174466.51979517483, 172614.37794 174467.76679889, 172612.53894704106 174468.36579659986, 172612.53852629993 174468.36593398513, 172611.16394366286 174468.81479768714, 172608.52993999998 174469.67379888, 172609.11193880375 174471.76679455204, 172609.11197085044 174471.76690999718, 172609.56229931235 174473.38928541902, 172609.5649399964 174473.3987988771, 172612.91284623384 174485.5614581992, 172616.49161088464 174484.6038992107, 172617.37810321042 174484.36670035287, 172617.3781038362 174484.3667001854, 172617.40430078932 174484.35969066346, 172621.91801405355 174483.1519558644, 172625.84397284017 174482.10148660126, 172626.28639576584 174481.983107446, 172629.84245889643 174481.0316112079, 172629.84260632202 174481.0318919951, 172641.95148947238 174477.65292460908, 172641.9513229055 174477.65228320664, 172643.55453783524 174477.22348398916, 172649.45557890835 174475.6451792046, 172652.118800357 174474.93285825956, 172655.08757891503 174474.13881120458, 172669.09820291854 174470.39141919912, 172673.91823492196 174469.15141920003, 172674.05039449205 174469.04677954124, 172674.1582349241 174468.9614031985, 172675.5150722086 174468.60274051016, 172675.58914901028 174468.58315924928, 172676.93838271403 174468.22650647085, 172685.4841995281 174465.9675284286, 172690.08649093658 174464.75097119805, 172690.35773174433 174464.679270439, 172693.6036109403 174463.82124319673, 172695.45967493954 174467.2931151986, 172695.69615282057 174467.73546474247, 172695.8858936043 174468.09038905406, 172702.29378802062 174480.0768342967, 172712.67227422315 174477.65895398633, 172712.67215495606 174477.6584912053, 172719.8562189564 174475.80549920353, 172719.13622944942 174473.1791069913, 172719.19547385076 174473.1660017983, 172719.07393999997 174472.68079888003, 172722.78994000095 174471.8587988898, 172723.6209313099 174471.64980106562, 172723.62116079254 174471.6497431358, 172726.34993987996 174470.9607989128, 172727.68514120538 174470.623748284, 172728.34493999486 174470.45779889126, 172728.94593998056 174470.3107988972, 172729.36494001048 174470.20779888984, 172733.29694 174468.74879888006, 172732.51594000997 174463.94179888, 172736.18094000997 174462.86079888, 172736.12094 174460.75779888, 172739.38593999937 174460.04779889015, 172751.74194 174457.62979889003, 172751.82374942137 174457.8052091417, 172760.30108298364 174475.9976912029, 172767.25628262636 174472.6322513803, 172767.5851149932 174472.47314720228, 172767.50690699372 174472.13401120156, 172767.1188087445 174472.3620791199, 172766.30993999983 174470.7767988602, 172765.64794001004 174469.48679887998, 172766.51694001004 174469.12679887997, 172765.12794 174466.03679888998, 172764.34694001 174466.34679888003, 172762.84694005293 174463.15679897126, 172763.29320167168 174462.94189765144, 172764.2839314731 174462.46480300103, 172765.32593999998 174461.96179887993, 172761.1385378274 174453.29491927216, 172761.13853782744 174453.29491927216, 172760.09694000988 174451.01679888976, 172759.79494001003 174450.12279889, 172760.93594000998 174449.76179888003, 172761.82593999995 174450.27579889004, 172762.67400122888 174449.91177263303, 172765.15694 174448.84679888003, 172764.19994000997 174445.99879888, 172764.60994001062 174445.80279888492, 172764.33894001 174444.31479887993, 172763.51689098784 174441.74149918192, 172763.5168882326 174441.74150007046, 172763.51688823258 174441.74150007026, 172763.21993999998 174440.02779889002, 172761.17694 174440.68879888, 172759.74790522835 174436.7047019099, 172755.11890209024 174438.21366147915, 172754.95691696025 174437.6267152474, 172754.85751089564 174437.26601325686, 172754.6069400003 174436.3567988909, 172755.10336595034 174436.22560282986, 172756.19993908802 174435.93579913364, 172758.35593845724 174435.36579929787, 172760.84694000997 174434.70679888004, 172760.58894161868 174433.5358061814, 172760.14693999995 174431.53679888978, 172759.5329400001 174429.6077988801, 172759.52534339868 174429.53306474834, 172759.48582006822 174429.1442406328, 172759.76815493542 174429.05234718855, 172759.7528128644 174429.0162936086, 172759.12745483534 174427.54860076858, 172759.12745462733 174427.54860004058, 172759.1267469823 174427.54693917185, 172759.12695293076 174427.54684410253, 172758.76693612643 174426.28678529424, 172758.12194001 174424.02879888, 172758.32293999995 174423.95879888002, 172758.05193999998 174421.82179889004, 172756.6439400104 174422.12379887994, 172756.53950232168 174422.15535105282, 172755.98194000003 174422.32379888996, 172755.12451175836 174419.47773878835, 172753.83321806323 174419.78523359896, 172752.4939518636 174414.58684488994, 172751.20706697553 174414.83333916217, 172750.73129098117 174412.7877071612, 172748.95247497407 174413.2481231615, 172748.47247497732 174411.39813916016, 172753.23247498277 174410.11813915893, 172751.57647497955 174404.02937115356, 172750.80501897636 174401.19289115068, 172749.21920579113 174395.36230315745, 172749.2194832201 174395.36220860117, 172749.08793999997 174394.87879889001, 172750.24394001003 174394.48479888003, 172751.79493705663 174393.68580041145, 172753.32194001004 174392.89979888, 172754.02694001 174394.06179887996, 172759.86194000999 174390.84279887998, 172760.84694001003 174392.75779887996, 172762.75293454644 174391.80780159816, 172762.7540957816 174391.80722369105, 172764.6779369368 174390.84980040943, 172767.0349380484 174389.675799857, 172769.10393896094 174388.64579940226, 172770.8269400001 174387.78779888, 172772.41231297184 174387.0021096416, 172769.92245898946 174381.99321113512, 172769.86473163788 174381.87794843127, 172766.27740298968 174374.71225113448, 172766.12751504182 174374.37625125528, 172765.45154720507 174372.86111561494, 172764.5623949914 174370.86834713045, 172758.44661898166 174358.71346712485, 172758.08089647835 174357.9866221479, 172758.0812897689 174357.9865175769, 172757.8519399999 174357.5307988898, 172754.4110373197 174349.3873883099, 172754.41083817216 174349.3874620819, 172754.04609390008 174348.52429801252, 172753.7164504677 174347.74419976756, 172753.71289365587 174347.7351269625, 172752.91599497944 174345.84914711493, 172752.96828298277 174345.83532311398, 172752.74697099614 174345.2712271516, 172750.88521097507 174340.5253711095, 172749.90261897308 174337.94073110458, 172742.68309897187 174319.57548309487, 172729.2444429621 174323.76869909838, 172729.1040909663 174323.3482191004, 172719.76546695834 174325.91705109927, 172721.48245895657 174332.9833551049, 172723.08294328308 174339.57013976108, 172723.03791828503 174339.58436050604, 172723.15793999998 174340.07079887998, 172719.07994 174341.35879888994, 172719.0331842302 174340.8492201192, 172718.5874979483 174340.98998616525, 172718.5534989536 174340.6227151118, 172714.9709069505 174341.62623511252, 172702.72073094547 174345.05746711424, 172703.20898694542 174346.73209111392, 172703.9096589461 174349.13503511623, 172695.26953093708 174351.39500311756, 172694.93771905327 174349.74538306356, 172692.57990415473 174350.34580801197, 172692.57334559556 174350.34747709305, 172689.68390132912 174351.0828087242, 172689.6768192437 174351.08460978328, 172686.95894150986 174351.77579850602, 172684.89594078047 174352.3007986814, 172684.8828689878 174352.30412604674, 172683.3009262921 174352.70680236846, 172681.18281584515 174353.24583040207, 172679.3319479569 174353.71579686215, 172677.40094000465 174354.20779888882, 172677.27266865686 174353.73419735025, 172676.77394073328 174351.89280155062, 172676.06193873903 174349.26679423897, 172675.7409324217 174348.08277088706, 172675.25994054292 174346.30780088357, 172675.2596599193 174346.30676614863, 172674.46692653303 174343.38374918967, 172673.58194064876 174340.11780124725, 172672.77094000002 174337.12779888004, 172670.9499049531 174337.60880813404, 172670.52563620973 174337.72080595847, 172669.09919766168 174338.09735505903, 172669.08994002102 174338.09979887708, 172668.25594001057 174338.3197988899, 172663.54094 174339.43779888, 172663.9509396747 174340.9917976469, 172663.95246609734 174340.9975798821, 172664.37093995474 174342.5827987186, 172664.9449393093 174344.75679626403, 172665.47293987044 174346.75879839866, 172665.473080069 174346.7593299183, 172666.08593904617 174349.08279523588, 172666.0860074876 174349.08305431984, 172666.77093856825 174351.67579347026, 172667.44093999997 174354.21779888, 172665.21794001 174354.76179888, 172665.0101183685 174354.8126524625, 172663.37894000002 174355.21179888002, 172663.37873282918 174355.21184957805, 172661.5809427116 174355.65179822646, 172659.15894248072 174356.2437982761, 172656.24094000997 174356.95779889004, 172655.8289405051 174354.98780124754, 172655.30694000996 174352.49479888997, 172654.75393999997 174349.85379887992, 172653.44093999994 174347.26779887994, 172650.79094000012 174346.37779887998, 172649.39294039877 174346.74579877505, 172649.3911846923 174346.7462610297, 172648.1699417751 174347.06779842527, 172643.14494001 174348.38979889, 172642.93389291374 174348.44532466854, 172640.56794000996 174349.06779889, 172640.41789637046 174349.10727144754, 172638.06294 174349.72679888003, 172635.8089427633 174350.319798163, 172634.01694338908 174350.79179799, 172631.56094000998 174351.43779888997, 172631.68094001 174351.69779888, 172630.46894738195 174352.0517967368, 172630.4687520214 174352.05185395735, 172629.2809437475 174352.39979778518, 172627.68094000997 174352.86779889, 172628.10093847304 174354.1197943085, 172628.10107294662 174354.1201945294, 172628.6879379874 174355.86679290008, 172628.68799114702 174355.86695143604, 172629.43093933648 174358.08279688127, 172629.43133035954 174358.0839622848, 172630.24693959064 174360.5147976402, 172630.24792235918 174360.51772822303, 172630.85693939638 174362.3337970801, 172631.76094 174365.02779888996, 172632.43094001003 174364.86779888996, 172632.93494001002 174366.67479888993, 172630.87694000924 174367.2867988902, 172629.35094510994 174367.69579751312, 172629.35049890392 174367.69591735688, 172627.54894514213 174368.17979751158, 172627.52128803954 174368.18721035263, 172625.4409402792 174368.7447988152, 172625.43971959242 174368.74512604062, 172623.82194391786 174369.17879783243, 172621.82194405483 174369.715797794, 172621.82183787943 174369.71582625585, 172620.13194178292 174370.16879840213, 172618.52894290345 174370.59879811114, 172616.85694000009 174371.04679887995, 172613.67694 174372.43679888, 172612.2709414281 174372.87179843814, 172610.70894325845 174373.35479788246, 172608.85694 174373.92679889, 172608.25794049533 174371.89080052968, 172607.82694000003 174370.42679889002, 172607.51030628625 174370.515852122, 172607.38694001004 174370.06679887997, 172607.01194001 174368.70179888996, 172605.61394000004 174369.12679888998, 172604.29194001 174364.49979887996, 172605.79494001003 174364.27579888995, 172604.95794001003 174361.23079889003, 172604.15693999996 174358.31679887997, 172601.3829428521 174359.08279810517, 172600.24729543962 174359.3960325686, 172597.84457264078 174350.6279695617, 172597.51694001004 174350.71679888997, 172593.94294000993 174351.68579889, 172594.4599387648 174353.5957943269, 172594.89194001 174355.18879888, 172594.43694 174355.28679888998, 172595.10393895835 174357.58879525043, 172595.61693890326 174359.35679511022, 172596.36993943545 174361.95579694142, 172596.92693999998 174363.87679887997, 172594.25694 174364.45679887995, 172594.21693999998 174364.31679888006, 172593.00494592657 174364.6537972349, 172593.00452690053 174364.65391402238, 172592.00394302807 174364.932798036, 172590.26894162453 174365.41579843775, 172588.36994388918 174365.94479780665, 172588.36984125132 174365.94482635465, 172586.29894001002 174366.52079888002, 172585.7109407086 174364.2888015419, 172585.71082483808 174364.2883622034, 172585.01994076036 174361.66880173524, 172584.8667329185 174361.0872324162, 172584.37794 174359.23179888996, 172583.4569404406 174355.73580051467, 172582.56193999999 174352.34079887997, 172581.81194 174349.49579887997, 172578.96056568567 174350.36739802494, 172585.1382444169 174374.19050227254, 172585.0614705477 174374.21335843968, 172585.18994 174374.69679888996, 172581.69994000997 174375.73579888, 172581.62350512363 174375.3929519558, 172581.93994000004 174374.65479888, 172582.48094 174373.39279888003, 172580.61794 174366.54279888, 172576.77667659082 174367.3948403584, 172578.3008907684 174373.35775476237, 172578.52405885607 174374.23071513322, 172580.47195049844 174381.85118837637, 172580.4625612569 174381.85333750857, 172580.58694000004 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888003, 172576.23194 174376.15679888002, 172575.20993999997 174372.55179889, 172573.66458694366 174372.8308626458, 172574.0934668556 174374.3819471337, 172574.33365876754 174375.25074680167, 172574.7994377378 174376.93505831185, 172574.46694027368 174377.10679874866, 172573.55473542705 174377.38586125555, 172571.95794220705 174377.87279822002, 172569.12694000997 174378.73679888004, 172570.29693999997 174382.59679888, 172569.06894000657 174382.95779888806, 172568.98899089158 174382.9810527852, 172567.62494267538 174383.37779810186, 172566.1759413303 174383.7987985035, 172564.9709467131 174384.14879693012, 172563.53494001646 174384.5647988781, 172562.23594001002 174384.94279888997, 172561.03905731053 174385.28960586703, 172554.56188284606 174386.74853914225, 172555.21404284242 174388.99244314435, 172557.3838523062 174396.45835165278)),((172739.38594000007 174460.04779889, 172739.39373637483 174460.04610350684, 172739.392673916 174460.04121769255, 172739.3870486459 174460.03837656736, 172739.38261013498 174460.0403655549, 172739.3807950899 174460.03631378766, 172739.37623201194 174460.03835788142, 172739.37262919155 174460.04530889943, 172739.37358944913 174460.05021582366, 172739.3858038434 174460.04782553512, 172739.3859399994 174460.04779889015, 172739.38594000007 174460.04779889)))" + ) + result = safe_difference(polygon_a, polygon_b) # GEOS exception is catched self.assertTrue(result.is_valid) - - - - def test_safe_symmetric_difference(self): """Tests safe_symmetric_difference with two disjoint polygons.""" polygon_a = Polygon([(0, 0), (1, 0), (1, 1), (0, 1)]) @@ -100,9 +111,15 @@ def test_safe_symmetric_difference(self): def test_safe_symmetric_difference_geos_exception(self): """Tests safe_symmetric_difference with a geos exception.""" - polygon_a = from_wkt('MULTIPOLYGON(((172767.25694 174472.63279888, 172766.30994001 174470.77679888, 172765.64794001 174469.48679888, 172766.51694001 174469.12679888, 172765.12794 174466.03679889, 172764.34694001 174466.34679888, 172762.84694001 174463.15679888, 172764.28394001 174462.46479889, 172765.32594 174461.96179888, 172761.13894 174453.29579888, 172760.09694001 174451.01679889, 172759.79494001 174450.12279889, 172760.93594001 174449.76179888, 172761.82594 174450.27579889, 172762.67394001 174449.91179889, 172765.15694 174448.84679888, 172764.19994001 174445.99879888, 172764.60994 174445.80279889, 172764.33894001 174444.31479888, 172763.51694001 174441.74179888, 172763.21994 174440.02779889, 172761.17694 174440.68879888, 172759.74794001 174436.70479888, 172759.02694001 174436.93979888, 172756.96694 174437.61179889, 172755.11894001 174438.21379888, 172754.95694001 174437.62679889, 172754.60694 174436.35679889, 172756.19994001 174435.93579889, 172758.35594 174435.36579889, 172760.84694001 174434.70679888, 172760.58894001 174433.53579888, 172760.14694 174431.53679889, 172759.53294 174429.60779888, 172759.38494 174428.15179888, 172759.12694001 174427.54679888, 172758.76694001 174426.28679889, 172758.12194001 174424.02879888, 172758.32294 174423.95879888, 172758.05194 174421.82179889, 172756.64394001 174422.12379888, 172755.98194 174422.32379889, 172755.12694001 174419.48579888, 172753.83594001 174419.79579889, 172752.49394001 174414.58679888, 172751.20794001 174414.83379888, 172750.65294001 174412.80779888, 172748.95294001 174413.24779889, 172748.47294 174411.39879889, 172753.23294001 174410.11879888, 172752.77094 174408.42079889, 172752.20594 174406.34079888, 172751.57694 174404.02979888, 172750.94994001 174401.72379889, 172750.44494 174399.86779889, 172749.65394 174396.95879888, 172749.08794 174394.87879889, 172750.24394001 174394.48479888, 172751.79494001 174393.68579889, 172753.32194001 174392.89979888, 172754.02694001 174394.06179888, 172759.86194001 174390.84279888, 172760.84694001 174392.75779888, 172762.75294 174391.80779888, 172764.67794001 174390.84979888, 172767.03494001 174389.67579888, 172769.10394001 174388.64579888, 172770.82694 174387.78779888, 172772.41294001 174387.00179889, 172771.70694001 174385.58179888, 172770.47494001 174383.10379888, 172769.86494001 174381.87779888, 172769.31094001 174380.77179889, 172768.51694001 174379.18579889, 172767.43494001 174377.02279888, 172766.27794001 174374.71279889, 172765.78994 174373.61879888, 172765.24294 174372.39279888, 172764.56294 174370.86879888, 172763.48394 174368.72379889, 172762.58994001 174366.94779889, 172761.36994 174364.52279888, 172760.27094 174362.33879888, 172759.15994001 174360.12979888, 172757.85194 174357.53079889, 172752.91594 174345.84979888, 172752.44494 174344.50079888, 172751.68294 174342.55779888, 172750.88594 174340.52579889, 172749.87694001 174337.94779888, 172748.82694 174335.20279888, 172747.72094 174332.38879888, 172746.51294001 174329.31579889, 172745.36494001 174326.39779888, 172743.82194001 174322.47179888, 172742.68394 174319.57579888, 172739.86294 174320.46079888, 172737.67194 174320.96779888, 172736.12194001 174321.39879889, 172733.90294001 174322.01479889, 172731.21594 174322.76179888, 172729.70094 174323.15779889, 172729.10494001 174323.34879888, 172727.50294 174323.86079888, 172724.60494001 174324.78679888, 172719.82894001 174326.31279889, 172720.17794001 174327.77779889, 172720.41094 174328.75779888, 172720.82494001 174330.49979889, 172721.08494 174331.56079889, 172721.42594 174332.98579888, 172721.70594 174334.18179888, 172722.03394001 174335.51479889, 172722.60994 174337.84979888, 172723.15794 174340.07079888, 172719.07994 174341.35879889, 172719.00094001 174340.49779889, 172718.62994001 174340.60179888, 172717.50294 174340.91679888, 172714.97094 174341.62679888, 172714.17294 174341.84979888, 172712.47094 174342.32679888, 172710.41394001 174342.90279889, 172708.33894001 174343.48379889, 172705.43894001 174344.29679888, 172702.72094 174345.05779888, 172703.36294 174347.25779888, 172703.90994001 174349.13479888, 172702.14294 174349.59779889, 172700.29694 174350.08079888, 172697.39194001 174350.83979889, 172695.26994001 174351.39479888, 172694.94394 174349.74379888, 172692.57994 174350.34579889, 172689.68394 174351.08279889, 172686.95894 174351.77579889, 172684.89594 174352.30079888, 172683.30094 174352.70679888, 172681.18294 174353.24579888, 172679.33194001 174353.71579888, 172677.40094 174354.20779889, 172676.77394001 174351.89279888, 172676.06194 174349.26679889, 172675.74094001 174348.08279889, 172675.25994 174346.30779888, 172674.46694 174343.38379889, 172673.58194001 174340.11779889, 172672.77094 174337.12779888, 172670.94994001 174337.60879888, 172669.08994001 174338.09979888, 172668.25594001 174338.31979889, 172663.54094 174339.43779888, 172663.95094 174340.99179888, 172664.37094 174342.58279889, 172664.94494 174344.75679888, 172665.47294 174346.75879889, 172666.08594001 174349.08279889, 172666.77094 174351.67579889, 172667.44094 174354.21779888, 172665.21794001 174354.76179888, 172663.37894 174355.21179888, 172661.58094 174355.65179889, 172659.15894001 174356.24379888, 172656.24094001 174356.95779889, 172655.82894001 174354.98779888, 172655.30694001 174352.49479889, 172654.75394 174349.85379888, 172653.44094 174347.26779888, 172650.79094 174346.37779888, 172649.39294 174346.74579888, 172648.16994001 174347.06779889, 172643.14494001 174348.38979889, 172640.56794001 174349.06779889, 172638.06294 174349.72679888, 172635.80894 174350.31979889, 172634.01694001 174350.79179888, 172631.56094001 174351.43779889, 172631.68094001 174351.69779888, 172630.46894001 174352.05179889, 172629.28094001 174352.39979888, 172627.68094001 174352.86779889, 172628.10094001 174354.11979889, 172628.68794 174355.86679889, 172629.43094001 174358.08279889, 172630.24694001 174360.51479889, 172630.85694 174362.33379888, 172631.76094 174365.02779889, 172632.43094001 174364.86779889, 172632.93494001 174366.67479889, 172630.87694001 174367.28679889, 172629.35094001 174367.69579888, 172627.54894001 174368.17979889, 172625.44094 174368.74479889, 172623.82194001 174369.17879888, 172621.82194001 174369.71579888, 172620.13194 174370.16879888, 172618.52894 174370.59879889, 172616.85694 174371.04679888, 172613.67694 174372.43679888, 172612.27094 174372.87179888, 172610.70894 174373.35479889, 172608.85694 174373.92679889, 172608.25794001 174371.89079888, 172607.82694 174370.42679889, 172607.50694 174370.51679889, 172607.38694001 174370.06679888, 172607.01194001 174368.70179889, 172605.61394 174369.12679889, 172604.29194001 174364.49979888, 172605.79494001 174364.27579889, 172604.95794001 174361.23079889, 172604.15694 174358.31679888, 172601.38294001 174359.08279889, 172599.73694001 174359.53679889, 172599.03094001 174356.96479888, 172598.45694001 174354.87679889, 172598.31094001 174353.65579888, 172597.92494001 174352.22579889, 172597.51694001 174350.71679889, 172593.94294001 174351.68579889, 172594.45994 174353.59579889, 172594.89194001 174355.18879888, 172594.43694 174355.28679889, 172595.10394001 174357.58879888, 172595.61694 174359.35679889, 172596.36994 174361.95579889, 172596.92694 174363.87679888, 172594.25694 174364.45679888, 172594.21694 174364.31679888, 172593.00494001 174364.65379888, 172592.00394 174364.93279888, 172590.26894 174365.41579889, 172588.36994 174365.94479889, 172586.29894001 174366.52079888, 172585.71094001 174364.28879889, 172585.01994001 174361.66879889, 172584.37794 174359.23179889, 172583.45694001 174355.73579888, 172582.56194 174352.34079888, 172581.81194 174349.49579888, 172578.83494 174350.40579889, 172579.40794 174352.63579888, 172579.78994 174354.11679888, 172580.28794001 174356.05279889, 172580.77094 174357.92779888, 172581.47694 174360.66679888, 172581.97094 174362.58679888, 172582.24294 174363.61779889, 172582.54194001 174364.74379888, 172582.91294001 174366.13879888, 172583.24094001 174367.37179888, 172583.56894 174368.60379888, 172583.98394 174370.16379889, 172584.46094001 174371.95479888, 172584.86494001 174373.47379888, 172585.18994 174374.69679889, 172581.69994001 174375.73579888, 172581.45894 174374.65479888, 172581.93994 174374.65479888, 172582.48094 174373.39279888, 172580.61794 174366.54279888, 172576.54694 174367.44579888, 172576.96094001 174368.82979888, 172577.49594 174370.61579889, 172578.20294001 174372.70579888, 172578.57394 174374.21879889, 172578.69794 174374.72879888, 172578.94194001 174375.71979888, 172579.21594 174376.83779888, 172579.48694001 174377.94179888, 172579.78194 174379.14479889, 172580.08194001 174380.37079888, 172580.58694 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888, 172576.23194 174376.15679888, 172575.20994 174372.55179889, 172573.66494 174372.83079889, 172574.33394 174375.25079888, 172574.79994001 174376.93479888, 172574.46694 174377.10679889, 172573.55494 174377.38579888, 172571.95794001 174377.87279889, 172569.12694001 174378.73679888, 172570.29694 174382.59679888, 172569.06894 174382.95779889, 172567.62494 174383.37779888, 172566.17594 174383.79879889, 172564.97094 174384.14879888, 172563.53494001 174384.56479888, 172562.23594001 174384.94279889, 172561.03494001 174385.29079889, 172559.35194 174385.66979888, 172558.39794001 174385.88479888, 172556.63694001 174386.28179888, 172554.56194 174386.74879888, 172554.93394 174388.02679888, 172555.33194001 174389.39779888, 172555.78394001 174390.95079888, 172556.25094001 174392.55979888, 172556.78094001 174394.38279888, 172557.38394001 174396.45779889, 172555.12994001 174410.66979888, 172554.04194001 174412.21079889, 172554.18094001 174413.74279889, 172554.35894 174415.69279889, 172554.59094 174418.23979888, 172554.80294001 174420.57479888, 172555.02794001 174423.04279888, 172555.93294 174422.97279889, 172557.54494001 174422.84879889, 172560.00094001 174422.89679889, 172562.04294 174422.83779889, 172563.99094001 174422.77979888, 172565.29094 174422.74079889, 172567.21594 174422.68179889, 172569.10194 174422.62379888, 172568.98294001 174421.27879888, 172568.88094001 174420.13579889, 172568.73194 174418.45579889, 172568.45294001 174415.31879888, 172570.64394 174415.21279889, 172570.64394001 174420.55979889, 172572.08594001 174420.43979888, 172572.08594001 174421.46179888, 172572.89894001 174421.52179889, 172572.93594001 174418.69679889, 172572.92794001 174415.53279888, 172575.20994 174415.51279889, 172575.27294001 174421.23079888, 172577.66994001 174421.37079888, 172577.71794001 174420.68179889, 172577.72494001 174418.93679889, 172577.73594001 174415.93279888, 172580.01694001 174415.87379888, 172579.83694 174420.49979889, 172581.27894 174420.49979889, 172581.16094 174421.60179888, 172582.17694 174421.66979888, 172582.13594 174422.43279888, 172582.06294 174423.81779889, 172581.85494001 174425.10579888, 172581.54394 174425.96979888, 172582.27094 174425.90879888, 172583.34994001 174425.81679888, 172584.44594001 174425.72479888, 172585.57394 174425.43879889, 172587.27294001 174425.00679888, 172589.82794001 174424.35879889, 172589.40294001 174423.53179888, 172589.03494001 174422.06079888, 172588.59694001 174420.30879889, 172588.35594 174419.34679888, 172587.97694 174417.82879889, 172587.78294 174417.05679889, 172587.61594001 174415.77979888, 172587.36494001 174414.35979888, 172587.75394 174413.42079888, 172587.86994 174411.44879889, 172592.26794 174410.32279888, 172592.57794001 174412.11779889, 172593.54694 174411.85679889, 172593.88294001 174413.17479889, 172596.71694 174412.45279888, 172597.50594001 174415.42779888, 172593.94094 174416.36279888, 172594.31794001 174417.67579888, 172595.57994 174417.37579888, 172595.88594 174418.96979888, 172599.56994 174418.29279888, 172600.39494001 174421.68079888, 172599.12494 174422.00279888, 172597.83994001 174422.32779888, 172595.25594001 174422.98279888, 172595.67794001 174424.90679888, 172598.81094001 174424.21879889, 172599.32294 174426.26379888, 172599.83994001 174428.32779888, 172600.28294 174430.09379889, 172599.53294 174430.30379888, 172598.94794 174431.12079888, 172598.50794001 174431.73679888, 172598.17194 174432.53079888, 172597.70394001 174433.63779889, 172598.26694001 174435.35479889, 172601.68394 174434.46579888, 172602.63794001 174437.85679889, 172603.52094 174441.33179888, 172604.18794 174443.95879889, 172607.05394 174443.20479888, 172608.01694001 174447.05779888, 172602.61494001 174448.18279888, 172603.57694 174451.96779888, 172591.37294001 174454.98979888, 172593.09694001 174460.86279888, 172596.00694 174460.12279889, 172599.45294001 174459.24579888, 172605.06394001 174457.81879888, 172608.39694 174456.97079889, 172613.56094001 174455.65679888, 172614.32594 174458.77479888, 172609.11894001 174459.86879888, 172606.47194001 174460.59979888, 172604.45794001 174461.15679888, 172605.34094 174464.77179889, 172607.57394 174464.20979889, 172609.99094001 174463.60579889, 172613.07994 174462.83479889, 172613.61894001 174464.88379889, 172614.04994001 174466.51979889, 172614.37794 174467.76679889, 172612.53894001 174468.36579889, 172611.16394001 174468.81479888, 172608.52994 174469.67379888, 172609.11194001 174471.76679889, 172609.56494 174473.39879889, 172612.91294001 174485.56179888, 172614.59894 174485.11079888, 172617.38894 174484.36379889, 172622.33194001 174483.04179888, 172625.99594 174482.06079889, 172629.84294001 174481.03179888, 172641.95194 174477.65279889, 172643.75494001 174477.16979888, 172645.38894 174476.73279888, 172647.53094001 174476.15979889, 172649.87894 174475.53179888, 172652.14894001 174474.92479889, 172655.08794 174474.13879889, 172656.82294 174473.67479889, 172659.20494 174473.03779889, 172661.12994001 174472.52279888, 172663.13094001 174471.98779888, 172666.07294 174471.20079888, 172669.09894 174470.39179889, 172670.32794001 174470.07579888, 172672.24694001 174469.58179889, 172673.91894 174469.15179888, 172674.58694 174468.84879889, 172675.52994 174468.59879889, 172677.88094001 174467.97779889, 172680.51794 174467.28079889, 172683.39194001 174466.52079888, 172686.88994 174465.59579889, 172690.08694 174464.75079888, 172693.60394001 174463.82179889, 172694.71594 174465.90079889, 172695.81494 174467.95779889, 172696.76694001 174469.73679889, 172698.74294 174473.43379889, 172700.00894001 174475.80279888, 172701.21194 174478.05279888, 172702.29394 174480.07679889, 172712.67294 174477.65879888, 172714.31294 174477.23479888, 172715.92294 174476.81879889, 172718.15094 174476.24279889, 172719.85594 174475.80279888, 172719.07394 174472.68079888, 172722.78994 174471.85879889, 172723.62094 174471.64979888, 172726.34994001 174470.96079888, 172727.68494001 174470.62379888, 172728.34494 174470.45779889, 172728.94594001 174470.31079889, 172729.36494001 174470.20779889, 172733.29694 174468.74879888, 172732.51594001 174463.94179888, 172736.18094001 174462.86079888, 172736.12094 174460.75779888, 172739.38594 174460.04779889, 172751.74194 174457.62979889, 172752.52594 174459.31079889, 172753.47194001 174461.34079888, 172754.32394 174463.17079889, 172755.22994001 174465.11479888, 172756.45494 174467.74379888, 172757.91194 174470.86979889, 172759.17194 174473.57379889, 172760.30194 174475.99779889, 172767.25694 174472.63279888)))') - polygon_b = from_wkt('MULTIPOLYGON(((172557.3838523062 174396.45835165278, 172555.12905084348 174410.6693711578, 172554.04105084387 174412.2103631608, 172554.28937084228 174414.93676316369, 172555.0277388468 174423.0425551683, 172563.7369228527 174422.37100316587, 172569.0432908535 174421.9618511684, 172568.4963957805 174415.81728130922, 172568.4972705121 174415.81723898993, 172568.45294000994 174415.31879887995, 172570.64394 174415.21279888996, 172570.64394001 174420.55979889, 172572.08594000997 174420.43979888, 172572.08594000997 174420.94152719184, 172572.77495595193 174420.8841888285, 172572.71193637606 174416.03471118974, 172572.929204253 174416.03280700246, 172572.92794000998 174415.53279887998, 172575.20994000003 174415.51279889, 172575.27294001004 174421.23079888, 172577.6697196799 174421.37078601134, 172577.70199362023 174416.43384416474, 172577.73410833202 174416.4330134905, 172577.7358131635 174415.9674395041, 172577.73594001 174415.93279888004, 172578.87644000998 174415.90329888, 172580.01694000998 174415.87379888, 172579.83694 174420.49979889003, 172581.27894 174420.49979889003, 172581.22540097954 174420.99979889003, 172582.22334147422 174420.99979889003, 172582.17621886 174421.66917916582, 172582.0176908598 174424.652603168, 172581.5430028588 174425.96959516776, 172581.36988285926 174426.44985117015, 172583.22229886055 174426.393211171, 172584.53372231862 174426.04524331444, 172585.60137086362 174425.76191516966, 172589.6888588667 174424.67730716988, 172588.59657086435 174420.30905116722, 172587.97628287587 174417.82828320874, 172587.62773886323 174416.44255516306, 172587.57641086724 174416.43890716136, 172587.6150668636 174415.78034716102, 172587.75349886715 174413.420987159, 172587.86921086907 174411.4484431595, 172591.77150026744 174410.4497097941, 172592.26794067942 174410.3228028141, 172592.57794001006 174412.11779889002, 172593.54694000003 174411.85679889002, 172593.88294001002 174413.17479889, 172596.71693999998 174412.45279888005, 172597.50594000999 174415.42779887991, 172597.172895412 174415.51514718245, 172597.022295644 174415.5546452982, 172597.0224054087 174415.55505917643, 172593.93199883454 174416.33165895962, 172593.94094 174416.36279887997, 172594.31794001002 174417.67579888002, 172595.57994 174417.37579888004, 172595.88594000004 174418.96979887996, 172599.56993999996 174418.29279888, 172600.39494000998 174421.68079888003, 172599.91025387176 174421.80368780546, 172599.94715650496 174421.95523461731, 172596.69628287107 174422.8178511672, 172595.3009759594 174423.18812865848, 172595.67794001 174424.90679888, 172598.81094000905 174424.2187988902, 172598.92996166085 174424.6941881079, 172599.32293973575 174426.26379782447, 172599.32319430308 174426.26481412462, 172599.83993917855 174428.32779556068, 172600.28294000003 174430.09379889, 172599.53294 174430.30379888, 172598.9479399949 174431.12079888713, 172598.50794000993 174431.73679888, 172598.17194137024 174432.53079564194, 172597.70394001 174433.63779889003, 172598.2660748735 174435.35474717614, 172601.1998381591 174434.5913030442, 172601.19995467947 174434.5917172166, 172601.68394000002 174434.46579888, 172602.63794000942 174437.85679888783, 172603.5209395613 174441.3317971537, 172603.67147661696 174441.92469197488, 172604.18799165756 174443.95900234475, 172607.0539523896 174443.2048484512, 172608.01694001004 174447.05779888, 172602.61494001004 174448.18279888007, 172603.57694000003 174451.96779887998, 172591.37294001 174454.98979887998, 172593.09693550566 174460.86278353556, 172605.0632588789 174457.8183631897, 172608.39689087868 174456.97023519131, 172613.0762718963 174455.77972994547, 172613.07636302974 174455.78010138884, 172613.56094001004 174455.65679887997, 172614.32594000004 174458.77479888004, 172609.11894000994 174459.86879888005, 172606.47194360537 174460.59979788712, 172604.45794001 174461.15679888, 172605.3409823247 174464.7719721671, 172612.59480380098 174462.95596724018, 172612.7014123517 174462.92927763195, 172613.07994000003 174462.83479889008, 172613.61893907966 174464.88379535347, 172613.6189968665 174464.88401470726, 172614.04993903125 174466.51979517483, 172614.37794 174467.76679889, 172612.53894704106 174468.36579659986, 172612.53852629993 174468.36593398513, 172611.16394366286 174468.81479768714, 172608.52993999998 174469.67379888, 172609.11193880375 174471.76679455204, 172609.11197085044 174471.76690999718, 172609.56229931235 174473.38928541902, 172609.5649399964 174473.3987988771, 172612.91284623384 174485.5614581992, 172616.49161088464 174484.6038992107, 172617.37810321042 174484.36670035287, 172617.3781038362 174484.3667001854, 172617.40430078932 174484.35969066346, 172621.91801405355 174483.1519558644, 172625.84397284017 174482.10148660126, 172626.28639576584 174481.983107446, 172629.84245889643 174481.0316112079, 172629.84260632202 174481.0318919951, 172641.95148947238 174477.65292460908, 172641.9513229055 174477.65228320664, 172643.55453783524 174477.22348398916, 172649.45557890835 174475.6451792046, 172652.118800357 174474.93285825956, 172655.08757891503 174474.13881120458, 172669.09820291854 174470.39141919912, 172673.91823492196 174469.15141920003, 172674.05039449205 174469.04677954124, 172674.1582349241 174468.9614031985, 172675.5150722086 174468.60274051016, 172675.58914901028 174468.58315924928, 172676.93838271403 174468.22650647085, 172685.4841995281 174465.9675284286, 172690.08649093658 174464.75097119805, 172690.35773174433 174464.679270439, 172693.6036109403 174463.82124319673, 172695.45967493954 174467.2931151986, 172695.69615282057 174467.73546474247, 172695.8858936043 174468.09038905406, 172702.29378802062 174480.0768342967, 172712.67227422315 174477.65895398633, 172712.67215495606 174477.6584912053, 172719.8562189564 174475.80549920353, 172719.13622944942 174473.1791069913, 172719.19547385076 174473.1660017983, 172719.07393999997 174472.68079888003, 172722.78994000095 174471.8587988898, 172723.6209313099 174471.64980106562, 172723.62116079254 174471.6497431358, 172726.34993987996 174470.9607989128, 172727.68514120538 174470.623748284, 172728.34493999486 174470.45779889126, 172728.94593998056 174470.3107988972, 172729.36494001048 174470.20779888984, 172733.29694 174468.74879888006, 172732.51594000997 174463.94179888, 172736.18094000997 174462.86079888, 172736.12094 174460.75779888, 172739.38593999937 174460.04779889015, 172751.74194 174457.62979889003, 172751.82374942137 174457.8052091417, 172760.30108298364 174475.9976912029, 172767.25628262636 174472.6322513803, 172767.5851149932 174472.47314720228, 172767.50690699372 174472.13401120156, 172767.1188087445 174472.3620791199, 172766.30993999983 174470.7767988602, 172765.64794001004 174469.48679887998, 172766.51694001004 174469.12679887997, 172765.12794 174466.03679888998, 172764.34694001 174466.34679888003, 172762.84694005293 174463.15679897126, 172763.29320167168 174462.94189765144, 172764.2839314731 174462.46480300103, 172765.32593999998 174461.96179887993, 172761.1385378274 174453.29491927216, 172761.13853782744 174453.29491927216, 172760.09694000988 174451.01679888976, 172759.79494001003 174450.12279889, 172760.93594000998 174449.76179888003, 172761.82593999995 174450.27579889004, 172762.67400122888 174449.91177263303, 172765.15694 174448.84679888003, 172764.19994000997 174445.99879888, 172764.60994001062 174445.80279888492, 172764.33894001 174444.31479887993, 172763.51689098784 174441.74149918192, 172763.5168882326 174441.74150007046, 172763.51688823258 174441.74150007026, 172763.21993999998 174440.02779889002, 172761.17694 174440.68879888, 172759.74790522835 174436.7047019099, 172755.11890209024 174438.21366147915, 172754.95691696025 174437.6267152474, 172754.85751089564 174437.26601325686, 172754.6069400003 174436.3567988909, 172755.10336595034 174436.22560282986, 172756.19993908802 174435.93579913364, 172758.35593845724 174435.36579929787, 172760.84694000997 174434.70679888004, 172760.58894161868 174433.5358061814, 172760.14693999995 174431.53679888978, 172759.5329400001 174429.6077988801, 172759.52534339868 174429.53306474834, 172759.48582006822 174429.1442406328, 172759.76815493542 174429.05234718855, 172759.7528128644 174429.0162936086, 172759.12745483534 174427.54860076858, 172759.12745462733 174427.54860004058, 172759.1267469823 174427.54693917185, 172759.12695293076 174427.54684410253, 172758.76693612643 174426.28678529424, 172758.12194001 174424.02879888, 172758.32293999995 174423.95879888002, 172758.05193999998 174421.82179889004, 172756.6439400104 174422.12379887994, 172756.53950232168 174422.15535105282, 172755.98194000003 174422.32379888996, 172755.12451175836 174419.47773878835, 172753.83321806323 174419.78523359896, 172752.4939518636 174414.58684488994, 172751.20706697553 174414.83333916217, 172750.73129098117 174412.7877071612, 172748.95247497407 174413.2481231615, 172748.47247497732 174411.39813916016, 172753.23247498277 174410.11813915893, 172751.57647497955 174404.02937115356, 172750.80501897636 174401.19289115068, 172749.21920579113 174395.36230315745, 172749.2194832201 174395.36220860117, 172749.08793999997 174394.87879889001, 172750.24394001003 174394.48479888003, 172751.79493705663 174393.68580041145, 172753.32194001004 174392.89979888, 172754.02694001 174394.06179887996, 172759.86194000999 174390.84279887998, 172760.84694001003 174392.75779887996, 172762.75293454644 174391.80780159816, 172762.7540957816 174391.80722369105, 172764.6779369368 174390.84980040943, 172767.0349380484 174389.675799857, 172769.10393896094 174388.64579940226, 172770.8269400001 174387.78779888, 172772.41231297184 174387.0021096416, 172769.92245898946 174381.99321113512, 172769.86473163788 174381.87794843127, 172766.27740298968 174374.71225113448, 172766.12751504182 174374.37625125528, 172765.45154720507 174372.86111561494, 172764.5623949914 174370.86834713045, 172758.44661898166 174358.71346712485, 172758.08089647835 174357.9866221479, 172758.0812897689 174357.9865175769, 172757.8519399999 174357.5307988898, 172754.4110373197 174349.3873883099, 172754.41083817216 174349.3874620819, 172754.04609390008 174348.52429801252, 172753.7164504677 174347.74419976756, 172753.71289365587 174347.7351269625, 172752.91599497944 174345.84914711493, 172752.96828298277 174345.83532311398, 172752.74697099614 174345.2712271516, 172750.88521097507 174340.5253711095, 172749.90261897308 174337.94073110458, 172742.68309897187 174319.57548309487, 172729.2444429621 174323.76869909838, 172729.1040909663 174323.3482191004, 172719.76546695834 174325.91705109927, 172721.48245895657 174332.9833551049, 172723.08294328308 174339.57013976108, 172723.03791828503 174339.58436050604, 172723.15793999998 174340.07079887998, 172719.07994 174341.35879888994, 172719.0331842302 174340.8492201192, 172718.5874979483 174340.98998616525, 172718.5534989536 174340.6227151118, 172714.9709069505 174341.62623511252, 172702.72073094547 174345.05746711424, 172703.20898694542 174346.73209111392, 172703.9096589461 174349.13503511623, 172695.26953093708 174351.39500311756, 172694.93771905327 174349.74538306356, 172692.57990415473 174350.34580801197, 172692.57334559556 174350.34747709305, 172689.68390132912 174351.0828087242, 172689.6768192437 174351.08460978328, 172686.95894150986 174351.77579850602, 172684.89594078047 174352.3007986814, 172684.8828689878 174352.30412604674, 172683.3009262921 174352.70680236846, 172681.18281584515 174353.24583040207, 172679.3319479569 174353.71579686215, 172677.40094000465 174354.20779888882, 172677.27266865686 174353.73419735025, 172676.77394073328 174351.89280155062, 172676.06193873903 174349.26679423897, 172675.7409324217 174348.08277088706, 172675.25994054292 174346.30780088357, 172675.2596599193 174346.30676614863, 172674.46692653303 174343.38374918967, 172673.58194064876 174340.11780124725, 172672.77094000002 174337.12779888004, 172670.9499049531 174337.60880813404, 172670.52563620973 174337.72080595847, 172669.09919766168 174338.09735505903, 172669.08994002102 174338.09979887708, 172668.25594001057 174338.3197988899, 172663.54094 174339.43779888, 172663.9509396747 174340.9917976469, 172663.95246609734 174340.9975798821, 172664.37093995474 174342.5827987186, 172664.9449393093 174344.75679626403, 172665.47293987044 174346.75879839866, 172665.473080069 174346.7593299183, 172666.08593904617 174349.08279523588, 172666.0860074876 174349.08305431984, 172666.77093856825 174351.67579347026, 172667.44093999997 174354.21779888, 172665.21794001 174354.76179888, 172665.0101183685 174354.8126524625, 172663.37894000002 174355.21179888002, 172663.37873282918 174355.21184957805, 172661.5809427116 174355.65179822646, 172659.15894248072 174356.2437982761, 172656.24094000997 174356.95779889004, 172655.8289405051 174354.98780124754, 172655.30694000996 174352.49479888997, 172654.75393999997 174349.85379887992, 172653.44093999994 174347.26779887994, 172650.79094000012 174346.37779887998, 172649.39294039877 174346.74579877505, 172649.3911846923 174346.7462610297, 172648.1699417751 174347.06779842527, 172643.14494001 174348.38979889, 172642.93389291374 174348.44532466854, 172640.56794000996 174349.06779889, 172640.41789637046 174349.10727144754, 172638.06294 174349.72679888003, 172635.8089427633 174350.319798163, 172634.01694338908 174350.79179799, 172631.56094000998 174351.43779888997, 172631.68094001 174351.69779888, 172630.46894738195 174352.0517967368, 172630.4687520214 174352.05185395735, 172629.2809437475 174352.39979778518, 172627.68094000997 174352.86779889, 172628.10093847304 174354.1197943085, 172628.10107294662 174354.1201945294, 172628.6879379874 174355.86679290008, 172628.68799114702 174355.86695143604, 172629.43093933648 174358.08279688127, 172629.43133035954 174358.0839622848, 172630.24693959064 174360.5147976402, 172630.24792235918 174360.51772822303, 172630.85693939638 174362.3337970801, 172631.76094 174365.02779888996, 172632.43094001003 174364.86779888996, 172632.93494001002 174366.67479888993, 172630.87694000924 174367.2867988902, 172629.35094510994 174367.69579751312, 172629.35049890392 174367.69591735688, 172627.54894514213 174368.17979751158, 172627.52128803954 174368.18721035263, 172625.4409402792 174368.7447988152, 172625.43971959242 174368.74512604062, 172623.82194391786 174369.17879783243, 172621.82194405483 174369.715797794, 172621.82183787943 174369.71582625585, 172620.13194178292 174370.16879840213, 172618.52894290345 174370.59879811114, 172616.85694000009 174371.04679887995, 172613.67694 174372.43679888, 172612.2709414281 174372.87179843814, 172610.70894325845 174373.35479788246, 172608.85694 174373.92679889, 172608.25794049533 174371.89080052968, 172607.82694000003 174370.42679889002, 172607.51030628625 174370.515852122, 172607.38694001004 174370.06679887997, 172607.01194001 174368.70179888996, 172605.61394000004 174369.12679888998, 172604.29194001 174364.49979887996, 172605.79494001003 174364.27579888995, 172604.95794001003 174361.23079889003, 172604.15693999996 174358.31679887997, 172601.3829428521 174359.08279810517, 172600.24729543962 174359.3960325686, 172597.84457264078 174350.6279695617, 172597.51694001004 174350.71679888997, 172593.94294000993 174351.68579889, 172594.4599387648 174353.5957943269, 172594.89194001 174355.18879888, 172594.43694 174355.28679888998, 172595.10393895835 174357.58879525043, 172595.61693890326 174359.35679511022, 172596.36993943545 174361.95579694142, 172596.92693999998 174363.87679887997, 172594.25694 174364.45679887995, 172594.21693999998 174364.31679888006, 172593.00494592657 174364.6537972349, 172593.00452690053 174364.65391402238, 172592.00394302807 174364.932798036, 172590.26894162453 174365.41579843775, 172588.36994388918 174365.94479780665, 172588.36984125132 174365.94482635465, 172586.29894001002 174366.52079888002, 172585.7109407086 174364.2888015419, 172585.71082483808 174364.2883622034, 172585.01994076036 174361.66880173524, 172584.8667329185 174361.0872324162, 172584.37794 174359.23179888996, 172583.4569404406 174355.73580051467, 172582.56193999999 174352.34079887997, 172581.81194 174349.49579887997, 172578.96056568567 174350.36739802494, 172585.1382444169 174374.19050227254, 172585.0614705477 174374.21335843968, 172585.18994 174374.69679888996, 172581.69994000997 174375.73579888, 172581.62350512363 174375.3929519558, 172581.93994000004 174374.65479888, 172582.48094 174373.39279888003, 172580.61794 174366.54279888, 172576.77667659082 174367.3948403584, 172578.3008907684 174373.35775476237, 172578.52405885607 174374.23071513322, 172580.47195049844 174381.85118837637, 172580.4625612569 174381.85333750857, 172580.58694000004 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888003, 172576.23194 174376.15679888002, 172575.20993999997 174372.55179889, 172573.66458694366 174372.8308626458, 172574.0934668556 174374.3819471337, 172574.33365876754 174375.25074680167, 172574.7994377378 174376.93505831185, 172574.46694027368 174377.10679874866, 172573.55473542705 174377.38586125555, 172571.95794220705 174377.87279822002, 172569.12694000997 174378.73679888004, 172570.29693999997 174382.59679888, 172569.06894000657 174382.95779888806, 172568.98899089158 174382.9810527852, 172567.62494267538 174383.37779810186, 172566.1759413303 174383.7987985035, 172564.9709467131 174384.14879693012, 172563.53494001646 174384.5647988781, 172562.23594001002 174384.94279888997, 172561.03905731053 174385.28960586703, 172554.56188284606 174386.74853914225, 172555.21404284242 174388.99244314435, 172557.3838523062 174396.45835165278)),((172739.38594000007 174460.04779889, 172739.39373637483 174460.04610350684, 172739.392673916 174460.04121769255, 172739.3870486459 174460.03837656736, 172739.38261013498 174460.0403655549, 172739.3807950899 174460.03631378766, 172739.37623201194 174460.03835788142, 172739.37262919155 174460.04530889943, 172739.37358944913 174460.05021582366, 172739.3858038434 174460.04782553512, 172739.3859399994 174460.04779889015, 172739.38594000007 174460.04779889)))') - result = safe_symmetric_difference(polygon_a, polygon_b) #GEOS exception is catched + polygon_a = from_wkt( + "MULTIPOLYGON(((172767.25694 174472.63279888, 172766.30994001 174470.77679888, 172765.64794001 174469.48679888, 172766.51694001 174469.12679888, 172765.12794 174466.03679889, 172764.34694001 174466.34679888, 172762.84694001 174463.15679888, 172764.28394001 174462.46479889, 172765.32594 174461.96179888, 172761.13894 174453.29579888, 172760.09694001 174451.01679889, 172759.79494001 174450.12279889, 172760.93594001 174449.76179888, 172761.82594 174450.27579889, 172762.67394001 174449.91179889, 172765.15694 174448.84679888, 172764.19994001 174445.99879888, 172764.60994 174445.80279889, 172764.33894001 174444.31479888, 172763.51694001 174441.74179888, 172763.21994 174440.02779889, 172761.17694 174440.68879888, 172759.74794001 174436.70479888, 172759.02694001 174436.93979888, 172756.96694 174437.61179889, 172755.11894001 174438.21379888, 172754.95694001 174437.62679889, 172754.60694 174436.35679889, 172756.19994001 174435.93579889, 172758.35594 174435.36579889, 172760.84694001 174434.70679888, 172760.58894001 174433.53579888, 172760.14694 174431.53679889, 172759.53294 174429.60779888, 172759.38494 174428.15179888, 172759.12694001 174427.54679888, 172758.76694001 174426.28679889, 172758.12194001 174424.02879888, 172758.32294 174423.95879888, 172758.05194 174421.82179889, 172756.64394001 174422.12379888, 172755.98194 174422.32379889, 172755.12694001 174419.48579888, 172753.83594001 174419.79579889, 172752.49394001 174414.58679888, 172751.20794001 174414.83379888, 172750.65294001 174412.80779888, 172748.95294001 174413.24779889, 172748.47294 174411.39879889, 172753.23294001 174410.11879888, 172752.77094 174408.42079889, 172752.20594 174406.34079888, 172751.57694 174404.02979888, 172750.94994001 174401.72379889, 172750.44494 174399.86779889, 172749.65394 174396.95879888, 172749.08794 174394.87879889, 172750.24394001 174394.48479888, 172751.79494001 174393.68579889, 172753.32194001 174392.89979888, 172754.02694001 174394.06179888, 172759.86194001 174390.84279888, 172760.84694001 174392.75779888, 172762.75294 174391.80779888, 172764.67794001 174390.84979888, 172767.03494001 174389.67579888, 172769.10394001 174388.64579888, 172770.82694 174387.78779888, 172772.41294001 174387.00179889, 172771.70694001 174385.58179888, 172770.47494001 174383.10379888, 172769.86494001 174381.87779888, 172769.31094001 174380.77179889, 172768.51694001 174379.18579889, 172767.43494001 174377.02279888, 172766.27794001 174374.71279889, 172765.78994 174373.61879888, 172765.24294 174372.39279888, 172764.56294 174370.86879888, 172763.48394 174368.72379889, 172762.58994001 174366.94779889, 172761.36994 174364.52279888, 172760.27094 174362.33879888, 172759.15994001 174360.12979888, 172757.85194 174357.53079889, 172752.91594 174345.84979888, 172752.44494 174344.50079888, 172751.68294 174342.55779888, 172750.88594 174340.52579889, 172749.87694001 174337.94779888, 172748.82694 174335.20279888, 172747.72094 174332.38879888, 172746.51294001 174329.31579889, 172745.36494001 174326.39779888, 172743.82194001 174322.47179888, 172742.68394 174319.57579888, 172739.86294 174320.46079888, 172737.67194 174320.96779888, 172736.12194001 174321.39879889, 172733.90294001 174322.01479889, 172731.21594 174322.76179888, 172729.70094 174323.15779889, 172729.10494001 174323.34879888, 172727.50294 174323.86079888, 172724.60494001 174324.78679888, 172719.82894001 174326.31279889, 172720.17794001 174327.77779889, 172720.41094 174328.75779888, 172720.82494001 174330.49979889, 172721.08494 174331.56079889, 172721.42594 174332.98579888, 172721.70594 174334.18179888, 172722.03394001 174335.51479889, 172722.60994 174337.84979888, 172723.15794 174340.07079888, 172719.07994 174341.35879889, 172719.00094001 174340.49779889, 172718.62994001 174340.60179888, 172717.50294 174340.91679888, 172714.97094 174341.62679888, 172714.17294 174341.84979888, 172712.47094 174342.32679888, 172710.41394001 174342.90279889, 172708.33894001 174343.48379889, 172705.43894001 174344.29679888, 172702.72094 174345.05779888, 172703.36294 174347.25779888, 172703.90994001 174349.13479888, 172702.14294 174349.59779889, 172700.29694 174350.08079888, 172697.39194001 174350.83979889, 172695.26994001 174351.39479888, 172694.94394 174349.74379888, 172692.57994 174350.34579889, 172689.68394 174351.08279889, 172686.95894 174351.77579889, 172684.89594 174352.30079888, 172683.30094 174352.70679888, 172681.18294 174353.24579888, 172679.33194001 174353.71579888, 172677.40094 174354.20779889, 172676.77394001 174351.89279888, 172676.06194 174349.26679889, 172675.74094001 174348.08279889, 172675.25994 174346.30779888, 172674.46694 174343.38379889, 172673.58194001 174340.11779889, 172672.77094 174337.12779888, 172670.94994001 174337.60879888, 172669.08994001 174338.09979888, 172668.25594001 174338.31979889, 172663.54094 174339.43779888, 172663.95094 174340.99179888, 172664.37094 174342.58279889, 172664.94494 174344.75679888, 172665.47294 174346.75879889, 172666.08594001 174349.08279889, 172666.77094 174351.67579889, 172667.44094 174354.21779888, 172665.21794001 174354.76179888, 172663.37894 174355.21179888, 172661.58094 174355.65179889, 172659.15894001 174356.24379888, 172656.24094001 174356.95779889, 172655.82894001 174354.98779888, 172655.30694001 174352.49479889, 172654.75394 174349.85379888, 172653.44094 174347.26779888, 172650.79094 174346.37779888, 172649.39294 174346.74579888, 172648.16994001 174347.06779889, 172643.14494001 174348.38979889, 172640.56794001 174349.06779889, 172638.06294 174349.72679888, 172635.80894 174350.31979889, 172634.01694001 174350.79179888, 172631.56094001 174351.43779889, 172631.68094001 174351.69779888, 172630.46894001 174352.05179889, 172629.28094001 174352.39979888, 172627.68094001 174352.86779889, 172628.10094001 174354.11979889, 172628.68794 174355.86679889, 172629.43094001 174358.08279889, 172630.24694001 174360.51479889, 172630.85694 174362.33379888, 172631.76094 174365.02779889, 172632.43094001 174364.86779889, 172632.93494001 174366.67479889, 172630.87694001 174367.28679889, 172629.35094001 174367.69579888, 172627.54894001 174368.17979889, 172625.44094 174368.74479889, 172623.82194001 174369.17879888, 172621.82194001 174369.71579888, 172620.13194 174370.16879888, 172618.52894 174370.59879889, 172616.85694 174371.04679888, 172613.67694 174372.43679888, 172612.27094 174372.87179888, 172610.70894 174373.35479889, 172608.85694 174373.92679889, 172608.25794001 174371.89079888, 172607.82694 174370.42679889, 172607.50694 174370.51679889, 172607.38694001 174370.06679888, 172607.01194001 174368.70179889, 172605.61394 174369.12679889, 172604.29194001 174364.49979888, 172605.79494001 174364.27579889, 172604.95794001 174361.23079889, 172604.15694 174358.31679888, 172601.38294001 174359.08279889, 172599.73694001 174359.53679889, 172599.03094001 174356.96479888, 172598.45694001 174354.87679889, 172598.31094001 174353.65579888, 172597.92494001 174352.22579889, 172597.51694001 174350.71679889, 172593.94294001 174351.68579889, 172594.45994 174353.59579889, 172594.89194001 174355.18879888, 172594.43694 174355.28679889, 172595.10394001 174357.58879888, 172595.61694 174359.35679889, 172596.36994 174361.95579889, 172596.92694 174363.87679888, 172594.25694 174364.45679888, 172594.21694 174364.31679888, 172593.00494001 174364.65379888, 172592.00394 174364.93279888, 172590.26894 174365.41579889, 172588.36994 174365.94479889, 172586.29894001 174366.52079888, 172585.71094001 174364.28879889, 172585.01994001 174361.66879889, 172584.37794 174359.23179889, 172583.45694001 174355.73579888, 172582.56194 174352.34079888, 172581.81194 174349.49579888, 172578.83494 174350.40579889, 172579.40794 174352.63579888, 172579.78994 174354.11679888, 172580.28794001 174356.05279889, 172580.77094 174357.92779888, 172581.47694 174360.66679888, 172581.97094 174362.58679888, 172582.24294 174363.61779889, 172582.54194001 174364.74379888, 172582.91294001 174366.13879888, 172583.24094001 174367.37179888, 172583.56894 174368.60379888, 172583.98394 174370.16379889, 172584.46094001 174371.95479888, 172584.86494001 174373.47379888, 172585.18994 174374.69679889, 172581.69994001 174375.73579888, 172581.45894 174374.65479888, 172581.93994 174374.65479888, 172582.48094 174373.39279888, 172580.61794 174366.54279888, 172576.54694 174367.44579888, 172576.96094001 174368.82979888, 172577.49594 174370.61579889, 172578.20294001 174372.70579888, 172578.57394 174374.21879889, 172578.69794 174374.72879888, 172578.94194001 174375.71979888, 172579.21594 174376.83779888, 172579.48694001 174377.94179888, 172579.78194 174379.14479889, 172580.08194001 174380.37079888, 172580.58694 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888, 172576.23194 174376.15679888, 172575.20994 174372.55179889, 172573.66494 174372.83079889, 172574.33394 174375.25079888, 172574.79994001 174376.93479888, 172574.46694 174377.10679889, 172573.55494 174377.38579888, 172571.95794001 174377.87279889, 172569.12694001 174378.73679888, 172570.29694 174382.59679888, 172569.06894 174382.95779889, 172567.62494 174383.37779888, 172566.17594 174383.79879889, 172564.97094 174384.14879888, 172563.53494001 174384.56479888, 172562.23594001 174384.94279889, 172561.03494001 174385.29079889, 172559.35194 174385.66979888, 172558.39794001 174385.88479888, 172556.63694001 174386.28179888, 172554.56194 174386.74879888, 172554.93394 174388.02679888, 172555.33194001 174389.39779888, 172555.78394001 174390.95079888, 172556.25094001 174392.55979888, 172556.78094001 174394.38279888, 172557.38394001 174396.45779889, 172555.12994001 174410.66979888, 172554.04194001 174412.21079889, 172554.18094001 174413.74279889, 172554.35894 174415.69279889, 172554.59094 174418.23979888, 172554.80294001 174420.57479888, 172555.02794001 174423.04279888, 172555.93294 174422.97279889, 172557.54494001 174422.84879889, 172560.00094001 174422.89679889, 172562.04294 174422.83779889, 172563.99094001 174422.77979888, 172565.29094 174422.74079889, 172567.21594 174422.68179889, 172569.10194 174422.62379888, 172568.98294001 174421.27879888, 172568.88094001 174420.13579889, 172568.73194 174418.45579889, 172568.45294001 174415.31879888, 172570.64394 174415.21279889, 172570.64394001 174420.55979889, 172572.08594001 174420.43979888, 172572.08594001 174421.46179888, 172572.89894001 174421.52179889, 172572.93594001 174418.69679889, 172572.92794001 174415.53279888, 172575.20994 174415.51279889, 172575.27294001 174421.23079888, 172577.66994001 174421.37079888, 172577.71794001 174420.68179889, 172577.72494001 174418.93679889, 172577.73594001 174415.93279888, 172580.01694001 174415.87379888, 172579.83694 174420.49979889, 172581.27894 174420.49979889, 172581.16094 174421.60179888, 172582.17694 174421.66979888, 172582.13594 174422.43279888, 172582.06294 174423.81779889, 172581.85494001 174425.10579888, 172581.54394 174425.96979888, 172582.27094 174425.90879888, 172583.34994001 174425.81679888, 172584.44594001 174425.72479888, 172585.57394 174425.43879889, 172587.27294001 174425.00679888, 172589.82794001 174424.35879889, 172589.40294001 174423.53179888, 172589.03494001 174422.06079888, 172588.59694001 174420.30879889, 172588.35594 174419.34679888, 172587.97694 174417.82879889, 172587.78294 174417.05679889, 172587.61594001 174415.77979888, 172587.36494001 174414.35979888, 172587.75394 174413.42079888, 172587.86994 174411.44879889, 172592.26794 174410.32279888, 172592.57794001 174412.11779889, 172593.54694 174411.85679889, 172593.88294001 174413.17479889, 172596.71694 174412.45279888, 172597.50594001 174415.42779888, 172593.94094 174416.36279888, 172594.31794001 174417.67579888, 172595.57994 174417.37579888, 172595.88594 174418.96979888, 172599.56994 174418.29279888, 172600.39494001 174421.68079888, 172599.12494 174422.00279888, 172597.83994001 174422.32779888, 172595.25594001 174422.98279888, 172595.67794001 174424.90679888, 172598.81094001 174424.21879889, 172599.32294 174426.26379888, 172599.83994001 174428.32779888, 172600.28294 174430.09379889, 172599.53294 174430.30379888, 172598.94794 174431.12079888, 172598.50794001 174431.73679888, 172598.17194 174432.53079888, 172597.70394001 174433.63779889, 172598.26694001 174435.35479889, 172601.68394 174434.46579888, 172602.63794001 174437.85679889, 172603.52094 174441.33179888, 172604.18794 174443.95879889, 172607.05394 174443.20479888, 172608.01694001 174447.05779888, 172602.61494001 174448.18279888, 172603.57694 174451.96779888, 172591.37294001 174454.98979888, 172593.09694001 174460.86279888, 172596.00694 174460.12279889, 172599.45294001 174459.24579888, 172605.06394001 174457.81879888, 172608.39694 174456.97079889, 172613.56094001 174455.65679888, 172614.32594 174458.77479888, 172609.11894001 174459.86879888, 172606.47194001 174460.59979888, 172604.45794001 174461.15679888, 172605.34094 174464.77179889, 172607.57394 174464.20979889, 172609.99094001 174463.60579889, 172613.07994 174462.83479889, 172613.61894001 174464.88379889, 172614.04994001 174466.51979889, 172614.37794 174467.76679889, 172612.53894001 174468.36579889, 172611.16394001 174468.81479888, 172608.52994 174469.67379888, 172609.11194001 174471.76679889, 172609.56494 174473.39879889, 172612.91294001 174485.56179888, 172614.59894 174485.11079888, 172617.38894 174484.36379889, 172622.33194001 174483.04179888, 172625.99594 174482.06079889, 172629.84294001 174481.03179888, 172641.95194 174477.65279889, 172643.75494001 174477.16979888, 172645.38894 174476.73279888, 172647.53094001 174476.15979889, 172649.87894 174475.53179888, 172652.14894001 174474.92479889, 172655.08794 174474.13879889, 172656.82294 174473.67479889, 172659.20494 174473.03779889, 172661.12994001 174472.52279888, 172663.13094001 174471.98779888, 172666.07294 174471.20079888, 172669.09894 174470.39179889, 172670.32794001 174470.07579888, 172672.24694001 174469.58179889, 172673.91894 174469.15179888, 172674.58694 174468.84879889, 172675.52994 174468.59879889, 172677.88094001 174467.97779889, 172680.51794 174467.28079889, 172683.39194001 174466.52079888, 172686.88994 174465.59579889, 172690.08694 174464.75079888, 172693.60394001 174463.82179889, 172694.71594 174465.90079889, 172695.81494 174467.95779889, 172696.76694001 174469.73679889, 172698.74294 174473.43379889, 172700.00894001 174475.80279888, 172701.21194 174478.05279888, 172702.29394 174480.07679889, 172712.67294 174477.65879888, 172714.31294 174477.23479888, 172715.92294 174476.81879889, 172718.15094 174476.24279889, 172719.85594 174475.80279888, 172719.07394 174472.68079888, 172722.78994 174471.85879889, 172723.62094 174471.64979888, 172726.34994001 174470.96079888, 172727.68494001 174470.62379888, 172728.34494 174470.45779889, 172728.94594001 174470.31079889, 172729.36494001 174470.20779889, 172733.29694 174468.74879888, 172732.51594001 174463.94179888, 172736.18094001 174462.86079888, 172736.12094 174460.75779888, 172739.38594 174460.04779889, 172751.74194 174457.62979889, 172752.52594 174459.31079889, 172753.47194001 174461.34079888, 172754.32394 174463.17079889, 172755.22994001 174465.11479888, 172756.45494 174467.74379888, 172757.91194 174470.86979889, 172759.17194 174473.57379889, 172760.30194 174475.99779889, 172767.25694 174472.63279888)))" + ) + polygon_b = from_wkt( + "MULTIPOLYGON(((172557.3838523062 174396.45835165278, 172555.12905084348 174410.6693711578, 172554.04105084387 174412.2103631608, 172554.28937084228 174414.93676316369, 172555.0277388468 174423.0425551683, 172563.7369228527 174422.37100316587, 172569.0432908535 174421.9618511684, 172568.4963957805 174415.81728130922, 172568.4972705121 174415.81723898993, 172568.45294000994 174415.31879887995, 172570.64394 174415.21279888996, 172570.64394001 174420.55979889, 172572.08594000997 174420.43979888, 172572.08594000997 174420.94152719184, 172572.77495595193 174420.8841888285, 172572.71193637606 174416.03471118974, 172572.929204253 174416.03280700246, 172572.92794000998 174415.53279887998, 172575.20994000003 174415.51279889, 172575.27294001004 174421.23079888, 172577.6697196799 174421.37078601134, 172577.70199362023 174416.43384416474, 172577.73410833202 174416.4330134905, 172577.7358131635 174415.9674395041, 172577.73594001 174415.93279888004, 172578.87644000998 174415.90329888, 172580.01694000998 174415.87379888, 172579.83694 174420.49979889003, 172581.27894 174420.49979889003, 172581.22540097954 174420.99979889003, 172582.22334147422 174420.99979889003, 172582.17621886 174421.66917916582, 172582.0176908598 174424.652603168, 172581.5430028588 174425.96959516776, 172581.36988285926 174426.44985117015, 172583.22229886055 174426.393211171, 172584.53372231862 174426.04524331444, 172585.60137086362 174425.76191516966, 172589.6888588667 174424.67730716988, 172588.59657086435 174420.30905116722, 172587.97628287587 174417.82828320874, 172587.62773886323 174416.44255516306, 172587.57641086724 174416.43890716136, 172587.6150668636 174415.78034716102, 172587.75349886715 174413.420987159, 172587.86921086907 174411.4484431595, 172591.77150026744 174410.4497097941, 172592.26794067942 174410.3228028141, 172592.57794001006 174412.11779889002, 172593.54694000003 174411.85679889002, 172593.88294001002 174413.17479889, 172596.71693999998 174412.45279888005, 172597.50594000999 174415.42779887991, 172597.172895412 174415.51514718245, 172597.022295644 174415.5546452982, 172597.0224054087 174415.55505917643, 172593.93199883454 174416.33165895962, 172593.94094 174416.36279887997, 172594.31794001002 174417.67579888002, 172595.57994 174417.37579888004, 172595.88594000004 174418.96979887996, 172599.56993999996 174418.29279888, 172600.39494000998 174421.68079888003, 172599.91025387176 174421.80368780546, 172599.94715650496 174421.95523461731, 172596.69628287107 174422.8178511672, 172595.3009759594 174423.18812865848, 172595.67794001 174424.90679888, 172598.81094000905 174424.2187988902, 172598.92996166085 174424.6941881079, 172599.32293973575 174426.26379782447, 172599.32319430308 174426.26481412462, 172599.83993917855 174428.32779556068, 172600.28294000003 174430.09379889, 172599.53294 174430.30379888, 172598.9479399949 174431.12079888713, 172598.50794000993 174431.73679888, 172598.17194137024 174432.53079564194, 172597.70394001 174433.63779889003, 172598.2660748735 174435.35474717614, 172601.1998381591 174434.5913030442, 172601.19995467947 174434.5917172166, 172601.68394000002 174434.46579888, 172602.63794000942 174437.85679888783, 172603.5209395613 174441.3317971537, 172603.67147661696 174441.92469197488, 172604.18799165756 174443.95900234475, 172607.0539523896 174443.2048484512, 172608.01694001004 174447.05779888, 172602.61494001004 174448.18279888007, 172603.57694000003 174451.96779887998, 172591.37294001 174454.98979887998, 172593.09693550566 174460.86278353556, 172605.0632588789 174457.8183631897, 172608.39689087868 174456.97023519131, 172613.0762718963 174455.77972994547, 172613.07636302974 174455.78010138884, 172613.56094001004 174455.65679887997, 172614.32594000004 174458.77479888004, 172609.11894000994 174459.86879888005, 172606.47194360537 174460.59979788712, 172604.45794001 174461.15679888, 172605.3409823247 174464.7719721671, 172612.59480380098 174462.95596724018, 172612.7014123517 174462.92927763195, 172613.07994000003 174462.83479889008, 172613.61893907966 174464.88379535347, 172613.6189968665 174464.88401470726, 172614.04993903125 174466.51979517483, 172614.37794 174467.76679889, 172612.53894704106 174468.36579659986, 172612.53852629993 174468.36593398513, 172611.16394366286 174468.81479768714, 172608.52993999998 174469.67379888, 172609.11193880375 174471.76679455204, 172609.11197085044 174471.76690999718, 172609.56229931235 174473.38928541902, 172609.5649399964 174473.3987988771, 172612.91284623384 174485.5614581992, 172616.49161088464 174484.6038992107, 172617.37810321042 174484.36670035287, 172617.3781038362 174484.3667001854, 172617.40430078932 174484.35969066346, 172621.91801405355 174483.1519558644, 172625.84397284017 174482.10148660126, 172626.28639576584 174481.983107446, 172629.84245889643 174481.0316112079, 172629.84260632202 174481.0318919951, 172641.95148947238 174477.65292460908, 172641.9513229055 174477.65228320664, 172643.55453783524 174477.22348398916, 172649.45557890835 174475.6451792046, 172652.118800357 174474.93285825956, 172655.08757891503 174474.13881120458, 172669.09820291854 174470.39141919912, 172673.91823492196 174469.15141920003, 172674.05039449205 174469.04677954124, 172674.1582349241 174468.9614031985, 172675.5150722086 174468.60274051016, 172675.58914901028 174468.58315924928, 172676.93838271403 174468.22650647085, 172685.4841995281 174465.9675284286, 172690.08649093658 174464.75097119805, 172690.35773174433 174464.679270439, 172693.6036109403 174463.82124319673, 172695.45967493954 174467.2931151986, 172695.69615282057 174467.73546474247, 172695.8858936043 174468.09038905406, 172702.29378802062 174480.0768342967, 172712.67227422315 174477.65895398633, 172712.67215495606 174477.6584912053, 172719.8562189564 174475.80549920353, 172719.13622944942 174473.1791069913, 172719.19547385076 174473.1660017983, 172719.07393999997 174472.68079888003, 172722.78994000095 174471.8587988898, 172723.6209313099 174471.64980106562, 172723.62116079254 174471.6497431358, 172726.34993987996 174470.9607989128, 172727.68514120538 174470.623748284, 172728.34493999486 174470.45779889126, 172728.94593998056 174470.3107988972, 172729.36494001048 174470.20779888984, 172733.29694 174468.74879888006, 172732.51594000997 174463.94179888, 172736.18094000997 174462.86079888, 172736.12094 174460.75779888, 172739.38593999937 174460.04779889015, 172751.74194 174457.62979889003, 172751.82374942137 174457.8052091417, 172760.30108298364 174475.9976912029, 172767.25628262636 174472.6322513803, 172767.5851149932 174472.47314720228, 172767.50690699372 174472.13401120156, 172767.1188087445 174472.3620791199, 172766.30993999983 174470.7767988602, 172765.64794001004 174469.48679887998, 172766.51694001004 174469.12679887997, 172765.12794 174466.03679888998, 172764.34694001 174466.34679888003, 172762.84694005293 174463.15679897126, 172763.29320167168 174462.94189765144, 172764.2839314731 174462.46480300103, 172765.32593999998 174461.96179887993, 172761.1385378274 174453.29491927216, 172761.13853782744 174453.29491927216, 172760.09694000988 174451.01679888976, 172759.79494001003 174450.12279889, 172760.93594000998 174449.76179888003, 172761.82593999995 174450.27579889004, 172762.67400122888 174449.91177263303, 172765.15694 174448.84679888003, 172764.19994000997 174445.99879888, 172764.60994001062 174445.80279888492, 172764.33894001 174444.31479887993, 172763.51689098784 174441.74149918192, 172763.5168882326 174441.74150007046, 172763.51688823258 174441.74150007026, 172763.21993999998 174440.02779889002, 172761.17694 174440.68879888, 172759.74790522835 174436.7047019099, 172755.11890209024 174438.21366147915, 172754.95691696025 174437.6267152474, 172754.85751089564 174437.26601325686, 172754.6069400003 174436.3567988909, 172755.10336595034 174436.22560282986, 172756.19993908802 174435.93579913364, 172758.35593845724 174435.36579929787, 172760.84694000997 174434.70679888004, 172760.58894161868 174433.5358061814, 172760.14693999995 174431.53679888978, 172759.5329400001 174429.6077988801, 172759.52534339868 174429.53306474834, 172759.48582006822 174429.1442406328, 172759.76815493542 174429.05234718855, 172759.7528128644 174429.0162936086, 172759.12745483534 174427.54860076858, 172759.12745462733 174427.54860004058, 172759.1267469823 174427.54693917185, 172759.12695293076 174427.54684410253, 172758.76693612643 174426.28678529424, 172758.12194001 174424.02879888, 172758.32293999995 174423.95879888002, 172758.05193999998 174421.82179889004, 172756.6439400104 174422.12379887994, 172756.53950232168 174422.15535105282, 172755.98194000003 174422.32379888996, 172755.12451175836 174419.47773878835, 172753.83321806323 174419.78523359896, 172752.4939518636 174414.58684488994, 172751.20706697553 174414.83333916217, 172750.73129098117 174412.7877071612, 172748.95247497407 174413.2481231615, 172748.47247497732 174411.39813916016, 172753.23247498277 174410.11813915893, 172751.57647497955 174404.02937115356, 172750.80501897636 174401.19289115068, 172749.21920579113 174395.36230315745, 172749.2194832201 174395.36220860117, 172749.08793999997 174394.87879889001, 172750.24394001003 174394.48479888003, 172751.79493705663 174393.68580041145, 172753.32194001004 174392.89979888, 172754.02694001 174394.06179887996, 172759.86194000999 174390.84279887998, 172760.84694001003 174392.75779887996, 172762.75293454644 174391.80780159816, 172762.7540957816 174391.80722369105, 172764.6779369368 174390.84980040943, 172767.0349380484 174389.675799857, 172769.10393896094 174388.64579940226, 172770.8269400001 174387.78779888, 172772.41231297184 174387.0021096416, 172769.92245898946 174381.99321113512, 172769.86473163788 174381.87794843127, 172766.27740298968 174374.71225113448, 172766.12751504182 174374.37625125528, 172765.45154720507 174372.86111561494, 172764.5623949914 174370.86834713045, 172758.44661898166 174358.71346712485, 172758.08089647835 174357.9866221479, 172758.0812897689 174357.9865175769, 172757.8519399999 174357.5307988898, 172754.4110373197 174349.3873883099, 172754.41083817216 174349.3874620819, 172754.04609390008 174348.52429801252, 172753.7164504677 174347.74419976756, 172753.71289365587 174347.7351269625, 172752.91599497944 174345.84914711493, 172752.96828298277 174345.83532311398, 172752.74697099614 174345.2712271516, 172750.88521097507 174340.5253711095, 172749.90261897308 174337.94073110458, 172742.68309897187 174319.57548309487, 172729.2444429621 174323.76869909838, 172729.1040909663 174323.3482191004, 172719.76546695834 174325.91705109927, 172721.48245895657 174332.9833551049, 172723.08294328308 174339.57013976108, 172723.03791828503 174339.58436050604, 172723.15793999998 174340.07079887998, 172719.07994 174341.35879888994, 172719.0331842302 174340.8492201192, 172718.5874979483 174340.98998616525, 172718.5534989536 174340.6227151118, 172714.9709069505 174341.62623511252, 172702.72073094547 174345.05746711424, 172703.20898694542 174346.73209111392, 172703.9096589461 174349.13503511623, 172695.26953093708 174351.39500311756, 172694.93771905327 174349.74538306356, 172692.57990415473 174350.34580801197, 172692.57334559556 174350.34747709305, 172689.68390132912 174351.0828087242, 172689.6768192437 174351.08460978328, 172686.95894150986 174351.77579850602, 172684.89594078047 174352.3007986814, 172684.8828689878 174352.30412604674, 172683.3009262921 174352.70680236846, 172681.18281584515 174353.24583040207, 172679.3319479569 174353.71579686215, 172677.40094000465 174354.20779888882, 172677.27266865686 174353.73419735025, 172676.77394073328 174351.89280155062, 172676.06193873903 174349.26679423897, 172675.7409324217 174348.08277088706, 172675.25994054292 174346.30780088357, 172675.2596599193 174346.30676614863, 172674.46692653303 174343.38374918967, 172673.58194064876 174340.11780124725, 172672.77094000002 174337.12779888004, 172670.9499049531 174337.60880813404, 172670.52563620973 174337.72080595847, 172669.09919766168 174338.09735505903, 172669.08994002102 174338.09979887708, 172668.25594001057 174338.3197988899, 172663.54094 174339.43779888, 172663.9509396747 174340.9917976469, 172663.95246609734 174340.9975798821, 172664.37093995474 174342.5827987186, 172664.9449393093 174344.75679626403, 172665.47293987044 174346.75879839866, 172665.473080069 174346.7593299183, 172666.08593904617 174349.08279523588, 172666.0860074876 174349.08305431984, 172666.77093856825 174351.67579347026, 172667.44093999997 174354.21779888, 172665.21794001 174354.76179888, 172665.0101183685 174354.8126524625, 172663.37894000002 174355.21179888002, 172663.37873282918 174355.21184957805, 172661.5809427116 174355.65179822646, 172659.15894248072 174356.2437982761, 172656.24094000997 174356.95779889004, 172655.8289405051 174354.98780124754, 172655.30694000996 174352.49479888997, 172654.75393999997 174349.85379887992, 172653.44093999994 174347.26779887994, 172650.79094000012 174346.37779887998, 172649.39294039877 174346.74579877505, 172649.3911846923 174346.7462610297, 172648.1699417751 174347.06779842527, 172643.14494001 174348.38979889, 172642.93389291374 174348.44532466854, 172640.56794000996 174349.06779889, 172640.41789637046 174349.10727144754, 172638.06294 174349.72679888003, 172635.8089427633 174350.319798163, 172634.01694338908 174350.79179799, 172631.56094000998 174351.43779888997, 172631.68094001 174351.69779888, 172630.46894738195 174352.0517967368, 172630.4687520214 174352.05185395735, 172629.2809437475 174352.39979778518, 172627.68094000997 174352.86779889, 172628.10093847304 174354.1197943085, 172628.10107294662 174354.1201945294, 172628.6879379874 174355.86679290008, 172628.68799114702 174355.86695143604, 172629.43093933648 174358.08279688127, 172629.43133035954 174358.0839622848, 172630.24693959064 174360.5147976402, 172630.24792235918 174360.51772822303, 172630.85693939638 174362.3337970801, 172631.76094 174365.02779888996, 172632.43094001003 174364.86779888996, 172632.93494001002 174366.67479888993, 172630.87694000924 174367.2867988902, 172629.35094510994 174367.69579751312, 172629.35049890392 174367.69591735688, 172627.54894514213 174368.17979751158, 172627.52128803954 174368.18721035263, 172625.4409402792 174368.7447988152, 172625.43971959242 174368.74512604062, 172623.82194391786 174369.17879783243, 172621.82194405483 174369.715797794, 172621.82183787943 174369.71582625585, 172620.13194178292 174370.16879840213, 172618.52894290345 174370.59879811114, 172616.85694000009 174371.04679887995, 172613.67694 174372.43679888, 172612.2709414281 174372.87179843814, 172610.70894325845 174373.35479788246, 172608.85694 174373.92679889, 172608.25794049533 174371.89080052968, 172607.82694000003 174370.42679889002, 172607.51030628625 174370.515852122, 172607.38694001004 174370.06679887997, 172607.01194001 174368.70179888996, 172605.61394000004 174369.12679888998, 172604.29194001 174364.49979887996, 172605.79494001003 174364.27579888995, 172604.95794001003 174361.23079889003, 172604.15693999996 174358.31679887997, 172601.3829428521 174359.08279810517, 172600.24729543962 174359.3960325686, 172597.84457264078 174350.6279695617, 172597.51694001004 174350.71679888997, 172593.94294000993 174351.68579889, 172594.4599387648 174353.5957943269, 172594.89194001 174355.18879888, 172594.43694 174355.28679888998, 172595.10393895835 174357.58879525043, 172595.61693890326 174359.35679511022, 172596.36993943545 174361.95579694142, 172596.92693999998 174363.87679887997, 172594.25694 174364.45679887995, 172594.21693999998 174364.31679888006, 172593.00494592657 174364.6537972349, 172593.00452690053 174364.65391402238, 172592.00394302807 174364.932798036, 172590.26894162453 174365.41579843775, 172588.36994388918 174365.94479780665, 172588.36984125132 174365.94482635465, 172586.29894001002 174366.52079888002, 172585.7109407086 174364.2888015419, 172585.71082483808 174364.2883622034, 172585.01994076036 174361.66880173524, 172584.8667329185 174361.0872324162, 172584.37794 174359.23179888996, 172583.4569404406 174355.73580051467, 172582.56193999999 174352.34079887997, 172581.81194 174349.49579887997, 172578.96056568567 174350.36739802494, 172585.1382444169 174374.19050227254, 172585.0614705477 174374.21335843968, 172585.18994 174374.69679888996, 172581.69994000997 174375.73579888, 172581.62350512363 174375.3929519558, 172581.93994000004 174374.65479888, 172582.48094 174373.39279888003, 172580.61794 174366.54279888, 172576.77667659082 174367.3948403584, 172578.3008907684 174373.35775476237, 172578.52405885607 174374.23071513322, 172580.47195049844 174381.85118837637, 172580.4625612569 174381.85333750857, 172580.58694000004 174382.33779888, 172578.45494 174382.82579888, 172576.95294001 174376.09679888003, 172576.23194 174376.15679888002, 172575.20993999997 174372.55179889, 172573.66458694366 174372.8308626458, 172574.0934668556 174374.3819471337, 172574.33365876754 174375.25074680167, 172574.7994377378 174376.93505831185, 172574.46694027368 174377.10679874866, 172573.55473542705 174377.38586125555, 172571.95794220705 174377.87279822002, 172569.12694000997 174378.73679888004, 172570.29693999997 174382.59679888, 172569.06894000657 174382.95779888806, 172568.98899089158 174382.9810527852, 172567.62494267538 174383.37779810186, 172566.1759413303 174383.7987985035, 172564.9709467131 174384.14879693012, 172563.53494001646 174384.5647988781, 172562.23594001002 174384.94279888997, 172561.03905731053 174385.28960586703, 172554.56188284606 174386.74853914225, 172555.21404284242 174388.99244314435, 172557.3838523062 174396.45835165278)),((172739.38594000007 174460.04779889, 172739.39373637483 174460.04610350684, 172739.392673916 174460.04121769255, 172739.3870486459 174460.03837656736, 172739.38261013498 174460.0403655549, 172739.3807950899 174460.03631378766, 172739.37623201194 174460.03835788142, 172739.37262919155 174460.04530889943, 172739.37358944913 174460.05021582366, 172739.3858038434 174460.04782553512, 172739.3859399994 174460.04779889015, 172739.38594000007 174460.04779889)))" + ) + result = safe_symmetric_difference( + polygon_a, polygon_b + ) # GEOS exception is catched self.assertTrue(result.is_valid) @@ -124,5 +141,3 @@ def test_grid_bounds_grid_division(self): polygon = Polygon([(0, 0), (0, 5), (5, 5), (5, 0), (0, 0)]) result = grid_bounds(polygon, 1.0) self.assertEqual(len(result), 25) - - diff --git a/tests/test_utils.py b/tests/test_utils.py index 5cba181..cab6625 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -4,11 +4,17 @@ from shapely import is_empty from shapely.geometry import Polygon -from brdr.utils import (multipolygons_to_singles, polygonize_reference_data, - get_oe_dict_by_ids, get_oe_geojson_by_bbox, get_breakpoints_zerostreak, - _filter_dict_by_key, filter_resulting_series_by_key, - diffs_from_dict_series, get_collection - ) +from brdr.utils import ( + multipolygons_to_singles, + polygonize_reference_data, + get_oe_dict_by_ids, + get_oe_geojson_by_bbox, + get_breakpoints_zerostreak, + _filter_dict_by_key, + filter_resulting_series_by_key, + diffs_from_dict_series, + get_collection, +) class TestUtils(unittest.TestCase): @@ -21,16 +27,19 @@ def tearDown(self): def test_get_breakpoints_zerostreak(self): sample_diff = [0, 5, 5, 3, 2, 2, 2, 6, 7, 7, 6] - breakpoints, zerostreaks = get_breakpoints_zerostreak(self.sample_series, sample_diff) + breakpoints, zerostreaks = get_breakpoints_zerostreak( + self.sample_series, sample_diff + ) assert len(breakpoints) != 0 assert len(zerostreaks) != 0 def test_get_breakpoints_zerostreak_no_zerostreaks(self): - breakpoints, zerostreaks = get_breakpoints_zerostreak(self.sample_series, self.sample_series) + breakpoints, zerostreaks = get_breakpoints_zerostreak( + self.sample_series, self.sample_series + ) assert len(breakpoints) != 0 assert len(zerostreaks) == 0 - def test_multipolygons_to_singles_empty_dict(self): data = {} result = multipolygons_to_singles(data) @@ -88,7 +97,7 @@ def test_get_oe_dict_by_ids(self): def test_get_oe_dict_by_ids_erfgoedobject(self): eo_id = 206363 - dict_thematic = get_oe_dict_by_ids([eo_id], oetype='erfgoedobjecten') + dict_thematic = get_oe_dict_by_ids([eo_id], oetype="erfgoedobjecten") self.assertFalse(is_empty(dict_thematic[str(eo_id)])) def test_get_oe_dict_by_ids_empty(self): @@ -103,7 +112,7 @@ def test_get_oe_dict_by_ids_not_existing(self): def test_get_oe_geojson_by_bbox(self): bbox = "172000,172000,174000,174000" collection = get_oe_geojson_by_bbox(bbox) - self.assertEqual(collection['type'], 'FeatureCollection') + self.assertEqual(collection["type"], "FeatureCollection") def test_filter_dict_by_key_empty_dict(self): data = {} @@ -127,44 +136,83 @@ def test_filter_resulting_series_by_key_empty_dict(self): def test_filter_resulting_series_by_key_single_key(self): # Mock resulting_series with a single distance and dictionaries with a single key - data = {1: ({"key1": "value1"}, {"key2": "value2"}, {"key3": "value3"}, {"key4": "value4"}, {"key5": "value5"}, - {"key6": "value6"})} + data = { + 1: ( + {"key1": "value1"}, + {"key2": "value2"}, + {"key3": "value3"}, + {"key4": "value4"}, + {"key5": "value5"}, + {"key6": "value6"}, + ) + } result = filter_resulting_series_by_key(data, "key1") self.assertEqual(result, {1: ({"key1": "value1"}, {}, {}, {}, {}, {})}) def test_filter_resulting_series_by_key_multiple_keys(self): # Mock resulting_series with a single distance and dictionaries with multiple keys - data = {1: ({"key1": "value1", "keyA": "valueA"}, {"key2": "value2", "keyB": "valueB"}, {"key3": "value3"}, - {"key4": "value4"}, {"key5": "value5"}, {"key6": "value6"})} + data = { + 1: ( + {"key1": "value1", "keyA": "valueA"}, + {"key2": "value2", "keyB": "valueB"}, + {"key3": "value3"}, + {"key4": "value4"}, + {"key5": "value5"}, + {"key6": "value6"}, + ) + } result = filter_resulting_series_by_key(data, "key1") self.assertEqual(result, {1: ({"key1": "value1"}, {}, {}, {}, {}, {})}) def test_filter_resulting_series_by_key_multiple_distances(self): # Mock resulting_series with multiple distances and dictionaries with a single key - data = {1: ({"key1": "value1"}, {"key2": "value2"}, {"key3": "value3"}, {"key4": "value4"}, {"key5": "value5"}, - {"key6": "value6"}), - 2: ( - {"key1": "value7"}, {"key2": "value8"}, {"key3": "value9"}, {"key4": "value10"}, - {"key5": "value11"}, - {"key6": "value12"})} + data = { + 1: ( + {"key1": "value1"}, + {"key2": "value2"}, + {"key3": "value3"}, + {"key4": "value4"}, + {"key5": "value5"}, + {"key6": "value6"}, + ), + 2: ( + {"key1": "value7"}, + {"key2": "value8"}, + {"key3": "value9"}, + {"key4": "value10"}, + {"key5": "value11"}, + {"key6": "value12"}, + ), + } result = filter_resulting_series_by_key(data, "key1") - self.assertEqual(result, - {1: ({"key1": "value1"}, {}, {}, {}, {}, {}), 2: ({"key1": "value7"}, {}, {}, {}, {}, {})}) + self.assertEqual( + result, + { + 1: ({"key1": "value1"}, {}, {}, {}, {}, {}), + 2: ({"key1": "value7"}, {}, {}, {}, {}, {}), + }, + ) def test_diffs_from_dict_series_complete(self): """Tests diffs_from_dict_series with complete data.""" # Mock data - dict_thematic = {"theme_id1": Polygon([(0, 0), (10, 0), (10, 10), (0, 10)]), - "theme_id2": Polygon([(5, 5), (15, 5), (15, 15), (5, 15)])} + dict_thematic = { + "theme_id1": Polygon([(0, 0), (10, 0), (10, 10), (0, 10)]), + "theme_id2": Polygon([(5, 5), (15, 5), (15, 15), (5, 15)]), + } dict_series = { 10: ( - {"theme_id1": Polygon([(0, 0), (8, 0), (8, 8), (0, 8)]), - "theme_id2": Polygon([(7, 7), (13, 7), (13, 13), (7, 13)])}, - {"theme_id1": Polygon([(2, 2), (6, 2), (6, 6), (2, 6)]), - "theme_id2": Polygon([(9, 9), (11, 9), (11, 11), (9, 11)])}, + { + "theme_id1": Polygon([(0, 0), (8, 0), (8, 8), (0, 8)]), + "theme_id2": Polygon([(7, 7), (13, 7), (13, 13), (7, 13)]), + }, + { + "theme_id1": Polygon([(2, 2), (6, 2), (6, 6), (2, 6)]), + "theme_id2": Polygon([(9, 9), (11, 9), (11, 11), (9, 11)]), + }, ) } - expected_diffs = {'theme_id1': {10: -36.0}, 'theme_id2': {10: -64.0}} + expected_diffs = {"theme_id1": {10: -36.0}, "theme_id2": {10: -64.0}} result = diffs_from_dict_series(dict_series.copy(), dict_thematic.copy()) # Assert expected diffs self.assertEqual(result, expected_diffs) @@ -172,13 +220,13 @@ def test_diffs_from_dict_series_complete(self): def test_get_collection(self): base_year = 2023 limit = 100 - crs = 'EPSG:31370' + crs = "EPSG:31370" bbox = "173500,173500,174000,174000" ref_url = ( - "https://geo.api.vlaanderen.be/Adpf/ogc/features/collections/Adpf" - + str(base_year) - + "/items?" - "limit=" + str(limit) + "&crs=" + crs + "&bbox-crs=EPSG:31370&bbox=" + bbox + "https://geo.api.vlaanderen.be/Adpf/ogc/features/collections/Adpf" + + str(base_year) + + "/items?" + "limit=" + str(limit) + "&crs=" + crs + "&bbox-crs=EPSG:31370&bbox=" + bbox ) collection = get_collection(ref_url, limit) - self.assertTrue('features' in collection.keys()) + self.assertTrue("features" in collection.keys())