Skip to content

Commit

Permalink
plugins do not need to store nulls / save space - refs #1644
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer committed Apr 11, 2013
1 parent 6691267 commit 9da1f35
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 3 additions & 5 deletions plugins/input/postgis/postgis_featureset.cpp
Expand Up @@ -123,11 +123,9 @@ feature_ptr postgis_featureset::next()
{
std::string name = rs_->getFieldName(pos);

if (rs_->isNull(pos))
{
feature->put(name, mapnik::value_null());
}
else
// NOTE: we intentionally do not store null here
// since it is equivalent to the attribute not existing
if (!rs_->isNull(pos))
{
const char* buf = rs_->getValue(pos);
const int oid = rs_->getTypeOID(pos);
Expand Down
3 changes: 2 additions & 1 deletion plugins/input/shape/dbfile.cpp
Expand Up @@ -162,7 +162,8 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, mapnik::feat
{
if (record_[fields_[col].offset_] == '*')
{
f.put(name,mapnik::value_null());
// NOTE: we intentionally do not store null here
// since it is equivalent to the attribute not existing
break;
}
if ( fields_[col].dec_>0 )
Expand Down
3 changes: 2 additions & 1 deletion plugins/input/sqlite/sqlite_featureset.cpp
Expand Up @@ -123,7 +123,8 @@ feature_ptr sqlite_featureset::next()

case SQLITE_NULL:
{
feature->put(fld_name_str, mapnik::value_null());
// NOTE: we intentionally do not store null here
// since it is equivalent to the attribute not existing
break;
}

Expand Down

0 comments on commit 9da1f35

Please sign in to comment.