Skip to content

Commit

Permalink
Decoding fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ckerklaan committed Nov 29, 2022
1 parent 21f9e5f commit 2f7bf52
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
5 changes: 2 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ Changelog of threedi-edits
===================================================

1.2.1 (2022-11-15)
----------------
---------------------------------------------------

- Versioning support for schema 0210.
- FID column fix.
- Updated sideview example.


1.0 (2022-11-15)
----------------
---------------------------------------------------

- Evolution from threedi-raster-edits (v0.27)
Binary file modified dist/threedi-edits-1.2.1.tar.gz
Binary file not shown.
Binary file modified dist/threedi_edits-1.2.1-py3-none-any.whl
Binary file not shown.
7 changes: 3 additions & 4 deletions threedi_edits/examples/sideview.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ def create(
buffered_node = schema.nodes[node_id].geometry.buffer(0.00001)
buffered_node = buffered_node.reproject(28992)
clipped_channel = channel.clip(geometry=buffered_node).dissolve(quiet=True)
line = clipped_channel[0]
line = clipped_channel.first()

if line.geometry.IsEmpty():
output["oeverhoogte"].append([None, None])
continue

perpendicular_line = line.geometry.perpendicular_lines(0.5, 20)[0]
levee = levees.spatial_filter(perpendicular_line, return_vector=True)
levee = levees.spatial_subset(perpendicular_line)
if levee.count > 0:
if levee.count == 2:
output["oeverhoogte"].append(
Expand All @@ -152,7 +152,6 @@ def create(
levee[levee.fids[1]]["crest_level"],
]
)
print(levee.fids, node_id)
else:
output["oeverhoogte"].append(
[levee[levee.fids[0]]["crest_level"], None]
Expand Down Expand Up @@ -259,7 +258,7 @@ def create(
selection_shape = (
r"C:/Users/chris.kerklaan/Documents/Projecten/overijssels_kanaal/ovk.shp"
)
output_name = r"C:\Users\chris.kerklaan\Documents\Projecten\overijssels_kanaal\processing/sideview_NVO_manning_03.png"
output_name = r"C:\Users\chris.kerklaan\Documents\Projecten\overijssels_kanaal\sideview_NVO_manning_0321.png"
start_time = 120 * 3600
start_node_id = 74507
create(
Expand Down
5 changes: 2 additions & 3 deletions threedi_edits/gis/vectorbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,10 +868,9 @@ def _VSIFPrintfL(f, s):


def _Esc(x):
if gdal.__version__ == "3.5.2":
if isinstance(x, (bytes, bytearray)):
return gdal.EscapeString(x, gdal.CPLES_XML).decode("UTF-8")
else:
return gdal.EscapeString(x, gdal.CPLES_XML)
return gdal.EscapeString(x, gdal.CPLES_XML)


class XMLWriter:
Expand Down

0 comments on commit 2f7bf52

Please sign in to comment.