[gdal-dev] Reg: Getting center coordinates for the attributes in a geojson
Even Rouault
even.rouault at spatialys.com
Wed Feb 18 02:50:01 PST 2015
Le mercredi 18 février 2015 11:43:10, Manikanta Kondeti a écrit :
> Hi all,
>
> I'm working on a project which aims to visualize Spatial Vector Data on a
> browser. Using gdal I will convert Shapefiles, kml, gml into geojson and
> send it back to the browser.
>
> I want to draw labels(attributes) on the map, using GDAL can I get each
> feature's centre coordinates without computing them on the browser side, so
> that I can easily draw them on the map?
Mani,
OGR_G_Centroid() / OGRGeometry::Centroid() should help.
See
http://www.gdal.org/ogr__api_8h.html#a23f5a19a81628af7f9cc59a37378cb2b
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the gdal-dev
mailing list