1.added missing float4 (pg_type OID 700)

2.removed printing "..unknown type_oid .."
This commit is contained in:
Artem Pavlenko 2006-12-01 09:42:04 +00:00
parent 4d4e9f5d91
commit 7534217a8f
2 changed files with 12 additions and 8 deletions

View file

@ -125,14 +125,12 @@ postgis_datasource::postgis_datasource(parameters const& params)
int type_oid = rs->getTypeOID(i);
switch (type_oid)
{
case 17285: // geometry
desc_.add_descriptor(attribute_descriptor(fld_name,mapnik::Geometry));
break;
case 21: // int2
case 23: // int4
desc_.add_descriptor(attribute_descriptor(fld_name,mapnik::Integer,false,length));
break;
case 701: // float8
case 700: // float4
case 701: // float8
desc_.add_descriptor(attribute_descriptor(fld_name,mapnik::Double,false,length));
case 1042: // bpchar
case 1043: // varchar
@ -140,8 +138,9 @@ postgis_datasource::postgis_datasource(parameters const& params)
desc_.add_descriptor(attribute_descriptor(fld_name,mapnik::String));
break;
default: // shouldn't get here
#ifdef MAPNIK_DEBUG
clog << "unknown type_oid="<<type_oid<<endl;
desc_.add_descriptor(attribute_descriptor(fld_name,mapnik::String));
#endif
break;
}
}
@ -207,7 +206,10 @@ featureset_ptr postgis_datasource::features(const query& q) const
s << std::setprecision(16);
s << box.minx() << " " << box.miny() << ",";
s << box.maxx() << " " << box.maxy() << ")'::box3d,"<<srid_<<")";
#ifdef MAPNIK_DEBUG
std::clog << s.str() << "\n";
#endif
shared_ptr<ResultSet> rs=conn->executeQuery(s.str(),1);
return featureset_ptr(new postgis_featureset(rs,props.size()));
}

View file

@ -56,7 +56,7 @@ feature_ptr postgis_featureset::next()
std::string name = rs_->getFieldName(pos);
const char* buf=rs_->getValue(pos);
int oid = rs_->getTypeOID(pos);
if (oid==23) //int4
{
int val = int4net(buf);
@ -85,8 +85,10 @@ feature_ptr postgis_featureset::next()
}
else
{
#ifdef MAPNIK_DEBUG
std::clog << "uknown OID = " << oid << " FIXME \n";
boost::put(*feature,name,0);
#endif
//boost::put(*feature,name,0);
}
}
++count_;