fixup includes and value type and params usage across plugins
This commit is contained in:
parent
39f0d52090
commit
4bd5484cdb
51 changed files with 218 additions and 64 deletions
|
@ -41,6 +41,7 @@
|
||||||
#include <mapnik/util/conversions.hpp>
|
#include <mapnik/util/conversions.hpp>
|
||||||
#include <mapnik/boolean.hpp>
|
#include <mapnik/boolean.hpp>
|
||||||
#include <mapnik/util/trim.hpp>
|
#include <mapnik/util/trim.hpp>
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -62,7 +63,7 @@ csv_datasource::csv_datasource(parameters const& params)
|
||||||
filename_(),
|
filename_(),
|
||||||
inline_string_(),
|
inline_string_(),
|
||||||
file_length_(0),
|
file_length_(0),
|
||||||
row_limit_(*params.get<int>("row_limit", 0)),
|
row_limit_(*params.get<mapnik::value_integer>("row_limit", 0)),
|
||||||
features_(),
|
features_(),
|
||||||
escape_(*params.get<std::string>("escape", "")),
|
escape_(*params.get<std::string>("escape", "")),
|
||||||
separator_(*params.get<std::string>("separator", "")),
|
separator_(*params.get<std::string>("separator", "")),
|
||||||
|
@ -70,7 +71,7 @@ csv_datasource::csv_datasource(parameters const& params)
|
||||||
headers_(),
|
headers_(),
|
||||||
manual_headers_(mapnik::util::trim_copy(*params.get<std::string>("headers", ""))),
|
manual_headers_(mapnik::util::trim_copy(*params.get<std::string>("headers", ""))),
|
||||||
strict_(*params.get<mapnik::boolean>("strict", false)),
|
strict_(*params.get<mapnik::boolean>("strict", false)),
|
||||||
filesize_max_(*params.get<float>("filesize_max", 20.0)), // MB
|
filesize_max_(*params.get<double>("filesize_max", 20.0)), // MB
|
||||||
ctx_(boost::make_shared<mapnik::context_type>())
|
ctx_(boost::make_shared<mapnik::context_type>())
|
||||||
{
|
{
|
||||||
/* TODO:
|
/* TODO:
|
||||||
|
@ -701,7 +702,7 @@ void csv_datasource::parse_csv(T & stream,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mapnik::value_integer int_val = 0;
|
mapnik::value_integer int_val = 0;
|
||||||
if (mapnik::util::string2longlong(value,int_val))
|
if (mapnik::util::string2int(value,int_val))
|
||||||
{
|
{
|
||||||
matched = true;
|
matched = true;
|
||||||
feature->put(fld_name,int_val);
|
feature->put(fld_name,int_val);
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/coord.hpp>
|
#include <mapnik/coord.hpp>
|
||||||
#include <mapnik/feature_layer_desc.hpp>
|
#include <mapnik/feature_layer_desc.hpp>
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
@ -64,7 +65,7 @@ private:
|
||||||
std::string filename_;
|
std::string filename_;
|
||||||
std::string inline_string_;
|
std::string inline_string_;
|
||||||
unsigned file_length_;
|
unsigned file_length_;
|
||||||
int row_limit_;
|
mapnik::value_integer row_limit_;
|
||||||
std::vector<mapnik::feature_ptr> features_;
|
std::vector<mapnik::feature_ptr> features_;
|
||||||
std::string escape_;
|
std::string escape_;
|
||||||
std::string separator_;
|
std::string separator_;
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <mapnik/boolean.hpp>
|
#include <mapnik/boolean.hpp>
|
||||||
#include <mapnik/geom_util.hpp>
|
#include <mapnik/geom_util.hpp>
|
||||||
#include <mapnik/timer.hpp>
|
#include <mapnik/timer.hpp>
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
|
|
||||||
#include <gdal_version.h>
|
#include <gdal_version.h>
|
||||||
|
|
||||||
|
|
|
@ -23,11 +23,15 @@
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
|
#include <mapnik/image_data.hpp>
|
||||||
|
#include <mapnik/raster.hpp>
|
||||||
#include <mapnik/ctrans.hpp>
|
#include <mapnik/ctrans.hpp>
|
||||||
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/feature_factory.hpp>
|
#include <mapnik/feature_factory.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/format.hpp>
|
#include <boost/format.hpp>
|
||||||
|
#include <boost/make_shared.hpp>
|
||||||
|
|
||||||
#include "gdal_featureset.hpp"
|
#include "gdal_featureset.hpp"
|
||||||
#include <gdal_priv.h>
|
#include <gdal_priv.h>
|
||||||
|
@ -35,7 +39,6 @@
|
||||||
using mapnik::query;
|
using mapnik::query;
|
||||||
using mapnik::coord2d;
|
using mapnik::coord2d;
|
||||||
using mapnik::box2d;
|
using mapnik::box2d;
|
||||||
using mapnik::Feature;
|
|
||||||
using mapnik::feature_ptr;
|
using mapnik::feature_ptr;
|
||||||
using mapnik::CoordTransform;
|
using mapnik::CoordTransform;
|
||||||
using mapnik::geometry_type;
|
using mapnik::geometry_type;
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/datasource.hpp>
|
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/variant.hpp>
|
#include <boost/variant.hpp>
|
||||||
|
|
|
@ -36,7 +36,11 @@
|
||||||
#include <boost/geometry/geometries/geometries.hpp>
|
#include <boost/geometry/geometries/geometries.hpp>
|
||||||
#include <boost/geometry.hpp>
|
#include <boost/geometry.hpp>
|
||||||
#include <boost/geometry/extensions/index/rtree/rtree.hpp>
|
#include <boost/geometry/extensions/index/rtree/rtree.hpp>
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
|
#include <mapnik/unicode.hpp>
|
||||||
|
#include <mapnik/feature.hpp>
|
||||||
|
#include <mapnik/feature_kv_iterator.hpp>
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
#include <mapnik/proj_transform.hpp>
|
#include <mapnik/proj_transform.hpp>
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/coord.hpp>
|
#include <mapnik/coord.hpp>
|
||||||
#include <mapnik/feature_layer_desc.hpp>
|
#include <mapnik/feature_layer_desc.hpp>
|
||||||
|
#include <mapnik/unicode.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef GEOJSON_FEATURESET_HPP
|
#ifndef GEOJSON_FEATURESET_HPP
|
||||||
#define GEOJSON_FEATURESET_HPP
|
#define GEOJSON_FEATURESET_HPP
|
||||||
|
|
||||||
#include <mapnik/datasource.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
#include "geojson_datasource.hpp"
|
#include "geojson_datasource.hpp"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include <mapnik/boolean.hpp>
|
#include <mapnik/boolean.hpp>
|
||||||
#include <mapnik/geom_util.hpp>
|
#include <mapnik/geom_util.hpp>
|
||||||
#include <mapnik/timer.hpp>
|
#include <mapnik/timer.hpp>
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
#include <mapnik/datasource.hpp>
|
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
|
@ -34,9 +33,11 @@
|
||||||
|
|
||||||
#include "geos_featureset.hpp"
|
#include "geos_featureset.hpp"
|
||||||
|
|
||||||
|
// boost
|
||||||
|
#include <boost/make_shared.hpp>
|
||||||
|
|
||||||
using mapnik::query;
|
using mapnik::query;
|
||||||
using mapnik::box2d;
|
using mapnik::box2d;
|
||||||
using mapnik::Feature;
|
|
||||||
using mapnik::feature_ptr;
|
using mapnik::feature_ptr;
|
||||||
using mapnik::geometry_utils;
|
using mapnik::geometry_utils;
|
||||||
using mapnik::transcoder;
|
using mapnik::transcoder;
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#define GEOS_FEATURESET_HPP
|
#define GEOS_FEATURESET_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/datasource.hpp>
|
#include <mapnik/datasource.hpp>
|
||||||
#include <mapnik/unicode.hpp>
|
#include <mapnik/unicode.hpp>
|
||||||
#include <mapnik/geom_util.hpp>
|
#include <mapnik/geom_util.hpp>
|
||||||
|
|
|
@ -85,10 +85,10 @@ kismet_datasource::kismet_datasource(parameters const& params)
|
||||||
throw datasource_exception("Kismet Plugin: missing <host> parameter");
|
throw datasource_exception("Kismet Plugin: missing <host> parameter");
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::optional<unsigned int> port = params.get<unsigned int>("port", 2501);
|
boost::optional<int> port = params.get<int>("port", 2501);
|
||||||
if (port)
|
if (port)
|
||||||
{
|
{
|
||||||
port_ = *port;
|
port_ = static_cast<unsigned>(*port);
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::optional<std::string> srs = params.get<std::string>("srs");
|
boost::optional<std::string> srs = params.get<std::string>("srs");
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/datasource.hpp>
|
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
|
@ -33,7 +32,9 @@
|
||||||
|
|
||||||
#include "kismet_featureset.hpp"
|
#include "kismet_featureset.hpp"
|
||||||
|
|
||||||
using mapnik::Feature;
|
// boost
|
||||||
|
#include <boost/make_shared.hpp>
|
||||||
|
|
||||||
using mapnik::feature_ptr;
|
using mapnik::feature_ptr;
|
||||||
using mapnik::geometry_type;
|
using mapnik::geometry_type;
|
||||||
using mapnik::geometry_utils;
|
using mapnik::geometry_utils;
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#define KISMET_FEATURESET_HPP
|
#define KISMET_FEATURESET_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/datasource.hpp>
|
#include <mapnik/datasource.hpp>
|
||||||
#include <mapnik/unicode.hpp>
|
#include <mapnik/unicode.hpp>
|
||||||
#include <mapnik/wkb.hpp>
|
#include <mapnik/wkb.hpp>
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
#define KISMET_TYPES_HPP
|
#define KISMET_TYPES_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/datasource.hpp>
|
|
||||||
#include <mapnik/params.hpp>
|
#include <mapnik/params.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <mapnik/boolean.hpp>
|
#include <mapnik/boolean.hpp>
|
||||||
#include <mapnik/sql_utils.hpp>
|
#include <mapnik/sql_utils.hpp>
|
||||||
#include <mapnik/timer.hpp>
|
#include <mapnik/timer.hpp>
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
@ -77,7 +78,7 @@ occi_datasource::occi_datasource(parameters const& params)
|
||||||
extent_initialized_(false),
|
extent_initialized_(false),
|
||||||
desc_(*params.get<std::string>("type"), *params.get<std::string>("encoding", "utf-8")),
|
desc_(*params.get<std::string>("type"), *params.get<std::string>("encoding", "utf-8")),
|
||||||
use_wkb_(*params.get<mapnik::boolean>("use_wkb", false)),
|
use_wkb_(*params.get<mapnik::boolean>("use_wkb", false)),
|
||||||
row_limit_(*params.get<int>("row_limit", 0)),
|
row_limit_(*params.get<mapnik::value_integer>("row_limit", 0)),
|
||||||
row_prefetch_(*params.get<int>("row_prefetch", 100)),
|
row_prefetch_(*params.get<int>("row_prefetch", 100)),
|
||||||
pool_(0),
|
pool_(0),
|
||||||
conn_(0)
|
conn_(0)
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/coord.hpp>
|
#include <mapnik/coord.hpp>
|
||||||
#include <mapnik/feature_layer_desc.hpp>
|
#include <mapnik/feature_layer_desc.hpp>
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
@ -70,7 +71,7 @@ private:
|
||||||
mutable mapnik::box2d<double> extent_;
|
mutable mapnik::box2d<double> extent_;
|
||||||
mapnik::layer_descriptor desc_;
|
mapnik::layer_descriptor desc_;
|
||||||
bool use_wkb_;
|
bool use_wkb_;
|
||||||
int row_limit_;
|
mapnik::value_integer row_limit_;
|
||||||
int row_prefetch_;
|
int row_prefetch_;
|
||||||
oracle::occi::StatelessConnectionPool* pool_;
|
oracle::occi::StatelessConnectionPool* pool_;
|
||||||
oracle::occi::Connection* conn_;
|
oracle::occi::Connection* conn_;
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
#include <mapnik/datasource.hpp>
|
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
|
@ -37,7 +36,6 @@
|
||||||
|
|
||||||
using mapnik::query;
|
using mapnik::query;
|
||||||
using mapnik::box2d;
|
using mapnik::box2d;
|
||||||
using mapnik::Feature;
|
|
||||||
using mapnik::feature_ptr;
|
using mapnik::feature_ptr;
|
||||||
using mapnik::geometry_type;
|
using mapnik::geometry_type;
|
||||||
using mapnik::geometry_utils;
|
using mapnik::geometry_utils;
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#define OCCI_FEATURESET_HPP
|
#define OCCI_FEATURESET_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/datasource.hpp>
|
#include <mapnik/datasource.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/unicode.hpp>
|
#include <mapnik/unicode.hpp>
|
||||||
|
|
|
@ -139,7 +139,7 @@ void ogr_datasource::init(mapnik::parameters const& params)
|
||||||
|
|
||||||
// initialize layer
|
// initialize layer
|
||||||
boost::optional<std::string> layer_by_name = params.get<std::string>("layer");
|
boost::optional<std::string> layer_by_name = params.get<std::string>("layer");
|
||||||
boost::optional<unsigned> layer_by_index = params.get<unsigned>("layer_by_index");
|
boost::optional<int> layer_by_index = params.get<int>("layer_by_index");
|
||||||
boost::optional<std::string> layer_by_sql = params.get<std::string>("layer_by_sql");
|
boost::optional<std::string> layer_by_sql = params.get<std::string>("layer_by_sql");
|
||||||
|
|
||||||
int passed_parameters = 0;
|
int passed_parameters = 0;
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
#include <mapnik/datasource.hpp>
|
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
|
@ -38,7 +38,6 @@
|
||||||
|
|
||||||
using mapnik::query;
|
using mapnik::query;
|
||||||
using mapnik::box2d;
|
using mapnik::box2d;
|
||||||
using mapnik::Feature;
|
|
||||||
using mapnik::feature_ptr;
|
using mapnik::feature_ptr;
|
||||||
using mapnik::geometry_utils;
|
using mapnik::geometry_utils;
|
||||||
using mapnik::transcoder;
|
using mapnik::transcoder;
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#define OGR_FEATURESET_HPP
|
#define OGR_FEATURESET_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/datasource.hpp>
|
#include <mapnik/datasource.hpp>
|
||||||
#include <mapnik/unicode.hpp>
|
#include <mapnik/unicode.hpp>
|
||||||
#include <mapnik/geom_util.hpp>
|
#include <mapnik/geom_util.hpp>
|
||||||
|
|
|
@ -21,9 +21,9 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
#include <mapnik/datasource.hpp>
|
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
|
@ -43,7 +43,6 @@
|
||||||
|
|
||||||
using mapnik::query;
|
using mapnik::query;
|
||||||
using mapnik::box2d;
|
using mapnik::box2d;
|
||||||
using mapnik::Feature;
|
|
||||||
using mapnik::feature_ptr;
|
using mapnik::feature_ptr;
|
||||||
using mapnik::geometry_utils;
|
using mapnik::geometry_utils;
|
||||||
using mapnik::transcoder;
|
using mapnik::transcoder;
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/scoped_ptr.hpp>
|
#include <boost/scoped_ptr.hpp>
|
||||||
|
#include <mapnik/feature.hpp>
|
||||||
#include "ogr_featureset.hpp"
|
#include "ogr_featureset.hpp"
|
||||||
|
|
||||||
template <typename filterT>
|
template <typename filterT>
|
||||||
|
|
|
@ -23,12 +23,16 @@
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/feature_factory.hpp>
|
#include <mapnik/feature_factory.hpp>
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
|
#include <mapnik/unicode.hpp>
|
||||||
|
|
||||||
|
// boost
|
||||||
|
#include <boost/make_shared.hpp>
|
||||||
|
|
||||||
#include "osm_featureset.hpp"
|
#include "osm_featureset.hpp"
|
||||||
|
|
||||||
using mapnik::Feature;
|
|
||||||
using mapnik::feature_ptr;
|
using mapnik::feature_ptr;
|
||||||
using mapnik::geometry_type;
|
using mapnik::geometry_type;
|
||||||
using mapnik::feature_factory;
|
using mapnik::feature_factory;
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <mapnik/sql_utils.hpp>
|
#include <mapnik/sql_utils.hpp>
|
||||||
#include <mapnik/util/conversions.hpp>
|
#include <mapnik/util/conversions.hpp>
|
||||||
#include <mapnik/timer.hpp>
|
#include <mapnik/timer.hpp>
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
@ -62,7 +63,7 @@ postgis_datasource::postgis_datasource(parameters const& params)
|
||||||
geometry_table_(*params.get<std::string>("geometry_table", "")),
|
geometry_table_(*params.get<std::string>("geometry_table", "")),
|
||||||
geometry_field_(*params.get<std::string>("geometry_field", "")),
|
geometry_field_(*params.get<std::string>("geometry_field", "")),
|
||||||
key_field_(*params.get<std::string>("key_field", "")),
|
key_field_(*params.get<std::string>("key_field", "")),
|
||||||
cursor_fetch_size_(*params.get<int>("cursor_size", 0)),
|
cursor_fetch_size_(*params.get<mapnik::value_integer>("cursor_size", 0)),
|
||||||
row_limit_(*params.get<int>("row_limit", 0)),
|
row_limit_(*params.get<int>("row_limit", 0)),
|
||||||
type_(datasource::Vector),
|
type_(datasource::Vector),
|
||||||
srid_(*params.get<int>("srid", 0)),
|
srid_(*params.get<int>("srid", 0)),
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/coord.hpp>
|
#include <mapnik/coord.hpp>
|
||||||
#include <mapnik/feature_layer_desc.hpp>
|
#include <mapnik/feature_layer_desc.hpp>
|
||||||
|
#include <mapnik/unicode.hpp>
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
@ -72,7 +74,6 @@ private:
|
||||||
std::string sql_bbox(box2d<double> const& env) const;
|
std::string sql_bbox(box2d<double> const& env) const;
|
||||||
std::string populate_tokens(std::string const& sql, double scale_denom, box2d<double> const& env, double pixel_width, double pixel_height) const;
|
std::string populate_tokens(std::string const& sql, double scale_denom, box2d<double> const& env, double pixel_width, double pixel_height) const;
|
||||||
std::string populate_tokens(std::string const& sql) const;
|
std::string populate_tokens(std::string const& sql) const;
|
||||||
static std::string unquote(std::string const& sql);
|
|
||||||
boost::shared_ptr<IResultSet> get_resultset(boost::shared_ptr<Connection> const &conn, std::string const& sql) const;
|
boost::shared_ptr<IResultSet> get_resultset(boost::shared_ptr<Connection> const &conn, std::string const& sql) const;
|
||||||
|
|
||||||
static const std::string GEOMETRY_COLUMNS;
|
static const std::string GEOMETRY_COLUMNS;
|
||||||
|
@ -87,8 +88,8 @@ private:
|
||||||
std::string geometry_table_;
|
std::string geometry_table_;
|
||||||
const std::string geometry_field_;
|
const std::string geometry_field_;
|
||||||
std::string key_field_;
|
std::string key_field_;
|
||||||
const int cursor_fetch_size_;
|
mapnik::value_integer cursor_fetch_size_;
|
||||||
const int row_limit_;
|
mapnik::value_integer row_limit_;
|
||||||
std::string geometryColumn_;
|
std::string geometryColumn_;
|
||||||
mapnik::datasource::datasource_t type_;
|
mapnik::datasource::datasource_t type_;
|
||||||
int srid_;
|
int srid_;
|
||||||
|
|
|
@ -29,13 +29,16 @@
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
#include <mapnik/wkb.hpp>
|
#include <mapnik/wkb.hpp>
|
||||||
#include <mapnik/unicode.hpp>
|
#include <mapnik/unicode.hpp>
|
||||||
#include <mapnik/sql_utils.hpp>
|
#include <mapnik/value.hpp>
|
||||||
#include <mapnik/feature_factory.hpp>
|
#include <mapnik/feature_factory.hpp>
|
||||||
#include <mapnik/util/conversions.hpp>
|
#include <mapnik/util/conversions.hpp>
|
||||||
#include <mapnik/util/trim.hpp>
|
#include <mapnik/util/trim.hpp>
|
||||||
|
#include <mapnik/global.hpp> // for int2net
|
||||||
|
#include <boost/scoped_array.hpp>
|
||||||
|
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/spirit/include/qi.hpp>
|
#include <boost/cstdint.hpp> // for boost::int16_t
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -60,6 +63,8 @@ postgis_featureset::postgis_featureset(boost::shared_ptr<IResultSet> const& rs,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string numeric2string(const char* buf);
|
||||||
|
|
||||||
feature_ptr postgis_featureset::next()
|
feature_ptr postgis_featureset::next()
|
||||||
{
|
{
|
||||||
while (rs_->next())
|
while (rs_->next())
|
||||||
|
@ -156,7 +161,7 @@ feature_ptr postgis_featureset::next()
|
||||||
{
|
{
|
||||||
float val;
|
float val;
|
||||||
float4net(val, buf);
|
float4net(val, buf);
|
||||||
feature->put(name, val);
|
feature->put(name, static_cast<double>(val));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,7 +191,7 @@ feature_ptr postgis_featureset::next()
|
||||||
case 1700: //numeric
|
case 1700: //numeric
|
||||||
{
|
{
|
||||||
double val;
|
double val;
|
||||||
std::string str = mapnik::sql_utils::numeric2string(buf);
|
std::string str = numeric2string(buf);
|
||||||
if (mapnik::util::string2double(str, val))
|
if (mapnik::util::string2double(str, val))
|
||||||
{
|
{
|
||||||
feature->put(name, val);
|
feature->put(name, val);
|
||||||
|
@ -213,3 +218,115 @@ postgis_featureset::~postgis_featureset()
|
||||||
{
|
{
|
||||||
rs_->close();
|
rs_->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string numeric2string(const char* buf)
|
||||||
|
{
|
||||||
|
boost::int16_t ndigits = int2net(buf);
|
||||||
|
boost::int16_t weight = int2net(buf+2);
|
||||||
|
boost::int16_t sign = int2net(buf+4);
|
||||||
|
boost::int16_t dscale = int2net(buf+6);
|
||||||
|
|
||||||
|
boost::scoped_array<boost::int16_t> digits(new boost::int16_t[ndigits]);
|
||||||
|
for (int n=0; n < ndigits ;++n)
|
||||||
|
{
|
||||||
|
digits[n] = int2net(buf+8+n*2);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ostringstream ss;
|
||||||
|
|
||||||
|
if (sign == 0x4000) ss << "-";
|
||||||
|
|
||||||
|
int i = std::max(weight,boost::int16_t(0));
|
||||||
|
int d = 0;
|
||||||
|
|
||||||
|
// Each numeric "digit" is actually a value between 0000 and 9999 stored in a 16 bit field.
|
||||||
|
// For example, the number 1234567809990001 is stored as four digits: [1234] [5678] [999] [1].
|
||||||
|
// Note that the last two digits show that the leading 0's are lost when the number is split.
|
||||||
|
// We must be careful to re-insert these 0's when building the string.
|
||||||
|
|
||||||
|
while ( i >= 0)
|
||||||
|
{
|
||||||
|
if (i <= weight && d < ndigits)
|
||||||
|
{
|
||||||
|
// All digits after the first must be padded to make the field 4 characters long
|
||||||
|
if (d != 0)
|
||||||
|
{
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
int dig = digits[d];
|
||||||
|
if (dig < 10)
|
||||||
|
{
|
||||||
|
ss << "000"; // 0000 - 0009
|
||||||
|
}
|
||||||
|
else if (dig < 100)
|
||||||
|
{
|
||||||
|
ss << "00"; // 0010 - 0099
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ss << "0"; // 0100 - 0999;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
switch(digits[d])
|
||||||
|
{
|
||||||
|
case 0 ... 9:
|
||||||
|
ss << "000"; // 0000 - 0009
|
||||||
|
break;
|
||||||
|
case 10 ... 99:
|
||||||
|
ss << "00"; // 0010 - 0099
|
||||||
|
break;
|
||||||
|
case 100 ... 999:
|
||||||
|
ss << "0"; // 0100 - 0999
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
ss << digits[d++];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (d == 0)
|
||||||
|
ss << "0";
|
||||||
|
else
|
||||||
|
ss << "0000";
|
||||||
|
}
|
||||||
|
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
if (dscale > 0)
|
||||||
|
{
|
||||||
|
ss << '.';
|
||||||
|
// dscale counts the number of decimal digits following the point, not the numeric digits
|
||||||
|
while (dscale > 0)
|
||||||
|
{
|
||||||
|
int value;
|
||||||
|
if (i <= weight && d < ndigits)
|
||||||
|
value = digits[d++];
|
||||||
|
else
|
||||||
|
value = 0;
|
||||||
|
|
||||||
|
// Output up to 4 decimal digits for this value
|
||||||
|
if (dscale > 0) {
|
||||||
|
ss << (value / 1000);
|
||||||
|
value %= 1000;
|
||||||
|
dscale--;
|
||||||
|
}
|
||||||
|
if (dscale > 0) {
|
||||||
|
ss << (value / 100);
|
||||||
|
value %= 100;
|
||||||
|
dscale--;
|
||||||
|
}
|
||||||
|
if (dscale > 0) {
|
||||||
|
ss << (value / 10);
|
||||||
|
value %= 10;
|
||||||
|
dscale--;
|
||||||
|
}
|
||||||
|
if (dscale > 0) {
|
||||||
|
ss << value;
|
||||||
|
dscale--;
|
||||||
|
}
|
||||||
|
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ss.str();
|
||||||
|
}
|
||||||
|
|
|
@ -28,9 +28,9 @@
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/datasource.hpp>
|
#include <mapnik/datasource.hpp>
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
|
#include <mapnik/unicode.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
|
|
||||||
#include <boost/scoped_ptr.hpp>
|
#include <boost/scoped_ptr.hpp>
|
||||||
|
|
||||||
using mapnik::Featureset;
|
using mapnik::Featureset;
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#ifndef PYTHON_FEATURESET_HPP
|
#ifndef PYTHON_FEATURESET_HPP
|
||||||
#define PYTHON_FEATURESET_HPP
|
#define PYTHON_FEATURESET_HPP
|
||||||
|
|
||||||
|
// mapnik
|
||||||
|
#include <mapnik/feature.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/python.hpp>
|
#include <boost/python.hpp>
|
||||||
#include <boost/python/stl_iterator.hpp>
|
#include <boost/python/stl_iterator.hpp>
|
||||||
|
@ -8,7 +11,6 @@
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/datasource.hpp>
|
#include <mapnik/datasource.hpp>
|
||||||
|
|
||||||
// extend the mapnik::Featureset defined in include/mapnik/datasource.hpp
|
|
||||||
class python_featureset : public mapnik::Featureset
|
class python_featureset : public mapnik::Featureset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -61,9 +61,9 @@ raster_datasource::raster_datasource(parameters const& params)
|
||||||
else
|
else
|
||||||
filename_ = *file;
|
filename_ = *file;
|
||||||
|
|
||||||
multi_tiles_ = *params.get<bool>("multi", false);
|
multi_tiles_ = *params.get<mapnik::boolean>("multi", false);
|
||||||
tile_size_ = *params.get<unsigned>("tile_size", 256);
|
tile_size_ = *params.get<int>("tile_size", 256);
|
||||||
tile_stride_ = *params.get<unsigned>("tile_stride", 1);
|
tile_stride_ = *params.get<int>("tile_stride", 1);
|
||||||
|
|
||||||
format_ = *params.get<std::string>("format","tiff");
|
format_ = *params.get<std::string>("format","tiff");
|
||||||
|
|
||||||
|
@ -91,8 +91,8 @@ raster_datasource::raster_datasource(parameters const& params)
|
||||||
|
|
||||||
if (multi_tiles_)
|
if (multi_tiles_)
|
||||||
{
|
{
|
||||||
boost::optional<unsigned> x_width = params.get<unsigned>("x_width");
|
boost::optional<int> x_width = params.get<int>("x_width");
|
||||||
boost::optional<unsigned> y_width = params.get<unsigned>("y_width");
|
boost::optional<int> y_width = params.get<int>("y_width");
|
||||||
|
|
||||||
if (! x_width)
|
if (! x_width)
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
|
#include <mapnik/image_data.hpp>
|
||||||
|
#include <mapnik/raster.hpp>
|
||||||
#include <mapnik/ctrans.hpp>
|
#include <mapnik/ctrans.hpp>
|
||||||
#include <mapnik/image_reader.hpp>
|
#include <mapnik/image_reader.hpp>
|
||||||
#include <mapnik/image_util.hpp>
|
#include <mapnik/image_util.hpp>
|
||||||
|
@ -29,12 +31,12 @@
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/algorithm/string/replace.hpp>
|
#include <boost/algorithm/string/replace.hpp>
|
||||||
|
#include <boost/make_shared.hpp>
|
||||||
|
|
||||||
#include "raster_featureset.hpp"
|
#include "raster_featureset.hpp"
|
||||||
|
|
||||||
using mapnik::query;
|
using mapnik::query;
|
||||||
using mapnik::image_reader;
|
using mapnik::image_reader;
|
||||||
using mapnik::Feature;
|
|
||||||
using mapnik::feature_ptr;
|
using mapnik::feature_ptr;
|
||||||
using mapnik::image_data_32;
|
using mapnik::image_data_32;
|
||||||
using mapnik::raster;
|
using mapnik::raster;
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "raster_info.hpp"
|
#include "raster_info.hpp"
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
#include <mapnik/image_util.hpp>
|
#include <mapnik/image_util.hpp>
|
||||||
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/feature_factory.hpp>
|
#include <mapnik/feature_factory.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
|
@ -34,7 +35,6 @@
|
||||||
using mapnik::query;
|
using mapnik::query;
|
||||||
using mapnik::coord2d;
|
using mapnik::coord2d;
|
||||||
using mapnik::box2d;
|
using mapnik::box2d;
|
||||||
using mapnik::Feature;
|
|
||||||
using mapnik::feature_ptr;
|
using mapnik::feature_ptr;
|
||||||
using mapnik::geometry_type;
|
using mapnik::geometry_type;
|
||||||
using mapnik::query;
|
using mapnik::query;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#define RASTERLITE_FEATURESET_HPP
|
#define RASTERLITE_FEATURESET_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/datasource.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/variant.hpp>
|
#include <boost/variant.hpp>
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
// mapnik
|
// mapnik
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/utils.hpp>
|
#include <mapnik/utils.hpp>
|
||||||
#include <mapnik/unicode.hpp>
|
#include <mapnik/unicode.hpp>
|
||||||
|
@ -124,7 +125,7 @@ const field_descriptor& dbf_file::descriptor(int col) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, Feature & f) const throw()
|
void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, mapnik::feature_impl & f) const throw()
|
||||||
{
|
{
|
||||||
using namespace boost::spirit;
|
using namespace boost::spirit;
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/noncopyable.hpp>
|
#include <mapnik/noncopyable.hpp>
|
||||||
|
#include <mapnik/unicode.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/interprocess/streams/bufferstream.hpp>
|
#include <boost/interprocess/streams/bufferstream.hpp>
|
||||||
|
@ -36,9 +37,6 @@
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
using mapnik::transcoder;
|
|
||||||
using mapnik::Feature;
|
|
||||||
|
|
||||||
struct field_descriptor
|
struct field_descriptor
|
||||||
{
|
{
|
||||||
int index_;
|
int index_;
|
||||||
|
@ -73,7 +71,7 @@ public:
|
||||||
field_descriptor const& descriptor(int col) const;
|
field_descriptor const& descriptor(int col) const;
|
||||||
void move_to(int index);
|
void move_to(int index);
|
||||||
std::string string_value(int col) const;
|
std::string string_value(int col) const;
|
||||||
void add_attribute(int col, transcoder const& tr, Feature & f) const throw();
|
void add_attribute(int col, mapnik::transcoder const& tr, mapnik::feature_impl & f) const throw();
|
||||||
private:
|
private:
|
||||||
void read_header();
|
void read_header();
|
||||||
int read_short();
|
int read_short();
|
||||||
|
|
|
@ -35,10 +35,10 @@
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/boolean.hpp>
|
#include <mapnik/boolean.hpp>
|
||||||
#include <mapnik/sql_utils.hpp>
|
|
||||||
#include <mapnik/util/conversions.hpp>
|
#include <mapnik/util/conversions.hpp>
|
||||||
#include <mapnik/geom_util.hpp>
|
#include <mapnik/geom_util.hpp>
|
||||||
#include <mapnik/timer.hpp>
|
#include <mapnik/timer.hpp>
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
|
|
||||||
// stl
|
// stl
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
@ -60,7 +60,7 @@ shape_datasource::shape_datasource(const parameters ¶ms)
|
||||||
type_(datasource::Vector),
|
type_(datasource::Vector),
|
||||||
file_length_(0),
|
file_length_(0),
|
||||||
indexed_(false),
|
indexed_(false),
|
||||||
row_limit_(*params.get<int>("row_limit",0)),
|
row_limit_(*params.get<mapnik::value_integer>("row_limit",0)),
|
||||||
desc_(*params.get<std::string>("type"), *params.get<std::string>("encoding","utf-8"))
|
desc_(*params.get<std::string>("type"), *params.get<std::string>("encoding","utf-8"))
|
||||||
{
|
{
|
||||||
#ifdef MAPNIK_STATS
|
#ifdef MAPNIK_STATS
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/coord.hpp>
|
#include <mapnik/coord.hpp>
|
||||||
#include <mapnik/feature_layer_desc.hpp>
|
#include <mapnik/feature_layer_desc.hpp>
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
|
|
@ -26,6 +26,10 @@
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
#include <mapnik/feature_factory.hpp>
|
#include <mapnik/feature_factory.hpp>
|
||||||
|
#include <mapnik/unicode.hpp>
|
||||||
|
|
||||||
|
// boost
|
||||||
|
#include <boost/make_shared.hpp>
|
||||||
|
|
||||||
#include "shape_featureset.hpp"
|
#include "shape_featureset.hpp"
|
||||||
#include "shape_utils.hpp"
|
#include "shape_utils.hpp"
|
||||||
|
|
|
@ -25,7 +25,9 @@
|
||||||
|
|
||||||
//mapnik
|
//mapnik
|
||||||
#include <mapnik/geom_util.hpp>
|
#include <mapnik/geom_util.hpp>
|
||||||
#include <mapnik/datasource.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
|
#include <mapnik/unicode.hpp>
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
|
|
||||||
#include "shape_io.hpp"
|
#include "shape_io.hpp"
|
||||||
|
|
||||||
|
@ -60,7 +62,7 @@ private:
|
||||||
boost::scoped_ptr<transcoder> tr_;
|
boost::scoped_ptr<transcoder> tr_;
|
||||||
long file_length_;
|
long file_length_;
|
||||||
std::vector<int> attr_ids_;
|
std::vector<int> attr_ids_;
|
||||||
const int row_limit_;
|
mapnik::value_integer row_limit_;
|
||||||
mutable int count_;
|
mutable int count_;
|
||||||
context_ptr ctx_;
|
context_ptr ctx_;
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
// boost
|
// boost
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
#include <boost/interprocess/streams/bufferstream.hpp>
|
#include <boost/interprocess/streams/bufferstream.hpp>
|
||||||
|
#include <boost/make_shared.hpp>
|
||||||
|
|
||||||
#include "shape_index_featureset.hpp"
|
#include "shape_index_featureset.hpp"
|
||||||
#include "shape_utils.hpp"
|
#include "shape_utils.hpp"
|
||||||
|
@ -47,7 +48,7 @@ shape_index_featureset<filterT>::shape_index_featureset(filterT const& filter,
|
||||||
: filter_(filter),
|
: filter_(filter),
|
||||||
ctx_(boost::make_shared<mapnik::context_type>()),
|
ctx_(boost::make_shared<mapnik::context_type>()),
|
||||||
shape_(shape),
|
shape_(shape),
|
||||||
tr_(new transcoder(encoding)),
|
tr_(new mapnik::transcoder(encoding)),
|
||||||
row_limit_(row_limit),
|
row_limit_(row_limit),
|
||||||
count_(0),
|
count_(0),
|
||||||
feature_bbox_()
|
feature_bbox_()
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/geom_util.hpp>
|
#include <mapnik/geom_util.hpp>
|
||||||
|
#include <mapnik/feature.hpp>
|
||||||
|
#include <mapnik/unicode.hpp>
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/scoped_ptr.hpp>
|
#include <boost/scoped_ptr.hpp>
|
||||||
|
@ -59,11 +62,11 @@ private:
|
||||||
filterT filter_;
|
filterT filter_;
|
||||||
context_ptr ctx_;
|
context_ptr ctx_;
|
||||||
shape_io & shape_;
|
shape_io & shape_;
|
||||||
boost::scoped_ptr<transcoder> tr_;
|
boost::scoped_ptr<mapnik::transcoder> tr_;
|
||||||
std::vector<std::streampos> offsets_;
|
std::vector<std::streampos> offsets_;
|
||||||
std::vector<std::streampos>::iterator itr_;
|
std::vector<std::streampos>::iterator itr_;
|
||||||
std::vector<int> attr_ids_;
|
std::vector<int> attr_ids_;
|
||||||
const int row_limit_;
|
mapnik::value_integer row_limit_;
|
||||||
mutable int count_;
|
mutable int count_;
|
||||||
mutable box2d<double> feature_bbox_;
|
mutable box2d<double> feature_bbox_;
|
||||||
};
|
};
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/datasource.hpp>
|
#include <mapnik/datasource.hpp>
|
||||||
#include <mapnik/params.hpp>
|
#include <mapnik/params.hpp>
|
||||||
#include <mapnik/sql_utils.hpp>
|
|
||||||
#include <mapnik/timer.hpp>
|
#include <mapnik/timer.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
|
|
|
@ -65,8 +65,8 @@ sqlite_datasource::sqlite_datasource(parameters const& params)
|
||||||
geometry_field_(*params.get<std::string>("geometry_field", "")),
|
geometry_field_(*params.get<std::string>("geometry_field", "")),
|
||||||
index_table_(*params.get<std::string>("index_table", "")),
|
index_table_(*params.get<std::string>("index_table", "")),
|
||||||
key_field_(*params.get<std::string>("key_field", "")),
|
key_field_(*params.get<std::string>("key_field", "")),
|
||||||
row_offset_(*params.get<int>("row_offset", 0)),
|
row_offset_(*params.get<mapnik::value_integer>("row_offset", 0)),
|
||||||
row_limit_(*params.get<int>("row_limit", 0)),
|
row_limit_(*params.get<mapnik::value_integer>("row_limit", 0)),
|
||||||
intersects_token_("!intersects!"),
|
intersects_token_("!intersects!"),
|
||||||
desc_(*params.get<std::string>("type"), *params.get<std::string>("encoding", "utf-8")),
|
desc_(*params.get<std::string>("type"), *params.get<std::string>("encoding", "utf-8")),
|
||||||
format_(mapnik::wkbAuto)
|
format_(mapnik::wkbAuto)
|
||||||
|
@ -142,7 +142,7 @@ sqlite_datasource::sqlite_datasource(parameters const& params)
|
||||||
// now actually create the connection and start executing setup sql
|
// now actually create the connection and start executing setup sql
|
||||||
dataset_ = boost::make_shared<sqlite_connection>(dataset_name_);
|
dataset_ = boost::make_shared<sqlite_connection>(dataset_name_);
|
||||||
|
|
||||||
boost::optional<unsigned> table_by_index = params.get<unsigned>("table_by_index");
|
boost::optional<int> table_by_index = params.get<int>("table_by_index");
|
||||||
|
|
||||||
int passed_parameters = 0;
|
int passed_parameters = 0;
|
||||||
passed_parameters += params.get<std::string>("table") ? 1 : 0;
|
passed_parameters += params.get<std::string>("table") ? 1 : 0;
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <mapnik/coord.hpp>
|
#include <mapnik/coord.hpp>
|
||||||
#include <mapnik/feature_layer_desc.hpp>
|
#include <mapnik/feature_layer_desc.hpp>
|
||||||
#include <mapnik/wkb.hpp>
|
#include <mapnik/wkb.hpp>
|
||||||
|
#include <mapnik/value.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
@ -77,7 +78,7 @@ private:
|
||||||
std::string index_table_;
|
std::string index_table_;
|
||||||
std::string key_field_;
|
std::string key_field_;
|
||||||
int row_offset_;
|
int row_offset_;
|
||||||
int row_limit_;
|
mapnik::value_integer row_limit_;
|
||||||
// TODO - also add to postgis.input
|
// TODO - also add to postgis.input
|
||||||
const std::string intersects_token_;
|
const std::string intersects_token_;
|
||||||
mapnik::layer_descriptor desc_;
|
mapnik::layer_descriptor desc_;
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
#include <mapnik/datasource.hpp>
|
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
|
@ -38,7 +37,6 @@
|
||||||
|
|
||||||
using mapnik::query;
|
using mapnik::query;
|
||||||
using mapnik::box2d;
|
using mapnik::box2d;
|
||||||
using mapnik::Feature;
|
|
||||||
using mapnik::feature_ptr;
|
using mapnik::feature_ptr;
|
||||||
using mapnik::geometry_utils;
|
using mapnik::geometry_utils;
|
||||||
using mapnik::transcoder;
|
using mapnik::transcoder;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#define MAPNIK_SQLITE_FEATURESET_HPP
|
#define MAPNIK_SQLITE_FEATURESET_HPP
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/datasource.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/unicode.hpp>
|
#include <mapnik/unicode.hpp>
|
||||||
#include <mapnik/wkb.hpp>
|
#include <mapnik/wkb.hpp>
|
||||||
|
|
||||||
|
|
|
@ -644,7 +644,6 @@ public:
|
||||||
std::string fld_type(rs->column_text(2));
|
std::string fld_type(rs->column_text(2));
|
||||||
sqlite_int64 fld_pk = rs->column_integer64(5);
|
sqlite_int64 fld_pk = rs->column_integer64(5);
|
||||||
std::transform(fld_type.begin(), fld_type.end(), fld_type.begin(), ::tolower);
|
std::transform(fld_type.begin(), fld_type.end(), fld_type.begin(), ::tolower);
|
||||||
|
|
||||||
// TODO - how to handle primary keys on multiple columns ?
|
// TODO - how to handle primary keys on multiple columns ?
|
||||||
if (key_field.empty() && ! found_pk && fld_pk != 0)
|
if (key_field.empty() && ! found_pk && fld_pk != 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
#include <mapnik/feature_factory.hpp>
|
#include <mapnik/feature_factory.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
|
|
||||||
|
// boost
|
||||||
|
#include <boost/make_shared.hpp>
|
||||||
|
|
||||||
#include "hello_featureset.hpp"
|
#include "hello_featureset.hpp"
|
||||||
|
|
||||||
hello_featureset::hello_featureset(mapnik::box2d<double> const& box, std::string const& encoding)
|
hello_featureset::hello_featureset(mapnik::box2d<double> const& box, std::string const& encoding)
|
||||||
|
|
|
@ -3,11 +3,12 @@
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/datasource.hpp>
|
#include <mapnik/datasource.hpp>
|
||||||
|
#include <mapnik/feature.hpp>
|
||||||
|
#include <mapnik/unicode.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#include <boost/scoped_ptr.hpp> // needed for wrapping the transcoder
|
#include <boost/scoped_ptr.hpp> // needed for wrapping the transcoder
|
||||||
|
|
||||||
// extend the mapnik::Featureset defined in include/mapnik/datasource.hpp
|
|
||||||
class hello_featureset : public mapnik::Featureset
|
class hello_featureset : public mapnik::Featureset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in a new issue