1.added missing float4 (pg_type OID 700)
2.removed printing "..unknown type_oid .."
This commit is contained in:
parent
4d4e9f5d91
commit
7534217a8f
2 changed files with 12 additions and 8 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -207,7 +206,10 @@ featureset_ptr postgis_datasource::features(const query& q) const
|
||||||
s << std::setprecision(16);
|
s << std::setprecision(16);
|
||||||
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()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ feature_ptr postgis_featureset::next()
|
||||||
std::string name = rs_->getFieldName(pos);
|
std::string name = rs_->getFieldName(pos);
|
||||||
const char* buf=rs_->getValue(pos);
|
const char* buf=rs_->getValue(pos);
|
||||||
int oid = rs_->getTypeOID(pos);
|
int oid = rs_->getTypeOID(pos);
|
||||||
|
|
||||||
if (oid==23) //int4
|
if (oid==23) //int4
|
||||||
{
|
{
|
||||||
int val = int4net(buf);
|
int val = int4net(buf);
|
||||||
|
@ -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_;
|
||||||
|
|
Loading…
Reference in a new issue