You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

prepared.py 1.2KB

12345678910111213141516171819202122232425262728
  1. from ctypes import c_byte
  2. from django.contrib.gis.geos.libgeos import (
  3. GEOM_PTR, PREPGEOM_PTR, GEOSFuncFactory,
  4. )
  5. from django.contrib.gis.geos.prototypes.errcheck import check_predicate
  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. # Prepared geometry binary predicate support.
  10. class PreparedPredicate(GEOSFuncFactory):
  11. argtypes = [PREPGEOM_PTR, GEOM_PTR]
  12. restype = c_byte
  13. errcheck = staticmethod(check_predicate)
  14. prepared_contains = PreparedPredicate('GEOSPreparedContains')
  15. prepared_contains_properly = PreparedPredicate('GEOSPreparedContainsProperly')
  16. prepared_covers = PreparedPredicate('GEOSPreparedCovers')
  17. prepared_crosses = PreparedPredicate('GEOSPreparedCrosses')
  18. prepared_disjoint = PreparedPredicate('GEOSPreparedDisjoint')
  19. prepared_intersects = PreparedPredicate('GEOSPreparedIntersects')
  20. prepared_overlaps = PreparedPredicate('GEOSPreparedOverlaps')
  21. prepared_touches = PreparedPredicate('GEOSPreparedTouches')
  22. prepared_within = PreparedPredicate('GEOSPreparedWithin')