Thanks, Brent and Paul for your suggestions. I just tried gdal_polygonize.py and the result looks OK, but the lines are very jagged.
I also tried gdal_contour and it has the option to create polygons. And that result is looking better. And gdal_contour is also easier to call from a C# application that a Python script ;) I need to investigate further but I'll use gdal_contour. Thanks, Paul Op ma 10 apr 2023 om 23:10 schreef Brent Wood <pcr...@yahoo.com>: > I have done this with QGIS, if you have a grid with categorised values, > QGIS can generate a polygon shapefile with the cell boundaries merged by > cell value. > > QGIS uses gdal_polygonize.py under the hood to do this (via a simple GUI > interface), so if you work out the command line parameters you need, you > could run it from the command line. > > > HTH, > > Brent Wood > > > On Fri, 7 Apr 2023 at 10:34, Paul Meems <bontepaar...@gmail.com> wrote: > > Hello List, > I'm working on a C# application that uses Golden Software Surfer to create > maps, but I also need to export the data to a polygon shapefile. > Unfortunately, Surfer creates a shapefile with shapes on top of each other > instead of inside each other, and Golden Software support couldn't help > with this issue. > > I have a grid-file in Surfer Bin Grid format that can be converted to > other raster formats, a border shapefile created using ST_Convexhull, and a > text file indicating the values of the polygons. > > [image: image.png] > > Can anyone recommend a way to use GDAL/OGR to make a polygon shapefile > from these resources, or suggest an alternative approach? > > Regards, > > Paul > > _______________________________________________ > gdal-dev mailing list > gdal-dev@lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/gdal-dev > > _______________________________________________ > gdal-dev mailing list > gdal-dev@lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/gdal-dev >
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev