NetTopologySuite/NetTopologySuite.IO.Esri

How to write Shapefile header

Closed this issue · 4 comments

I have the NetTopologySuite.IO.Esri.Shapefile.WriteAllFeatures(features, path); working in my code. I have a requirement to set the Shapefile Header with file code, file length, version, shape type, Xmin, Ymin, Xmax, Ymax. Is there documentation on setting the file header with NetTopologySuite.IO.Esri?

All header values, for both SHP and SXH, are set by ShpWriter using this code. As you can see in the code all described above values are set. It seems like your requirement is already set.

If there is any problem with generated header please describe what exactly the issue is.

Thank you very much for pointing me to that code @KubaSzostak That's exactly what I needed.

@KubaSzostak Is there a way with the Shapefile Writer to write all files to a zip file?

Is there a way with the Shapefile Writer to write all files to a zip file?

Sure. Use ZIP streams directly in Shapefile*Writer class constructor.