NetTopologySuite / NetTopologySuite.IO.Esri

BSD 3-Clause "New" or "Revised" License
31 stars 16 forks source link

How to write Shapefile header #24

Closed xSandoval21x closed 1 year ago

xSandoval21x commented 1 year ago

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?

KubaSzostak commented 1 year ago

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.

xSandoval21x commented 1 year ago

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

xSandoval21x commented 1 year ago

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

KubaSzostak commented 1 year ago

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.