-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change default WKT output to honor a space between geometry type and Z, M or ZM #58010
Conversation
@mhugent do you have any insights as to why the current form was originally chosen? |
@jgrocha this is a very good idea! I made several tests, not yet released, some months ago. QGIS WKT is not readable by some other software. So +1. Let me just a couple of times to retrieve/finish my comparison/test and to review your PR. Thanks! |
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist. |
@jgrocha There are some remaining tests to adapt. Cf CI failures |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
Done at 23rd Contributors Meeting in Bucharest :-) |
@jgrocha Is there a parallel one to the one in Bratislava? |
My bad! Tests were failing on CI because of #58616 that was merged after my |
Can you take a look at this @lbartoletti ? |
yes! Sorry, was busy. I'll take a look, for sure, on monday. |
Thank you for the feedback @lbartoletti ORACLE tests are not running on our CI. Maybe @troopa81 can help with the CI. Meanwhile, I'll try to enable them on my side and do the tests locally. |
Well, everything seems to work fine now 👍 |
Previous discussion
The discussion started on the developers mailing list.
https://lists.osgeo.org/pipermail/qgis-developer/2024-July/066901.html
Description
This PR changes the default WKT output to honor a space between the geometry type and the modifier Z, M, or ZM (when applied).
Example:
'PointZ (0 0 0)'
will be written as'Point Z (0 0 0)'
.Nothing was changed related to WKT parsing. Parsing is already quite flexible.
Different notations are allowed:
Output based on this PR:
Output based on current master:
Interoperability ensured by a new GDAL PR
The tools tested and discussed on the mailing list, namely, GDAL, GEOS, and QGIS support both forms for reading.
The new OSGeo/gdal#10370 enhances GDAL parsing to support also reading
PointZ
andPoint Z
.With such enhancement, all three tools can interoperate based on WKT representations.
Proposal
Since the interoperability is already ensured, we can decide the best way to write WKT representations.
The WKT specification is defined in the OGC document https://portal.ogc.org/files/?artifact_id=25355
According to the BNF Productions for Three-Dimension Geometry WKT (pages 55, 56), the WKT should be written as
point z <point z text>
,linestring z <linestring z text>
, etc.Tests
Many tests use the WKT notation to compare generated and expected geometries. All tests were improved to support the new WKT writing.
OS tools side by side
Point Z (1 2 3)
POINT Z (1 2 3)
POINT Z (1 2 3)
POINT Z (1 2 3)
POINT Z(1 2 3)
POINT Z (1 2 3)
QGIS
GDAL
Shapely
PostGIS
OpenLayers
GEOS