From 8ac189ccf29662e2d6d41bc537dcc5cbf14546d1 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Jan 2010 01:59:50 +0000 Subject: [PATCH] fix broken support for pointz as code assumed pointzm - closes #504 --- plugins/input/shape/shape_featureset.cpp | 9 ++++++++- plugins/input/shape/shape_index_featureset.cpp | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/plugins/input/shape/shape_featureset.cpp b/plugins/input/shape/shape_featureset.cpp index 613228837..199e67196 100644 --- a/plugins/input/shape/shape_featureset.cpp +++ b/plugins/input/shape/shape_featureset.cpp @@ -90,7 +90,14 @@ feature_ptr shape_featureset::next() { double x=shape_.shp().read_double(); double y=shape_.shp().read_double(); - shape_.shp().skip(8*2); // m, z + // skip z + shape_.shp().skip(8); + + //skip m if exists + if ( shape_.reclength_ == 8 + 36) + { + shape_.shp().skip(8); + } geometry2d * point=new point_impl; point->move_to(x,y); feature->add_geometry(point); diff --git a/plugins/input/shape/shape_index_featureset.cpp b/plugins/input/shape/shape_index_featureset.cpp index 36bd5e26a..d4f64f162 100644 --- a/plugins/input/shape/shape_index_featureset.cpp +++ b/plugins/input/shape/shape_index_featureset.cpp @@ -111,7 +111,14 @@ feature_ptr shape_index_featureset::next() { double x=shape_.shp().read_double(); double y=shape_.shp().read_double(); - shape_.shp().skip(8*2); // skip m,z + // skip z + shape_.shp().skip(8); + + //skip m if exists + if ( shape_.reclength_ == 8 + 36) + { + shape_.shp().skip(8); + } geometry2d * point = new point_impl; point->move_to(x,y); feature->add_geometry(point);