fixed pointz/pointm reading

This commit is contained in:
Artem Pavlenko 2006-03-28 10:09:24 +00:00
parent 8986108775
commit 0e53e23ec1
3 changed files with 5 additions and 7 deletions

View file

@ -93,7 +93,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().read_double();// m
geometry_ptr point(new point_impl(-1));
point->move_to(x,y);
feature->set_geometry(point);
@ -157,7 +157,6 @@ feature_ptr shape_index_featureset<filterT>::next()
}
if (attr_ids_.size())
{
//feature->reserve_props(attr_ids_.size());
shape_.dbf().move_to(shape_.id_);
std::vector<int>::const_iterator pos=attr_ids_.begin();
while (pos!=attr_ids_.end())

View file

@ -52,7 +52,7 @@ void shape_io::move_to (int pos)
reclength_ = shp_.read_xdr_integer();
type_ = shp_.read_ndr_integer();
if (type_ != shape_point)
if (type_ != shape_point && type_ != shape_pointm && type_ != shape_pointz)
{
shp_.read_envelope(cur_extent_);
}

View file

@ -139,14 +139,15 @@ int main (int argc,char** argv)
int offset=shp.pos();
int record_number=shp.read_xdr_integer();
int content_length=shp.read_xdr_integer();
shp.skip(4);
std::cout << "offset= "<< offset << std::endl;
Envelope<double> item_ext;
if (shape_type==shape_io::shape_point)
{
double x=shp.read_double();
double y=shp.read_double();
shp.skip(2*content_length-2*8-4);
item_ext=Envelope<double>(x,y,x,y);
}
@ -155,7 +156,6 @@ int main (int argc,char** argv)
double x=shp.read_double();
double y=shp.read_double();
shp.read_double();
shp.skip(2*content_length-3*8-4);
item_ext=Envelope<double>(x,y,x,y);
}
@ -165,7 +165,6 @@ int main (int argc,char** argv)
double y=shp.read_double();
shp.read_double();
shp.read_double();
shp.skip(2*content_length-4*8-4);
item_ext=Envelope<double>(x,y,x,y);
}