Fix a really dumb formatting issue for the geom_interface

Use the old formatting tag instead of the new when creating geom text
from the geo_interface. Tests updated as well
This commit is contained in:
Henry Walshaw 2019-07-08 15:16:20 +10:00
parent 8cd50bf768
commit b02278e536
2 changed files with 7 additions and 7 deletions

View file

@ -294,7 +294,7 @@ class GeoEntryExtension(BaseEntryExtension):
if geojson['type'] == 'Point':
coords = '%f %f'.format(
coords = '{:f} {:f}'.format(
geojson['coordinates'][1], # latitude is y
geojson['coordinates'][0]
)
@ -303,7 +303,7 @@ class GeoEntryExtension(BaseEntryExtension):
elif geojson['type'] == 'LineString':
coords = ' '.join(
'%f %f'.format(vertex[1], vertex[0])
'{:f} {:f}'.format(vertex[1], vertex[0])
for vertex in
geojson['coordinates']
)
@ -315,7 +315,7 @@ class GeoEntryExtension(BaseEntryExtension):
warnings.warn(GeoRSSPolygonInteriorWarning(geom))
coords = ' '.join(
'%f %f'.format(vertex[1], vertex[0])
'{:f} {:f}'.format(vertex[1], vertex[0])
for vertex in
geojson['coordinates'][0]
)

View file

@ -26,7 +26,7 @@ class Geom(object):
def __str__(self):
if self.geom_type == 'Point':
coords = '%f %f'.format(
coords = '{:f} {:f}'.format(
self.coords[1], # latitude is y
self.coords[0]
)
@ -35,7 +35,7 @@ class Geom(object):
elif self.geom_type == 'LineString':
coords = ' '.join(
'%f %f'.format(vertex[1], vertex[0])
'{:f} {:f}'.format(vertex[1], vertex[0])
for vertex in
self.coords
)
@ -44,7 +44,7 @@ class Geom(object):
elif self.geom_type == 'Polygon':
coords = ' '.join(
'%f %f'.format(vertex[1], vertex[0])
'{:f} {:f}'.format(vertex[1], vertex[0])
for vertex in
self.coords[0]
)
@ -54,7 +54,7 @@ class Geom(object):
# box not really supported by GeoJSON, but it's a handy cheat here
# for testing
coords = ' '.join(
'%f %f'.format(vertex[1], vertex[0])
'{:f} {:f}'.format(vertex[1], vertex[0])
for vertex in
self.coords
)