jonas-p / go-shp

Go library for reading and writing ESRI Shapefiles. Pure Golang implementation based on the ESRI Shapefile technical description.
MIT License
255 stars 67 forks source link

fix shape overreading bug #49

Open mikeatacme opened 3 years ago

mikeatacme commented 3 years ago

I discovered this bug when attempting to read Shapefiles which contained PointZ records with no M value.

This fix has not been tested for all of the various Shape types which possess optional values, just the PointZ case, but at a glance it appears that the various shape.Read() implementations should do the right thing with the fix in place, and it will prevent Next() from getting out of sync with the records.

codecov-io commented 3 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@9fd306a). Click here to learn what that means. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #49   +/-   ##
=========================================
  Coverage          ?   60.43%           
=========================================
  Files             ?        7           
  Lines             ?      690           
  Branches          ?        0           
=========================================
  Hits              ?      417           
  Misses            ?      219           
  Partials          ?       54           
Impacted Files Coverage Δ
reader.go 61.86% <100.00%> (ø)
sequentialreader.go 51.45% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9fd306a...d93efca. Read the comment docs.