diff --git a/include/mapnik/params.hpp b/include/mapnik/params.hpp index 898a550bf..a9a8009f6 100644 --- a/include/mapnik/params.hpp +++ b/include/mapnik/params.hpp @@ -28,7 +28,6 @@ #include #include #include -//#include #include #include diff --git a/plugins/input/postgis/postgis.cpp b/plugins/input/postgis/postgis.cpp index 09a0e6268..647249907 100644 --- a/plugins/input/postgis/postgis.cpp +++ b/plugins/input/postgis/postgis.cpp @@ -29,6 +29,7 @@ // boost #include +#include // stl #include @@ -71,6 +72,40 @@ postgis_datasource::postgis_datasource(parameters const& params) multiple_geometries_ = *params_.get("multiple_geometries",false); + boost::optional ext = params_.get("extent"); + if (ext) + { + boost::char_separator sep(","); + boost::tokenizer > tok(*ext,sep); + unsigned i = 0; + bool success = false; + double d[4]; + for (boost::tokenizer >::iterator beg=tok.begin(); + beg!=tok.end();++beg) + { + try + { + d[i] = boost::lexical_cast(*beg); + } + catch (boost::bad_lexical_cast & ex) + { + std::clog << ex.what() << "\n"; + break; + } + if (i==3) + { + success = true; + break; + } + ++i; + } + if (success) + { + extent_.init(d[0],d[1],d[2],d[3]); + extent_initialized_ = true; + } + } + ConnectionManager *mgr=ConnectionManager::instance(); mgr->registerPool(creator_, *initial_size, *max_size); @@ -123,6 +158,7 @@ postgis_datasource::postgis_datasource(parameters const& params) break; case 700: // float4 case 701: // float8 + case 1700: // numeric ?? desc_.add_descriptor(attribute_descriptor(fld_name,mapnik::Double)); case 1042: // bpchar case 1043: // varchar