Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #19063 -- Fixed version parameter of gml GeoQuerySet method

Thanks lmisek@go2.pl for the report.
  • Loading branch information...
commit d25a599dca9b7644b238f6c89a66545dfdabe393 1 parent c76877c
@claudep claudep authored
View
4 django/contrib/gis/db/models/query.py
@@ -194,9 +194,9 @@ def gml(self, precision=8, version=2, **kwargs):
# PostGIS AsGML() aggregate function parameter order depends on the
# version -- uggh.
if backend.spatial_version > (1, 3, 1):
- procedure_fmt = '%(version)s,%(geo_col)s,%(precision)s'
+ s['procedure_fmt'] = '%(version)s,%(geo_col)s,%(precision)s'
else:
- procedure_fmt = '%(geo_col)s,%(precision)s,%(version)s'
+ s['procedure_fmt'] = '%(geo_col)s,%(precision)s,%(version)s'
s['procedure_args'] = {'precision' : precision, 'version' : version}
return self._spatial_attribute('gml', s, **kwargs)
View
3  django/contrib/gis/tests/geoapp/tests.py
@@ -529,6 +529,9 @@ def test_gml(self):
for ptown in [ptown1, ptown2]:
self.assertTrue(gml_regex.match(ptown.gml))
+ if postgis:
+ self.assertIn('<gml:pos srsDimension="2">', City.objects.gml(version=3).get(name='Pueblo').gml)
+
def test_kml(self):
"Testing KML output from the database using GeoQuerySet.kml()."
# Only PostGIS and Spatialite (>=2.4.0-RC4) support KML serialization

0 comments on commit d25a599

Please sign in to comment.
Something went wrong with that request. Please try again.