Open source API to convert raster to polygons?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Open source API to convert raster to polygons?

Ricardo Pereira
    Hi all,
   
    Does anyone know of any open source geoprocessing APIs that I can
use to convert raster maps into polygons (as a shapefile or SQL for
PostGIS)? Does QGIS do that?

    I know that GDAL (via gdal_contour utility) can turn a raster into
lines, but that's not good enough for me. I need closed polygons that I
later intend to import into PostGIS. Gdal_contour would give usable
intermediate results (i.e, it produces lines that I think can be turned
into closed polygons), if it wasn't for the open polygons that are
created where the grid values touch NODATA values.

    I have considered using GRASS (r.poly) but I need to embed the
geoprocessing library on an research application that I will deploy to
Windows desktop computers. To be completely honest, I can't even
install  GRASS on my Windows workstation, so I have no hopes of
deploying it via a neat installer :(( . That's probably due to the lack
of intelligence and patience, and is another story.

    Any help with this would be greatly appreciated.

    Cheers,

Ricardo Pereira
Software Engineer and GIS Application Developer

   

   
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: [gdal-dev] Open source API to convert raster to polygons?

Ricardo Pereira
    Sorry Joaquim,

    You are right. I haven't been precise enough.

    What I really need is some API or software library (preferably in C
or C++) that I could use to convert ESRI Arc/Info Grids (the binary
kind) to a Shapefile of polygons. If a library isn't available, a
command line utility that I can call from C/C++ would suffice.

    I hope this clarify things a bit.

    Cheers,

Ricardo


Joaquim Luis wrote:
>> Ricardo Scachetti Pereira kirjoitti:
>>>    Hi all,
>>>      Does anyone know of any open source geoprocessing APIs that I
>>> can use to convert raster maps into polygons (as a shapefile or SQL
>>> for PostGIS)? Does QGIS do that?
> Hi,
> I am sorry but I have some difficulties in understanding this discussion.
> What is a raster to polygon conversion?

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: [gdal-dev] Open source API to convert raster to polygons?

Barry Rowlingson
Ricardo Scachetti Pereira wrote:

>     What I really need is some API or software library (preferably in C
> or C++) that I could use to convert ESRI Arc/Info Grids (the binary
> kind) to a Shapefile of polygons. If a library isn't available, a
> command line utility that I can call from C/C++ would suffice.

  There's some raster-to-vector conversion tools, but I don't know any
that produce shapefiles. However, if the output is in a sensible enough
format then it should be easy to convert from that to shapefile.

Try these:

  http://autotrace.sourceforge.net/

  http://delineate.sourceforge.net/screenshots.html

  and see if they can successfully trace your rasters.

  Mostly these tools will smooth out the jagged edges of raster areas -
is this what you want, or do you want your shapefiles to strictly follow
the raster cell boundaries? That's a different problem altogether, and
probably more easy to do...

Barry
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer