def errcheck(result, func, cargs): if not result: raise GEOSException( 'Error encountered checking Coordinate Sequence returned from GEOS ' 'C function "%s".' % func.__name__ ) return result
def check_cs_ptr(result, func, cargs): "Error checking on routines that return Geometries." if not result: raise GEOSException( 'Error encountered checking Coordinate Sequence returned from GEOS ' 'C function "%s".' % func.__name__) return result
def check_cs_op(result, func, cargs): "Check the status code of a coordinate sequence operation." if result == 0: raise GEOSException("Could not set value on coordinate sequence") else: return result
from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import ( GEOSException, last_arg_byref, ) # ## Error-checking routines specific to coordinate sequences. ## def check_cs_op(result, func, cargs): <<<<<<< HEAD "Checks the status code of a coordinate sequence operation." ======= "Check the status code of a coordinate sequence operation." >>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435 if result == 0: raise GEOSException('Could not set value on coordinate sequence') else: return result def check_cs_get(result, func, cargs): <<<<<<< HEAD "Checking the coordinate sequence retrieval." ======= "Check the coordinate sequence retrieval." >>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435 check_cs_op(result, func, cargs) # Object in by reference, return its value. return last_arg_byref(cargs)