Skip to content

Commit ef6c8be

Browse files
committedApr 29, 2017
Fix import WKT of the format MultiPoint (-20 -90, -20 -88 )
Should technically be MultiPoint ((-20 -90), (-20 -88)), but it's nice to be forgiving and accept as wide a range of WKT formats as possible Fix #16483
1 parent 5fe6587 commit ef6c8be

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
 

‎src/core/geometry/qgsmultipoint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bool QgsMultiPointV2::fromWkt( const QString &wkt )
3434
{
3535
QString collectionWkt( wkt );
3636
//test for non-standard MultiPoint(x1 y1, x2 y2) format
37-
QRegExp regex( "^\\s*MultiPoint\\s*[ZM]*\\s*\\(\\s*\\d" );
37+
QRegExp regex( "^\\s*MultiPoint\\s*[ZM]*\\s*\\(\\s*[-\\d]" );
3838
regex.setCaseSensitivity( Qt::CaseInsensitive );
3939
if ( regex.indexIn( collectionWkt ) >= 0 )
4040
{

‎tests/testdata/geom_data.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ GeometryCollection (PointZ (1 2 3)),GEOMETRYCOLLECTION Z (POINT Z (1 2 3)),1,0,0
7575
"MultiPoint(( 1 2 3 ),(4 5 6))","MultiPointZ(( 1 2 3 ),(4 5 6))",2,0,0,0,2,0,0,POINT(2.5 3.5),1,2,4,5,"z coordinate, but geometry not explicitly marked as such. Should be upgraded to have Z dimension"
7676
"MultiPoint(( 1 2 3 11),(4 5 6 12))","MultiPointZM(( 1 2 3 11),(4 5 6 12))",2,0,0,0,2,0,0,POINT(2.5 3.5),1,2,4,5,"4d coordinates, but geometry not explicitly marked as such. Should be upgraded to have ZM dimension"
7777
"MultiPoint (1 2, 3 4, 5 6)","MULTIPOINT((1 2),(3 4),(5 6))",3,0,0,0,3,0,0,POINT(3 4),1,2,5,6,
78+
"MultiPoint (-20 -90, -20 -88 )","MULTIPOINT((-20 -90),(-20 -88))",2,0,0,0,2,0,0,Point (-20 -89),-20,-90,-20,-88,
7879
MultiPoint (1 2),MULTIPOINT((1 2)),1,0,0,0,1,0,0,POINT(1 2),1,2,1,2,
7980
MultiPoint Z (1 2 3),MULTIPOINT Z ((1 2 3)),1,0,0,0,1,0,0,POINT(1 2),1,2,1,2,
8081
"MultiPointM (1 2 3,4 5 0)","MULTIPOINT M ((1 2 3),(4 5 0))",2,0,0,0,2,0,0,POINT(2.5 3.5),1,2,4,5,

0 commit comments

Comments
 (0)
Please sign in to comment.