MCPcopy
hub / github.com/django/django / as_sqlite

Method as_sqlite

django/contrib/gis/db/models/functions.py:353–360  ·  view source on GitHub ↗
(self, compiler, connection, **extra_context)

Source from the content-addressed store, hash-verified

351 )
352
353 def as_sqlite(self, compiler, connection, **extra_context):
354 if self.geo_field.geodetic(connection):
355 # SpatiaLite returns NULL instead of zero on geodetic coordinates
356 extra_context["template"] = (
357 "COALESCE(%(function)s(%(expressions)s, %(spheroid)s), 0)"
358 )
359 extra_context["spheroid"] = int(bool(self.spheroid))
360 return super().as_sql(compiler, connection, **extra_context)
361
362
363class Envelope(GeomOutputGeoFunc):

Callers

nothing calls this directly

Calls 2

geodeticMethod · 0.80
as_sqlMethod · 0.45

Tested by

no test coverage detected