NetTopologySuite/NetTopologySuite.IO.Esri

Do not write SHP files that are over 2gb

Closed this issue · 2 comments

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.

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

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