fix handling of F and O type dbf fields and sync handling for attribute_descriptors - refs #1614 and closes #1976

This commit is contained in:
Dane Springmeyer 2013-08-07 18:58:01 -04:00
parent 4fb2e271f6
commit e32c225307
3 changed files with 13 additions and 7 deletions

View file

@ -8,6 +8,8 @@ For a complete change history, see the git log.
## Future
- Fixed regression in handling `F` type dbf fields, introduced in v2.2.0.
- Added the ability to create a mapnik Feature from a geojson feature with `mapnik.Feature.from_geojson` in python.
- Added to python bindings: `has_tiff`, `has_png`, `has_webp`, `has_proj4`, `has_svg_renderer`, and `has_grid_renderer`

View file

@ -141,6 +141,7 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, mapnik::feat
{
std::string const& name=fields_[col].name_;
// NOTE: ensure types handled here are matched in shape_datasource.cpp
switch (fields_[col].type_)
{
case 'C':
@ -166,8 +167,9 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, mapnik::feat
}
break;
}
case 'N':
case 'F':
case 'N': // numeric
case 'O': // double
case 'F': // float
{
if (record_[fields_[col].offset_] == '*')

View file

@ -105,15 +105,13 @@ shape_datasource::shape_datasource(const parameters &params)
switch (fd.type_)
{
case 'C': // character
case 'D': // Date
case 'M': // Memo, a string
case '@': // timestamp
case 'D': // date
desc_.add_descriptor(attribute_descriptor(fld_name, String));
break;
case 'L': // logical
desc_.add_descriptor(attribute_descriptor(fld_name, Boolean));
break;
case 'N':
case 'N': // numeric
case 'O': // double
case 'F': // float
{
@ -131,7 +129,11 @@ shape_datasource::shape_datasource(const parameters &params)
// I - long
// G - ole
// + - autoincrement
MAPNIK_LOG_WARN(shape) << "shape_datasource: Unknown type=" << fd.type_;
// @ - timestamp
// B - binary
// l - long
// M - memo
MAPNIK_LOG_ERROR(shape) << "shape_datasource: Unknown type=" << fd.type_;
break;
}
}