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
This commit is contained in:
Nyall Dawson 2017-04-30 08:22:25 +10:00
parent 5fe6587e0b
commit ef6c8be16f
2 changed files with 2 additions and 1 deletions

View File

@ -34,7 +34,7 @@ bool QgsMultiPointV2::fromWkt( const QString &wkt )
{
QString collectionWkt( wkt );
//test for non-standard MultiPoint(x1 y1, x2 y2) format
QRegExp regex( "^\\s*MultiPoint\\s*[ZM]*\\s*\\(\\s*\\d" );
QRegExp regex( "^\\s*MultiPoint\\s*[ZM]*\\s*\\(\\s*[-\\d]" );
regex.setCaseSensitivity( Qt::CaseInsensitive );
if ( regex.indexIn( collectionWkt ) >= 0 )
{

View File

@ -75,6 +75,7 @@ GeometryCollection (PointZ (1 2 3)),GEOMETRYCOLLECTION Z (POINT Z (1 2 3)),1,0,0
"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"
"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"
"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,
"MultiPoint (-20 -90, -20 -88 )","MULTIPOINT((-20 -90),(-20 -88))",2,0,0,0,2,0,0,Point (-20 -89),-20,-90,-20,-88,
MultiPoint (1 2),MULTIPOINT((1 2)),1,0,0,0,1,0,0,POINT(1 2),1,2,1,2,
MultiPoint Z (1 2 3),MULTIPOINT Z ((1 2 3)),1,0,0,0,1,0,0,POINT(1 2),1,2,1,2,
"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,

1 wkt valid_wkt num_points length area perimeter num_geometries num_rings is_closed centroid x_min y_min x_max y_max notes
75 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
76 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
77 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
79 MultiPoint (1 2) MULTIPOINT((1 2)) 1 0 0 0 1 0 0 POINT(1 2) 1 2 1 2
80 MultiPoint Z (1 2 3) MULTIPOINT Z ((1 2 3)) 1 0 0 0 1 0 0 POINT(1 2) 1 2 1 2
81 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