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:
parent
4fb2e271f6
commit
e32c225307
3 changed files with 13 additions and 7 deletions
|
@ -8,6 +8,8 @@ For a complete change history, see the git log.
|
||||||
|
|
||||||
## Future
|
## 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 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`
|
- Added to python bindings: `has_tiff`, `has_png`, `has_webp`, `has_proj4`, `has_svg_renderer`, and `has_grid_renderer`
|
||||||
|
|
|
@ -141,6 +141,7 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, mapnik::feat
|
||||||
{
|
{
|
||||||
std::string const& name=fields_[col].name_;
|
std::string const& name=fields_[col].name_;
|
||||||
|
|
||||||
|
// NOTE: ensure types handled here are matched in shape_datasource.cpp
|
||||||
switch (fields_[col].type_)
|
switch (fields_[col].type_)
|
||||||
{
|
{
|
||||||
case 'C':
|
case 'C':
|
||||||
|
@ -166,8 +167,9 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, mapnik::feat
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'N':
|
case 'N': // numeric
|
||||||
case 'F':
|
case 'O': // double
|
||||||
|
case 'F': // float
|
||||||
{
|
{
|
||||||
|
|
||||||
if (record_[fields_[col].offset_] == '*')
|
if (record_[fields_[col].offset_] == '*')
|
||||||
|
|
|
@ -105,15 +105,13 @@ shape_datasource::shape_datasource(const parameters ¶ms)
|
||||||
switch (fd.type_)
|
switch (fd.type_)
|
||||||
{
|
{
|
||||||
case 'C': // character
|
case 'C': // character
|
||||||
case 'D': // Date
|
case 'D': // date
|
||||||
case 'M': // Memo, a string
|
|
||||||
case '@': // timestamp
|
|
||||||
desc_.add_descriptor(attribute_descriptor(fld_name, String));
|
desc_.add_descriptor(attribute_descriptor(fld_name, String));
|
||||||
break;
|
break;
|
||||||
case 'L': // logical
|
case 'L': // logical
|
||||||
desc_.add_descriptor(attribute_descriptor(fld_name, Boolean));
|
desc_.add_descriptor(attribute_descriptor(fld_name, Boolean));
|
||||||
break;
|
break;
|
||||||
case 'N':
|
case 'N': // numeric
|
||||||
case 'O': // double
|
case 'O': // double
|
||||||
case 'F': // float
|
case 'F': // float
|
||||||
{
|
{
|
||||||
|
@ -131,7 +129,11 @@ shape_datasource::shape_datasource(const parameters ¶ms)
|
||||||
// I - long
|
// I - long
|
||||||
// G - ole
|
// G - ole
|
||||||
// + - autoincrement
|
// + - 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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue