Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1e1d4e4

Browse files
strknyalldawson
authored andcommittedMar 5, 2023
Add test for unknown-crs ReferencedGeometry input/output
1 parent e497678 commit 1e1d4e4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎tests/src/providers/testqgspostgresprovider.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,15 @@ void TestQgsPostgresProvider::testEwktInOut()
478478
QCOMPARE( g.crs().authid(), "EPSG:4326" );
479479
ewkt_obtained = QgsPostgresProvider::toEwkt( g, conn );
480480
QCOMPARE( ewkt_obtained, "SRID=4326;LineString (0 0, -5 2)" );
481+
482+
// Test for srid-less geometry
483+
// See https://github.com/qgis/QGIS/issues/49380#issuecomment-1282913470
484+
g = QgsPostgresProvider::fromEwkt( "POINT(0 0)", conn );
485+
QVERIFY( ! g.isNull() );
486+
ewkt_obtained = QgsPostgresProvider::toEwkt( g, conn );
487+
QVERIFY( ! g.crs().isValid() ); // is unknown
488+
QCOMPARE( ewkt_obtained, QString( "SRID=0;Point (0 0)" ) );
489+
481490
}
482491
#endif // ENABLE_PGTEST
483492

0 commit comments

Comments
 (0)
Please sign in to comment.