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

View file

@ -85,8 +85,10 @@ feature_ptr postgis_featureset::next()
} }
else else
{ {
#ifdef MAPNIK_DEBUG
std::clog << "uknown OID = " << oid << " FIXME \n"; std::clog << "uknown OID = " << oid << " FIXME \n";
boost::put(*feature,name,0); #endif
//boost::put(*feature,name,0);
} }
} }
++count_; ++count_;