NetTopologySuite / NetTopologySuite.IO.Esri

BSD 3-Clause "New" or "Revised" License
35 stars 18 forks source link

Do not write SHP files that are over 2gb #42

Closed mburbea closed 3 months ago

mburbea commented 7 months ago

The ShapeWriter can produce shp files that are over 2gb (int.MaxValue bytes). Unfortunately, ArcGis Pro (and possibly other tools), cannot actually correctly read such large files.

I had some shapefiles that I created that had produced slightly more than 2gb of shape data, and I originally thought it was some sort of arcgis bug that my 300,000 row shapefile was stopping at 269,861 rows. Apparently that was the cut off point where my file was over the 2gb limit. While my dbf was small enough to show the rows, the remaining feature polygons could not be read.

If the SHP length field exceeds int.MaxValue an invalid operation exception should be thrown as the file is likely unusable.

KubaSzostak commented 7 months ago

Thanks for pointing that out. We will address the issue as soon as a free time slot becomes available.

KubaSzostak commented 7 months ago

There is a 2 GB size limit for any shapefile component file, which translates to a maximum of roughly 70 million point features. The actual number of line or polygon features you can store in a shapefile depends on the number of vertices in each line or polygon (a vertex is equivalent to a point). — Esri Documentation