+ implement missing support for :

multipoint
  multipointm
  multipointz
This commit is contained in:
Artem Pavlenko 2010-01-13 17:18:01 +00:00
parent 8a5e1ea736
commit 8d7ad5b190
2 changed files with 222 additions and 191 deletions

View file

@ -117,7 +117,23 @@ feature_ptr shape_featureset<filterT>::next()
switch (type)
{
case shape_io::shape_multipoint:
case shape_io::shape_multipointm:
case shape_io::shape_multipointz:
{
int num_points = shape_.shp().read_ndr_integer();
for (int i=0; i< num_points;++i)
{
double x=shape_.shp().read_double();
double y=shape_.shp().read_double();
geometry2d * point = new point_impl;
point->move_to(x,y);
feature->add_geometry(point);
}
// ignore m and z for now
++count_;
break;
}
case shape_io::shape_polyline:
{
geometry2d * line = shape_.read_polyline();

View file

@ -87,8 +87,7 @@ feature_ptr shape_index_featureset<filterT>::next()
int type=shape_.type();
feature_ptr feature(feature_factory::create(shape_.id_));
if (type==shape_io::shape_point)
if (type == shape_io::shape_point)
{
double x=shape_.shp().read_double();
double y=shape_.shp().read_double();
@ -97,11 +96,12 @@ feature_ptr shape_index_featureset<filterT>::next()
feature->add_geometry(point);
++count_;
}
else if (type == shape_io::shape_pointm)
{
double x=shape_.shp().read_double();
double y=shape_.shp().read_double();
shape_.shp().read_double();// m
shape_.shp().skip(8);// skip m
geometry2d * point = new point_impl;
point->move_to(x,y);
feature->add_geometry(point);
@ -111,8 +111,7 @@ feature_ptr shape_index_featureset<filterT>::next()
{
double x=shape_.shp().read_double();
double y=shape_.shp().read_double();
shape_.shp().read_double();// z
shape_.shp().read_double();// m
shape_.shp().skip(8*2); // skip m,z
geometry2d * point = new point_impl;
point->move_to(x,y);
feature->add_geometry(point);
@ -129,6 +128,23 @@ feature_ptr shape_index_featureset<filterT>::next()
switch (type)
{
case shape_io::shape_multipoint:
case shape_io::shape_multipointm:
case shape_io::shape_multipointz:
{
int num_points = shape_.shp().read_ndr_integer();
for (int i=0; i< num_points;++i)
{
double x=shape_.shp().read_double();
double y=shape_.shp().read_double();
geometry2d * point = new point_impl;
point->move_to(x,y);
feature->add_geometry(point);
}
// ignore m and z for now
++count_;
break;
}
case shape_io::shape_polyline:
{
geometry2d * line = shape_.read_polyline();
@ -152,7 +168,6 @@ feature_ptr shape_index_featureset<filterT>::next()
}
case shape_io::shape_polygon:
{
geometry2d * poly = shape_.read_polygon();
feature->add_geometry(poly);
++count_;