[gdal-dev] Extract centroids

Smith, Michael ERDC-CRREL-NH Michael.Smith at usace.army.mil
Thu Nov 3 07:33:33 EDT 2011


This may not be the simplest way but you could use mapserver to draw the polygon layer as a point layer (at the centroids) and then use the wfs export format capability to export back to shapefile.

Mike

--
Michael Smith
US Army Corps
Remote Sensing GIS/Center

From: Chaitanya kumar CH <chaitanya.ch at gmail.com<mailto:chaitanya.ch at gmail.com>>
Date: Thu, 3 Nov 2011 08:12:39 +0530
To: katrin eggert <katrineggert1980 at gmail.com<mailto:katrineggert1980 at gmail.com>>
Cc: gdal dev <gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>>
Subject: Re: [gdal-dev] Extract centroids

That's exactly what I meant. None of the prebuilt utilities do that.
You should try other desktop GIS programs like QGIS.

On Thu, Nov 3, 2011 at 12:12 AM, katrin eggert <katrineggert1980 at gmail.com<mailto:katrineggert1980 at gmail.com>> wrote:
Hi (again ! :) )
Ok you mean developing a function and use OGR library right? so none of the pre-built functions (e.g. ogr2ogr) is able to do that ?
THanks
Kat


2011/11/2 Chaitanya kumar CH <chaitanya.ch at gmail.com<mailto:chaitanya.ch at gmail.com>>
katrin,

You can programatically extract the centroids. You can use the OGR_G_Centroid() function on the geometry.

On Thu, Nov 3, 2011 at 12:06 AM, katrin eggert <katrineggert1980 at gmail.com<mailto:katrineggert1980 at gmail.com>> wrote:
Greetings
Just one question: I tried to find in Google if GDAL could be used to extract polygons centroids. But I was not able to find anything. Is it possible?
Kat

_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/gdal-dev



--
Best regards,
Chaitanya kumar CH.

+91-9494447584<tel:%2B91-9494447584>
17.2416N 80.1426E




--
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
_______________________________________________ gdal-dev mailing list gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org> http://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20111103/f4b4d1d8/attachment.html


More information about the gdal-dev mailing list