MCPcopy
hub / github.com/django/django / AsGML

Class AsGML

django/contrib/gis/db/models/functions.py:212–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210
211
212class AsGML(GeoFunc):
213 geom_param_pos = (1,)
214 output_field = TextField()
215
216 def __init__(self, expression, version=2, precision=8, **extra):
217 expressions = [version, expression]
218 if precision is not None:
219 expressions.append(self._handle_param(precision, "precision", int))
220 super().__init__(*expressions, **extra)
221
222 def as_oracle(self, compiler, connection, **extra_context):
223 source_expressions = self.get_source_expressions()
224 version = source_expressions[0]
225 clone = self.copy()
226 clone.set_source_expressions([source_expressions[1]])
227 extra_context["function"] = (
228 "SDO_UTIL.TO_GML311GEOMETRY"
229 if version.value == 3
230 else "SDO_UTIL.TO_GMLGEOMETRY"
231 )
232 return super(AsGML, clone).as_sql(compiler, connection, **extra_context)
233
234
235class AsKML(GeoFunc):

Callers

nothing calls this directly

Calls 1

TextFieldClass · 0.90

Tested by

no test coverage detected