Skip to content

Commit

Permalink
Bugfix PolylineZ with multiple features
Browse files Browse the repository at this point in the history
  • Loading branch information
abrman committed Nov 12, 2024
1 parent ae33d67 commit c8ce01c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-donuts-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"shp-kit": patch
---

PolylineZ with multiple features now exports correctly
4 changes: 2 additions & 2 deletions src/private/writers/PolyLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const shpLength = (
const file_header_length_bytes = 100;
const records_header_length_bytes = features.length * 8;
let polyline_record_length_bytes = 44 * features.length + parts * 4 + coordinates.length * 16;
if (typeString === "PolyLineM") polyline_record_length_bytes += 16 + coordinates.length * 8;
if (typeString === "PolyLineZ") polyline_record_length_bytes += 32 + coordinates.length * 16;
if (typeString === "PolyLineM") polyline_record_length_bytes += features.length * 16 + coordinates.length * 8;
if (typeString === "PolyLineZ") polyline_record_length_bytes += features.length * 32 + coordinates.length * 16;
return file_header_length_bytes + records_header_length_bytes + polyline_record_length_bytes;
};

Expand Down

0 comments on commit c8ce01c

Please sign in to comment.