<div dir="ltr">Thank you again, regards!</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Oct 1, 2013 at 5:16 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org" target="_blank">even.rouault@mines-paris.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le mardi 01 octobre 2013 22:05:55, Federico Jurio a écrit :<br>
<div class="im">> Thank you for your advice Even, it works perfectly!<br>
> i have another issue, what is the unit of dfDist from<br>
</div>> Buffer<<a href="http://www.gdal.org/ogr/classOGRGeometry.html#ab34b27e2c8812a0fc1dcc" target="_blank">http://www.gdal.org/ogr/classOGRGeometry.html#ab34b27e2c8812a0fc1dcc</a><br>
> f055b11d1a2> ?<br>
<br>
The same unit as the coordinates of your geometries : degrees if your<br>
coordinates are in degrees, meters if they are in meters, etc...<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
><br>
> On Tue, Oct 1, 2013 at 4:02 PM, Even Rouault<br>
><br>
> <<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>>wrote:<br>
> > Le lundi 30 septembre 2013 23:12:30, federico a écrit :<br>
> > > Dear all, i'm trying buffer some geometries with GDAL. I have success<br>
> ><br>
> > with<br>
> ><br>
> > > poligons and lines but i can't create the buffer when i try to do the<br>
> ><br>
> > same<br>
> ><br>
> > > procedure with an OGRPoint.<br>
> > ><br>
> > > Here is a screenshot with the buffer <a href="http://i.imgur.com/rRQuooc.jpg" target="_blank">http://i.imgur.com/rRQuooc.jpg</a><br>
> > ><br>
> > > I'm using the Buffer function from OGRGeometry Class in a map with WGS<br>
> > > 84 coordinates reference system.<br>
> > ><br>
> > > Anyone know what could be wrong?<br>
> ><br>
> > This should work. Make sure your target layer can contain polygons. Your<br>
> > code<br>
> > sample isn't sufficient to detect what might go wrong in your case.<br>
> ><br>
> > Just a few remarks : you are going to suffer from 3 memory leaks in your<br>
> > code<br>
> > sample (if it isn't an extract of your real code) :<br>
> > * Buffer() returns a new geometry object. So use SetGeometryDirectly() so<br>
> > that<br>
> > it is owned by pnewfeature<br>
> > * you should delete pnewfeature after having passed it to CreateFeature()<br>
> > * you should delete pfeature when it is no longer used<br>
> ><br>
> > > Code example<br>
> > ><br>
> > > OGRFeature *pfeature = player->GetNextFeature(); // Apunta al primer<br>
> > ><br>
> > > feature<br>
> > ><br>
> > > while (pfeature) {<br>
> > ><br>
> > > OGRFeature* pnewfeature = pfeature->Clone();<br>
> ><br>
> > pnewfeature->SetGeometry(pnewfeature->GetGeometryRef()->Buffer(bufferdist<br>
> > ))<br>
> ><br>
> > > ; pdestlayer->CreateFeature(pnewfeature);<br>
> > ><br>
> > > pfeature = player->GetNextFeature();<br>
> > ><br>
> > > }<br>
> > ><br>
> > > --<br>
> > > View this message in context:<br>
> > > <a href="http://osgeo-org.1560.x6.nabble.com/Buffering-geometries-tp5081031.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/Buffering-geometries-tp5081031.html</a><br>
> > > Sent from the GDAL - Dev mailing list archive at Nabble.com.<br>
> > > _______________________________________________<br>
> > > gdal-dev mailing list<br>
> > > <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
> > > <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
> ><br>
> > --<br>
> > Geospatial professional services<br>
> > <a href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a><br>
<br>
--<br>
Geospatial professional services<br>
<a href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Federico Jurio<br><div>SUR Emprendimientos Tecnológicos<br></div><div><br></div><div>Perú 345 Piso 5to Oficina "B" (C1067AAG)<br>
</div><div><div>Ciudad de Buenos Aires, Argentina</div><div>Tel. +54 (11) 4342-2976/84</div></div><div><div><a href="mailto:federicojurio@suremptec.com.ar" target="_blank">federicojurio@suremptec.com.ar</a></div><div><a href="http://www.suremptec.com" target="_blank">www.suremptec.com</a></div>
</div></div>
</div>