[geos-devel] Re: [geos-commits] r3046 - trunk/src/geom

strk strk at keybit.net
Mon Jun 21 05:22:34 EDT 2010


On Mon, Jun 21, 2010 at 09:32:50AM +0200, Maxime van Noppen wrote:
> On 06/21/2010 02:53 AM, svn_geos at osgeo.org wrote:
> > Modified:
> >    trunk/src/geom/GeometryCollection.cpp
> > Log:
> > Geometry::getGeometryN is an API function, so make it safe/checked
> 
> Is there a guideline on such topics ?

Not really.
You're right about additional cost, but I dubt it'll really
be noticeable. Have some profiles ?

We could move the checks in higher level APIs and
leave internals alone. Note that the C-API says it'd return
0 on exception. Isn't asking for an non-existant child 
an exceptional request ? Should the C-API functions check ?

The ones I changed are:
	GeometryCollection::getGeometryN
	LineString::getPointN
	Polygon::getInteriorRingN

Note that LineString::getStartPoint and ::getEndPoint already check
for being empty.

--strk; 

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html


More information about the geos-devel mailing list