[gdal-dev] Reg: Getting center coordinates for the attributes in a geojson

Manikanta Kondeti mani.iiit123 at gmail.com
Wed Feb 18 03:02:23 PST 2015


Hello,

Thanks for the response.  Can I put a flag for the centroid computation?

For eg:  ogr2ogr -f GeoJSON -t_srs crs:84 [name].geojson [name].shp
 (--flag for centroid??)


On Wed, Feb 18, 2015 at 4:20 PM, Even Rouault <even.rouault at spatialys.com>
wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150218/c758680d/attachment-0001.html>


More information about the gdal-dev mailing list