Skip to content
Permalink
Browse files

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

(cherry-picked from ef6c8b)
  • Loading branch information
nyalldawson committed May 9, 2017
1 parent 439b21e commit fad23dda22278ca843ec7e47f95e7c1f0de36fa6
Showing with 2 additions and 1 deletion.
  1. +1 −1 src/core/geometry/qgsmultipointv2.cpp
  2. +1 −0 tests/testdata/geom_data.csv
@@ -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 )
{
@@ -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,

0 comments on commit fad23dd

Please sign in to comment.
You can’t perform that action at this time.