Skip to main content

GEOSFuncFactory

Lazy loading of GEOS functions.

Attributes

AttributeTypeDescription
argtypeslist = nullA list of ctypes types representing the argument types accepted by the GEOS function.
restypetype = nullThe ctypes type representing the return type of the GEOS function.
errcheckcallable = nullA callable used to validate the result of the GEOS function and handle potential errors.

Constructor

Signature

def GEOSFuncFactory(
func_name: string,
restype: object = None,
errcheck: callable = None,
argtypes: list = None
) - > null

Parameters

NameTypeDescription
func_namestringThe name of the GEOS function to be loaded.
restypeobject = NoneThe expected return type of the GEOS function.
errcheckcallable = NoneAn optional error checking function to validate the GEOS function output.
argtypeslist = NoneA list of types representing the arguments the GEOS function accepts.

Signature

def GEOSFuncFactory(
func_name: string,
restype: object,
errcheck: callable,
argtypes: list
)

Parameters

NameTypeDescription
func_namestringThe name of the GEOS C function to be wrapped and called.
restypeobjectThe expected return type of the GEOS function, used for ctypes conversion.
errcheckcallableA function used to validate the result and handle errors returned by the GEOS C function.
argtypeslistA list of ctypes data types representing the required arguments for the GEOS function.

Methods


func()

@classmethod
def func() - > [GEOSFunc](../prototypes/threadsafe/geosfunc.md?sid=django_contrib_gis_geos_prototypes_threadsafe_geosfunc)

Retrieves the thread-safe GEOSFunc instance, initializing it with the configured name, argument types, and return types upon first access.

Returns

TypeDescription
[GEOSFunc](../prototypes/threadsafe/geosfunc.md?sid=django_contrib_gis_geos_prototypes_threadsafe_geosfunc)A configured, thread-safe callable object representing the GEOS C function.