03.02.2016, 16:11, Even Rouault kirjoitti:
Le mercredi 03 février 2016 14:36:14, Ari Jolma a écrit :
I finally have the (existing) autotests passing with the new API -
basically just replacing the nCoordDimension property of OGRGeometry
with flags (for Z and M) - and a rather large set of tests for
import/export WKT and WKB with M passing.
That's great !
Yes, except that I just found out that despite of the already large set
of test WKT strings, a simple one like
GEOMETRYCOLLECTION M (POINT (1 2 3))
produces, when read in and printed out as ISO WKT
GEOMETRYCOLLECTION Z (POINT (1 2 3))
The problem is that neither OGR_G_CreateFromWkt() nor
OGRGeometryFactory::createFromWkt does not have OGRwkbVariant
eWkbVariant parameter (as OGRGeometryFactory::createFromWkb but not
OGR_G_CreateFromWkb), which would at least make the case more clear in
the code.
Reading OGC common architecture (1.2.1) it seems to me that the WKT is
in fact invalid and it should be
GEOMETRYCOLLECTION M (POINT M (1 2 3))
Also PostGIS returns the error " can not mix dimensionality" with the
above one.
However, interestingly, PostGIS accepts
MULTICURVE M (CIRCULARSTRING (0 0 2,1 0 2,0 0 2),(0 0 2,1 1 2))
and
MULTICURVE M (CIRCULARSTRING Z (0 0 2,1 0 2,0 0 2),(0 0 2,1 1 2))
although, in the latter one PostGIS converts the Z into M.
I think the path I'll take will be to rather easily spit out "corrupt
data" (or a new "mixed geometries" error) for cases which involve M.
Ari
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev