[gdal-dev] Convert grid to polygon shapefile

Paul Meems bontepaarden at gmail.com
Tue Apr 11 03:14:18 PDT 2023


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 <pcreso at 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 <bontepaarden at 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 at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230411/c05a4068/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 17410 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230411/c05a4068/attachment-0001.png>


More information about the gdal-dev mailing list