[geos-devel] Question about GEOSPolygonize_full_r

Sean Gillies sean.gillies at gmail.com
Fri Jul 19 08:49:58 PDT 2013


Thanks a bunch, strk! I got it sorted out with your reminder:
https://github.com/Toblerity/Shapely/issues/57.


On Fri, Jul 19, 2013 at 1:34 AM, Sandro Santilli <strk at keybit.net> wrote:

> On Thu, Jul 18, 2013 at 09:47:35PM -0600, Sean Gillies wrote:
> > Hi all,
> >
> > Shapely users have been asking me about access to GEOSPolygonize_full_r
> and
> > I'm looking into it today. One thing I don't understand about the
> function
> > (not being much of a C++ programmer anymore) is why the cuts, dangles,
> and
> > invalid rings are only retrieved if the pointers passed in for them are
> not
> > NULL?
> >
> > http://trac.osgeo.org/geos/browser/tags/3.3.8/capi/geos_ts_c.cpp#L3077
> >
> > Wouldn't it be better if the pointers *were* NULL since they are supposed
> > to point to memory allocated by this function instead of bringing in data
> > from the caller?
>
> The pointer value (*cuts) can be null, the code doesn't even check for
> that.
> But you pass a pointer to the pointer, so that the code can change the
> pointer value.
>
> --strk;
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geos-devel
>



-- 
Sean Gillies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20130719/9749902d/attachment-0001.html>


More information about the geos-devel mailing list