mirror of https://github.com/django/django.git
Fixed #28392 -- Fixed GIS's WKT regex to match large scientific notation numbers.
Thanks Greg Larmore for report and initial patch.
This commit is contained in:
parent
4844af90fb
commit
a0b4ecce57
|
@ -8,6 +8,6 @@ wkt_regex = re.compile(r'^(SRID=(?P<srid>\-?\d+);)?'
|
|||
r'(?P<wkt>'
|
||||
r'(?P<type>POINT|LINESTRING|LINEARRING|POLYGON|MULTIPOINT|'
|
||||
r'MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)'
|
||||
r'[ACEGIMLONPSRUTYZ\d,\.\-\(\) ]+)$',
|
||||
r'[ACEGIMLONPSRUTYZ\d,\.\-\+\(\) ]+)$',
|
||||
re.I)
|
||||
json_regex = re.compile(r'^(\s+)?\{.*}(\s+)?$', re.DOTALL)
|
||||
|
|
|
@ -1337,6 +1337,9 @@ class GEOSTest(SimpleTestCase, TestDataMixin):
|
|||
with self.assertRaisesMessage(ValueError, msg):
|
||||
GEOSGeometry.from_ewkt('SRID=WGS84;POINT(1 1)')
|
||||
|
||||
def test_fromstr_scientific_wkt(self):
|
||||
self.assertEqual(GEOSGeometry('POINT(1.0e-1 1.0e+1)'), Point(.1, 10))
|
||||
|
||||
def test_normalize(self):
|
||||
g = MultiPoint(Point(0, 0), Point(2, 2), Point(1, 1))
|
||||
self.assertIsNone(g.normalize())
|
||||
|
|
Loading…
Reference in New Issue