Ticket #1323 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

XYZM data cannot be read from wkb

Reported by: ari.jolma@tkk.fi Assigned to: mloskot
Priority: highest Milestone:
Component: OGR_SF Version: unspecified
Severity: blocker Keywords:
Cc: ari.jolma@tkk.fi

Description (Last modified by mloskot)

importWkb methods corrupt XYZM data when importing it since the dimension is incorrectly set to 2.5D. The dimension could be checked in the methods by statement

int dimension = (nSize - 5) / (nNewNumPoints*8);

The vertex data can be correctly imported then in XYZM case using

for( i = 0; i < nPointCount; i++ ) {
      memcpy( paoPoints + i, pabyData + 9 + i*32, 16 );
      memcpy( padfZ + i, pabyData + 9 + 16 + i*32, 8 );
    }

which should be executed if dimension == 4

This is related to #1036 and should be fixed when it is fixed. The M data is discarded in both fixes, but support for it should be added to OGR. I'd be in fact interested in doing that.

Attachments

ogr-ewkb-test.zip (2.0 kB) - added by mloskot on 03/21/07 04:03:07.
EWKB geometries test

Change History

10/12/06 12:43:13 changed by warmerdam

Mateusz, 

Like Bug 1036 there is no big hurry, but we will hopefully address it before 
the next release.

03/21/07 04:03:07 changed by mloskot

  • attachment ogr-ewkb-test.zip added.

EWKB geometries test

03/21/07 14:49:15 changed by warmerdam

I concur.  modify the postgis driver to reliably report an error for geometries
with "M" and don't make any changes to ogr core wkb processing.

At some point there will be an OGC specification for WKB with M and we will 
aim to support that in the core. 

03/22/07 04:04:49 changed by mloskot

Applied fix to the PG driver that detects 4-dimensional variant of EWKB geometry. If XYZM geometry is detected, an error message is reported and NULL geometry is assigned to a feature.

Detailed changeset:
http://trac.osgeo.org/gdal/changeset/11041

This situation occurs if a user reads features from a custom query like

OGRPGDataSource::ExecuteSQL("SELECT wkb_geometry FROM mytable", NULL, NULL);


The problem does not occur if a layer is accessed using
OGRPGDataSource::GetLayerByname()

Then, geometry is read in EWKT form and parsed correctly without any errors
but M coordinate is omitted.

04/08/07 10:02:36 changed by mloskot

  • description changed.

04/08/07 10:59:26 changed by mloskot

I ported these fixes to the stable branch 1.4 (r11226).