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 68 forks source link

Check for magic number in headers #38

Open peterstace opened 5 years ago

peterstace commented 5 years ago

This change checks for the magic number 9994 in the first 4 bytes of the header as per the shapefile spec (https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf). This is useful for detecting a non-shapefile being parsed as though it were a shapefile.

codecov-io commented 5 years ago

Codecov Report

Merging #38 into master will decrease coverage by 0.12%. The diff coverage is 54.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #38      +/-   ##
==========================================
- Coverage   60.09%   59.97%   -0.13%     
==========================================
  Files           7        7              
  Lines         802      812      +10     
==========================================
+ Hits          482      487       +5     
- Misses        264      267       +3     
- Partials       56       58       +2
Impacted Files Coverage Δ
sequentialreader.go 50.42% <50%> (-0.46%) :arrow_down:
reader.go 61.31% <60%> (-0.05%) :arrow_down:

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...5111115. Read the comment docs.

peterstace commented 5 years ago

@fawick , I've address your suggestions, please let me know if there are any extra changes you'd like before merging.