Skip to content

[Bug]: Shapefile export drops vertices with a missing coordinate without a notice #1687

Closed

Description

@flight1973

Before you start

  • I searched the existing issues and did not find a duplicate.
  • This is a bug report, not a usage question.

What happened?

A Shapefile export leaves out vertices whose coordinates are missing or infinite (NaN), and doesn't say so. The feature itself is written, so it isn't counted as left out either. A multipoint of four members, one of them NaN, comes out with three. Lines and polygons lose such vertices the same way, and a part or ring left with too few vertices goes too.

The code is the filter(finite) in shapefile_parts_in (crates/data/src/io.rs), for points, line parts and polygon rings.

Steps to reproduce

This uses mp.shp from the zip attached to #1552: one MultiPoint with three stations and one member whose x is NaN.

rustgis-cli run --data mp.shp --cmd 'share.exportLayer={"layer":"mp","path":"copy.shp"}'

The export reports "leftOut": 0 and no notice. copy.shp holds one multipoint of 3 points.

Expected behavior

A notice with a count, like the one for features left out, for example "1 vertex(es) with a coordinate missing or infinite left out of the Shapefile".

How are you running RustGIS?

Command line (rustgis-cli)

Version

Checked with a build of #1572's branch; the writer code is the same on main.

Operating system, browser and graphics

macOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions