Commit 046f2ac2 authored by Rick Gruber-Riemer's avatar Rick Gruber-Riemer

Fix for issue #112: too few points in polygon in aptdat

parent 44bbc799
......@@ -14,7 +14,6 @@ Ludomotico contributed a cleaner version of read_from_file().
import argparse
import logging
import re
import sys
import traceback
import types
......@@ -25,7 +24,6 @@ import textures.road
import utils.vec2d as v
import utils.calc_tile as ct
import utils.log_helper as ulog
import utils.utilities as uu
# default_args_start # DO NOT MODIFY THIS LINE
# -*- coding: utf-8 -*-
......@@ -540,6 +538,7 @@ def set_boundary(boundary_west: float, boundary_south: float,
"""Overrides the geographical boundary values (either default values or read from file).
In most situations should be called after method read_from_file().
"""
import utils.utilities as uu
try:
uu.check_boundary(boundary_west, boundary_south, boundary_east, boundary_north)
except uu.BoundaryError as be:
......
......@@ -44,6 +44,8 @@ class Boundary:
if self.not_empty:
boundaries = list()
for my_list in self.nodes_lists:
if len(my_list) < 3:
continue
my_boundary = Polygon([transformer.to_local(n) for n in my_list])
if my_boundary.is_valid:
boundaries.append(my_boundary)
......
......@@ -3,7 +3,7 @@
shamelessly translated from calc-tile.pl
"""
import logging
from math import floor, radians
from math import floor
import os
from typing import List, Tuple
import unittest
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment