Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [0.28.0] - 2026-04-19

### Fixed

- Catch another type of geographic exception from shapely https://github.com/OpenDataServices/flatten-tool/pull/484

### Removed

- We no longer support Python 3.9 - security support has ended
Expand Down
7 changes: 6 additions & 1 deletion flattentool/json_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,12 @@ def parse_json_dict(
_sheet_key = sheet_key(sheet, parent_name.strip("/"))
try:
geom = shapely.geometry.shape(json_dict)
except (shapely.errors.GeometryTypeError, TypeError, ValueError) as e:
except (
shapely.errors.GeometryTypeError,
shapely.errors.GEOSException,
TypeError,
ValueError,
) as e:
warn(
_("Invalid GeoJSON: {parser_msg}").format(parser_msg=repr(e)),
DataErrorWarning,
Expand Down
14 changes: 14 additions & 0 deletions flattentool/tests/test_json_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,14 @@ def test_parse_bad_geojson(recwarn):
],
}
},
{
"d": {
"type": "LineString",
"coordinates": [
[Decimal("-0.173"), Decimal("5.626")],
],
}
},
],
}
],
Expand All @@ -976,6 +984,7 @@ def test_parse_bad_geojson(recwarn):
{},
{},
{},
{},
]
w = recwarn.pop(UserWarning)
assert (
Expand All @@ -993,6 +1002,11 @@ def test_parse_bad_geojson(recwarn):
str(w.message)
== "Invalid GeoJSON: ValueError('setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part.')"
)
w = recwarn.pop(UserWarning)
assert (
str(w.message)
== "Invalid GeoJSON: GEOSException('IllegalArgumentException: point array must contain 0 or >1 elements\\n')"
)
assert len(recwarn.list) == 0


Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ ignore = E,W

[extract_messages]
mapping_file = babel.cfg
output-file = flattentool/locale/en/LC_MESSAGES/flatten-tool.po
output_file = flattentool/locale/en/LC_MESSAGES/flatten-tool.po

[compile_catalog]
directory = flattentool/locale
domain = flatten-tool
use-fuzzy = yes
use_fuzzy = yes

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def run(self):

setup(
name="flattentool",
version="0.27.0",
version="0.28.0",
author="Open Data Services",
author_email="code@opendataservices.coop",
packages=["flattentool"],
Expand Down
Loading