Debian Codegraph @

django/contrib/gis/geos/prototypes/prepared.py

raw
1 from ctypes import c_byte
2
3 from django.contrib.gis.geos.libgeos import GEOM_PTR, PREPGEOM_PTR, GEOSFuncFactory
4 from django.contrib.gis.geos.prototypes.errcheck import check_predicate
5
6 # Prepared geometry constructor and destructors.
7 geos_prepare = GEOSFuncFactory("GEOSPrepare", argtypes=[GEOM_PTR], restype=PREPGEOM_PTR)
8 prepared_destroy = GEOSFuncFactory("GEOSPreparedGeom_destroy", argtypes=[PREPGEOM_PTR])
9
10
11 # Prepared geometry binary predicate support.
12 class PreparedPredicate(GEOSFuncFactory):
13 argtypes = [PREPGEOM_PTR, GEOM_PTR]
14 restype = c_byte
15 errcheck = staticmethod(check_predicate)
16
17
18 prepared_contains = PreparedPredicate("GEOSPreparedContains")
19 prepared_contains_properly = PreparedPredicate("GEOSPreparedContainsProperly")
20 prepared_covers = PreparedPredicate("GEOSPreparedCovers")
21 prepared_crosses = PreparedPredicate("GEOSPreparedCrosses")
22 prepared_disjoint = PreparedPredicate("GEOSPreparedDisjoint")
23 prepared_intersects = PreparedPredicate("GEOSPreparedIntersects")
24 prepared_overlaps = PreparedPredicate("GEOSPreparedOverlaps")
25 prepared_touches = PreparedPredicate("GEOSPreparedTouches")
26 prepared_within = PreparedPredicate("GEOSPreparedWithin")