rename SHAPE_MEMORY_MAPPED_FILE to MAPNIK_MEMORY_MAPPED_FILE
This commit is contained in:
parent
4976a7c72a
commit
8813e73cfc
17 changed files with 50 additions and 45 deletions
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -6,6 +6,17 @@ Developers: Please commit along with changes.
|
||||||
|
|
||||||
For a complete change history, see the git log.
|
For a complete change history, see the git log.
|
||||||
|
|
||||||
|
## 3.0.8
|
||||||
|
|
||||||
|
Released: ...
|
||||||
|
|
||||||
|
(Packaged from )
|
||||||
|
|
||||||
|
#### Summary
|
||||||
|
|
||||||
|
- Renamed `SHAPE_MEMORY_MAPPED_FILE` define to `MAPNIK_MEMORY_MAPPED_FILE`. Pass `./configure MEMORY_MAPPED_FILE=True|False` to request
|
||||||
|
support for memory mapped files across Mapnik plugins.
|
||||||
|
|
||||||
## 3.0.7
|
## 3.0.7
|
||||||
|
|
||||||
Released: October 12, 2015
|
Released: October 12, 2015
|
||||||
|
|
|
@ -389,7 +389,7 @@ opts.AddVariables(
|
||||||
EnumVariable('PLUGIN_LINKING', "Set plugin linking with libmapnik", 'shared', ['shared','static']),
|
EnumVariable('PLUGIN_LINKING', "Set plugin linking with libmapnik", 'shared', ['shared','static']),
|
||||||
|
|
||||||
# Other variables
|
# Other variables
|
||||||
BoolVariable('SHAPE_MEMORY_MAPPED_FILE', 'Utilize memory-mapped files in Shapefile Plugin (higher memory usage, better performance)', 'True'),
|
BoolVariable('MEMORY_MAPPED_FILE', 'Utilize memory-mapped files in Shapefile Plugin (higher memory usage, better performance)', 'True'),
|
||||||
('SYSTEM_FONTS','Provide location for python bindings to register fonts (if provided then the bundled DejaVu fonts are not installed)',''),
|
('SYSTEM_FONTS','Provide location for python bindings to register fonts (if provided then the bundled DejaVu fonts are not installed)',''),
|
||||||
('LIB_DIR_NAME','Name to use for the subfolder beside libmapnik where fonts and plugins are installed','mapnik'),
|
('LIB_DIR_NAME','Name to use for the subfolder beside libmapnik where fonts and plugins are installed','mapnik'),
|
||||||
PathVariable('PYTHON','Full path to Python executable used to build bindings', sys.executable),
|
PathVariable('PYTHON','Full path to Python executable used to build bindings', sys.executable),
|
||||||
|
@ -1209,8 +1209,8 @@ if not preconfigured:
|
||||||
thread_suffix = ''
|
thread_suffix = ''
|
||||||
env.Append(LIBS = 'pthread')
|
env.Append(LIBS = 'pthread')
|
||||||
|
|
||||||
if env['SHAPE_MEMORY_MAPPED_FILE']:
|
if env['MEMORY_MAPPED_FILE']:
|
||||||
env.Append(CPPDEFINES = '-DSHAPE_MEMORY_MAPPED_FILE')
|
env.Append(CPPDEFINES = '-DMAPNIK_MEMORY_MAPPED_FILE')
|
||||||
|
|
||||||
# allow for mac osx /usr/lib/libicucore.dylib compatibility
|
# allow for mac osx /usr/lib/libicucore.dylib compatibility
|
||||||
# requires custom supplied headers since Apple does not include them
|
# requires custom supplied headers since Apple does not include them
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#include <mapnik/util/fs.hpp>
|
#include <mapnik/util/fs.hpp>
|
||||||
#include <mapnik/util/spatial_index.hpp>
|
#include <mapnik/util/spatial_index.hpp>
|
||||||
#include <mapnik/geom_util.hpp>
|
#include <mapnik/geom_util.hpp>
|
||||||
#ifdef CSV_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wshadow"
|
#pragma GCC diagnostic ignored "-Wshadow"
|
||||||
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
||||||
|
@ -125,7 +125,7 @@ csv_datasource::csv_datasource(parameters const& params)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if defined (CSV_MEMORY_MAPPED_FILE)
|
#if defined (MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
using file_source_type = boost::interprocess::ibufferstream;
|
using file_source_type = boost::interprocess::ibufferstream;
|
||||||
file_source_type in;
|
file_source_type in;
|
||||||
mapnik::mapped_region_ptr mapped_region;
|
mapnik::mapped_region_ptr mapped_region;
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
csv_featureset::csv_featureset(std::string const& filename, detail::geometry_column_locator const& locator, char separator, char quote,
|
csv_featureset::csv_featureset(std::string const& filename, detail::geometry_column_locator const& locator, char separator, char quote,
|
||||||
std::vector<std::string> const& headers, mapnik::context_ptr const& ctx, array_type && index_array)
|
std::vector<std::string> const& headers, mapnik::context_ptr const& ctx, array_type && index_array)
|
||||||
:
|
:
|
||||||
#if defined(CSV_MEMORY_MAPPED_FILE)
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
//
|
//
|
||||||
#elif defined( _WINDOWS)
|
#elif defined( _WINDOWS)
|
||||||
file_(_wfopen(mapnik::utf8_to_utf16(filename).c_str(), L"rb"), std::fclose),
|
file_(_wfopen(mapnik::utf8_to_utf16(filename).c_str(), L"rb"), std::fclose),
|
||||||
|
@ -51,7 +51,7 @@ csv_featureset::csv_featureset(std::string const& filename, detail::geometry_col
|
||||||
locator_(locator),
|
locator_(locator),
|
||||||
tr_("utf8")
|
tr_("utf8")
|
||||||
{
|
{
|
||||||
#if defined (CSV_MEMORY_MAPPED_FILE)
|
#if defined (MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
boost::optional<mapnik::mapped_region_ptr> memory =
|
boost::optional<mapnik::mapped_region_ptr> memory =
|
||||||
mapnik::mapped_memory_cache::instance().find(filename, true);
|
mapnik::mapped_memory_cache::instance().find(filename, true);
|
||||||
if (memory)
|
if (memory)
|
||||||
|
@ -90,7 +90,7 @@ mapnik::feature_ptr csv_featureset::next()
|
||||||
csv_datasource::item_type const& item = *index_itr_++;
|
csv_datasource::item_type const& item = *index_itr_++;
|
||||||
std::size_t file_offset = item.second.first;
|
std::size_t file_offset = item.second.first;
|
||||||
std::size_t size = item.second.second;
|
std::size_t size = item.second.second;
|
||||||
#if defined(CSV_MEMORY_MAPPED_FILE)
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
char const* start = (char const*)mapped_region_->get_address() + file_offset;
|
char const* start = (char const*)mapped_region_->get_address() + file_offset;
|
||||||
char const* end = start + size;
|
char const* end = start + size;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
#ifdef CSV_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wshadow"
|
#pragma GCC diagnostic ignored "-Wshadow"
|
||||||
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
||||||
|
@ -56,7 +56,7 @@ public:
|
||||||
mapnik::feature_ptr next();
|
mapnik::feature_ptr next();
|
||||||
private:
|
private:
|
||||||
mapnik::feature_ptr parse_feature(char const* beg, char const* end);
|
mapnik::feature_ptr parse_feature(char const* beg, char const* end);
|
||||||
#if defined (CSV_MEMORY_MAPPED_FILE)
|
#if defined (MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
using file_source_type = boost::interprocess::ibufferstream;
|
using file_source_type = boost::interprocess::ibufferstream;
|
||||||
mapnik::mapped_region_ptr mapped_region_;
|
mapnik::mapped_region_ptr mapped_region_;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -48,7 +48,7 @@ csv_index_featureset::csv_index_featureset(std::string const& filename,
|
||||||
ctx_(ctx),
|
ctx_(ctx),
|
||||||
locator_(locator),
|
locator_(locator),
|
||||||
tr_("utf8")
|
tr_("utf8")
|
||||||
#if defined(CSV_MEMORY_MAPPED_FILE)
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
//
|
//
|
||||||
#elif defined( _WINDOWS)
|
#elif defined( _WINDOWS)
|
||||||
,file_(_wfopen(mapnik::utf8_to_utf16(filename).c_str(), L"rb"), std::fclose)
|
,file_(_wfopen(mapnik::utf8_to_utf16(filename).c_str(), L"rb"), std::fclose)
|
||||||
|
@ -57,7 +57,7 @@ csv_index_featureset::csv_index_featureset(std::string const& filename,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
#if defined (CSV_MEMORY_MAPPED_FILE)
|
#if defined (MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
boost::optional<mapnik::mapped_region_ptr> memory =
|
boost::optional<mapnik::mapped_region_ptr> memory =
|
||||||
mapnik::mapped_memory_cache::instance().find(filename, true);
|
mapnik::mapped_memory_cache::instance().find(filename, true);
|
||||||
if (memory)
|
if (memory)
|
||||||
|
@ -112,7 +112,7 @@ mapnik::feature_ptr csv_index_featureset::next()
|
||||||
while( itr_ != positions_.end())
|
while( itr_ != positions_.end())
|
||||||
{
|
{
|
||||||
auto pos = *itr_++;
|
auto pos = *itr_++;
|
||||||
#if defined(CSV_MEMORY_MAPPED_FILE)
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
char const* start = (char const*)mapped_region_->get_address() + pos.first;
|
char const* start = (char const*)mapped_region_->get_address() + pos.first;
|
||||||
char const* end = start + pos.second;
|
char const* end = start + pos.second;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "csv_utils.hpp"
|
#include "csv_utils.hpp"
|
||||||
#include "csv_datasource.hpp"
|
#include "csv_datasource.hpp"
|
||||||
|
|
||||||
#ifdef CSV_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wshadow"
|
#pragma GCC diagnostic ignored "-Wshadow"
|
||||||
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
||||||
|
@ -63,7 +63,7 @@ private:
|
||||||
mapnik::value_integer feature_id_ = 0;
|
mapnik::value_integer feature_id_ = 0;
|
||||||
detail::geometry_column_locator const& locator_;
|
detail::geometry_column_locator const& locator_;
|
||||||
mapnik::transcoder tr_;
|
mapnik::transcoder tr_;
|
||||||
#if defined (CSV_MEMORY_MAPPED_FILE)
|
#if defined (MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
using file_source_type = boost::interprocess::ibufferstream;
|
using file_source_type = boost::interprocess::ibufferstream;
|
||||||
mapnik::mapped_region_ptr mapped_region_;
|
mapnik::mapped_region_ptr mapped_region_;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -44,10 +44,6 @@
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#ifndef _WINDOWS
|
|
||||||
#define CSV_MEMORY_MAPPED_FILE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace csv_utils
|
namespace csv_utils
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
#include <mapnik/util/spatial_index.hpp>
|
#include <mapnik/util/spatial_index.hpp>
|
||||||
#include <mapnik/geom_util.hpp>
|
#include <mapnik/geom_util.hpp>
|
||||||
|
|
||||||
#if defined(SHAPE_MEMORY_MAPPED_FILE)
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wshadow"
|
#pragma GCC diagnostic ignored "-Wshadow"
|
||||||
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
||||||
|
@ -156,7 +156,7 @@ geojson_datasource::geojson_datasource(parameters const& params)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cache_features_ = *params.get<mapnik::boolean_type>("cache_features", true);
|
cache_features_ = *params.get<mapnik::boolean_type>("cache_features", true);
|
||||||
#if !defined(SHAPE_MEMORY_MAPPED_FILE)
|
#if !defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
mapnik::util::file file(filename_);
|
mapnik::util::file file(filename_);
|
||||||
if (!file.open())
|
if (!file.open())
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
geojson_index_featureset::geojson_index_featureset(std::string const& filename, mapnik::filter_in_box const& filter)
|
geojson_index_featureset::geojson_index_featureset(std::string const& filename, mapnik::filter_in_box const& filter)
|
||||||
:
|
:
|
||||||
#if defined(GEOJSON_MEMORY_MAPPED_FILE)
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
//
|
//
|
||||||
#elif defined _WINDOWS
|
#elif defined _WINDOWS
|
||||||
file_(_wfopen(mapnik::utf8_to_utf16(filename).c_str(), L"rb"), std::fclose),
|
file_(_wfopen(mapnik::utf8_to_utf16(filename).c_str(), L"rb"), std::fclose),
|
||||||
|
@ -45,7 +45,7 @@ geojson_index_featureset::geojson_index_featureset(std::string const& filename,
|
||||||
ctx_(std::make_shared<mapnik::context_type>())
|
ctx_(std::make_shared<mapnik::context_type>())
|
||||||
{
|
{
|
||||||
|
|
||||||
#if defined (GEOJSON_MEMORY_MAPPED_FILE)
|
#if defined (MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
boost::optional<mapnik::mapped_region_ptr> memory =
|
boost::optional<mapnik::mapped_region_ptr> memory =
|
||||||
mapnik::mapped_memory_cache::instance().find(filename, true);
|
mapnik::mapped_memory_cache::instance().find(filename, true);
|
||||||
if (memory)
|
if (memory)
|
||||||
|
@ -78,7 +78,7 @@ mapnik::feature_ptr geojson_index_featureset::next()
|
||||||
while( itr_ != positions_.end())
|
while( itr_ != positions_.end())
|
||||||
{
|
{
|
||||||
auto pos = *itr_++;
|
auto pos = *itr_++;
|
||||||
#if defined(GEOJSON_MEMORY_MAPPED_FILE)
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
char const* start = (char const*)mapped_region_->get_address() + pos.first;
|
char const* start = (char const*)mapped_region_->get_address() + pos.first;
|
||||||
char const* end = start + pos.second;
|
char const* end = start + pos.second;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -23,13 +23,11 @@
|
||||||
#ifndef GEOJSON_INDEX_FEATURESET_HPP
|
#ifndef GEOJSON_INDEX_FEATURESET_HPP
|
||||||
#define GEOJSON_INDEX_FEATURESET_HPP
|
#define GEOJSON_INDEX_FEATURESET_HPP
|
||||||
|
|
||||||
#define GEOJSON_MEMORY_MAPPED_FILE
|
|
||||||
|
|
||||||
#include "geojson_datasource.hpp"
|
#include "geojson_datasource.hpp"
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/geom_util.hpp>
|
#include <mapnik/geom_util.hpp>
|
||||||
|
|
||||||
#ifdef GEOJSON_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wshadow"
|
#pragma GCC diagnostic ignored "-Wshadow"
|
||||||
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
||||||
|
@ -51,7 +49,7 @@ public:
|
||||||
mapnik::feature_ptr next();
|
mapnik::feature_ptr next();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#if defined (GEOJSON_MEMORY_MAPPED_FILE)
|
#if defined (MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
using file_source_type = boost::interprocess::ibufferstream;
|
using file_source_type = boost::interprocess::ibufferstream;
|
||||||
mapnik::mapped_region_ptr mapped_region_;
|
mapnik::mapped_region_ptr mapped_region_;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include <mapnik/geometry_correct.hpp>
|
#include <mapnik/geometry_correct.hpp>
|
||||||
|
|
||||||
// boost
|
// boost
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
#include <mapnik/mapped_memory_cache.hpp>
|
#include <mapnik/mapped_memory_cache.hpp>
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wshadow"
|
#pragma GCC diagnostic ignored "-Wshadow"
|
||||||
|
@ -72,7 +72,7 @@ ogr_index_featureset<filterT>::ogr_index_featureset(mapnik::context_ptr const &
|
||||||
feature_envelope_()
|
feature_envelope_()
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
boost::optional<mapnik::mapped_region_ptr> memory = mapnik::mapped_memory_cache::instance().find(index_file, true);
|
boost::optional<mapnik::mapped_region_ptr> memory = mapnik::mapped_memory_cache::instance().find(index_file, true);
|
||||||
if (memory)
|
if (memory)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||||
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
||||||
#include <boost/spirit/include/qi.hpp>
|
#include <boost/spirit/include/qi.hpp>
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
#include <boost/interprocess/mapped_region.hpp>
|
#include <boost/interprocess/mapped_region.hpp>
|
||||||
#include <mapnik/mapped_memory_cache.hpp>
|
#include <mapnik/mapped_memory_cache.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
@ -58,7 +58,7 @@ dbf_file::dbf_file(std::string const& file_name)
|
||||||
:num_records_(0),
|
:num_records_(0),
|
||||||
num_fields_(0),
|
num_fields_(0),
|
||||||
record_length_(0),
|
record_length_(0),
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
file_(),
|
file_(),
|
||||||
#elif defined(_WINDOWS)
|
#elif defined(_WINDOWS)
|
||||||
file_(mapnik::utf8_to_utf16(file_name), std::ios::in | std::ios::binary),
|
file_(mapnik::utf8_to_utf16(file_name), std::ios::in | std::ios::binary),
|
||||||
|
@ -68,7 +68,7 @@ dbf_file::dbf_file(std::string const& file_name)
|
||||||
record_(0)
|
record_(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
boost::optional<mapnik::mapped_region_ptr> memory = mapnik::mapped_memory_cache::instance().find(file_name,true);
|
boost::optional<mapnik::mapped_region_ptr> memory = mapnik::mapped_memory_cache::instance().find(file_name,true);
|
||||||
if (memory)
|
if (memory)
|
||||||
{
|
{
|
||||||
|
@ -95,7 +95,7 @@ dbf_file::~dbf_file()
|
||||||
|
|
||||||
bool dbf_file::is_open()
|
bool dbf_file::is_open()
|
||||||
{
|
{
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
return (file_.buffer().second > 0);
|
return (file_.buffer().second > 0);
|
||||||
#else
|
#else
|
||||||
return file_.is_open();
|
return file_.is_open();
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include <mapnik/feature.hpp>
|
#include <mapnik/feature.hpp>
|
||||||
#include <mapnik/util/noncopyable.hpp>
|
#include <mapnik/util/noncopyable.hpp>
|
||||||
#include <mapnik/unicode.hpp>
|
#include <mapnik/unicode.hpp>
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
#include <mapnik/mapped_memory_cache.hpp>
|
#include <mapnik/mapped_memory_cache.hpp>
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wshadow"
|
#pragma GCC diagnostic ignored "-Wshadow"
|
||||||
|
@ -59,7 +59,7 @@ private:
|
||||||
int num_fields_;
|
int num_fields_;
|
||||||
std::size_t record_length_;
|
std::size_t record_length_;
|
||||||
std::vector<field_descriptor> fields_;
|
std::vector<field_descriptor> fields_;
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
boost::interprocess::ibufferstream file_;
|
boost::interprocess::ibufferstream file_;
|
||||||
mapnik::mapped_region_ptr mapped_region_;
|
mapnik::mapped_region_ptr mapped_region_;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-local-typedef"
|
#pragma GCC diagnostic ignored "-Wunused-local-typedef"
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
#include <boost/interprocess/streams/bufferstream.hpp>
|
#include <boost/interprocess/streams/bufferstream.hpp>
|
||||||
#endif
|
#endif
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
@ -63,7 +63,7 @@ shape_index_featureset<filterT>::shape_index_featureset(filterT const& filter,
|
||||||
auto index = shape_ptr_->index();
|
auto index = shape_ptr_->index();
|
||||||
if (index)
|
if (index)
|
||||||
{
|
{
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
mapnik::util::spatial_index<int, filterT,boost::interprocess::ibufferstream>::query(filter, index->file(), offsets_);
|
mapnik::util::spatial_index<int, filterT,boost::interprocess::ibufferstream>::query(filter, index->file(), offsets_);
|
||||||
#else
|
#else
|
||||||
mapnik::util::spatial_index<int, filterT, std::ifstream>::query(filter, index->file(), offsets_);
|
mapnik::util::spatial_index<int, filterT, std::ifstream>::query(filter, index->file(), offsets_);
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include <mapnik/global.hpp>
|
#include <mapnik/global.hpp>
|
||||||
#include <mapnik/util/utf_conv_win.hpp>
|
#include <mapnik/util/utf_conv_win.hpp>
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wshadow"
|
#pragma GCC diagnostic ignored "-Wshadow"
|
||||||
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
||||||
|
@ -141,7 +141,7 @@ class shape_file : mapnik::util::noncopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
using file_source_type = boost::interprocess::ibufferstream;
|
using file_source_type = boost::interprocess::ibufferstream;
|
||||||
using record_type = shape_record<MappedRecordTag>;
|
using record_type = shape_record<MappedRecordTag>;
|
||||||
mapnik::mapped_region_ptr mapped_region_;
|
mapnik::mapped_region_ptr mapped_region_;
|
||||||
|
@ -155,7 +155,7 @@ public:
|
||||||
shape_file() {}
|
shape_file() {}
|
||||||
|
|
||||||
shape_file(std::string const& file_name) :
|
shape_file(std::string const& file_name) :
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
file_()
|
file_()
|
||||||
#elif defined (_WINDOWS)
|
#elif defined (_WINDOWS)
|
||||||
file_(mapnik::utf8_to_utf16(file_name), std::ios::in | std::ios::binary)
|
file_(mapnik::utf8_to_utf16(file_name), std::ios::in | std::ios::binary)
|
||||||
|
@ -163,7 +163,7 @@ public:
|
||||||
file_(file_name.c_str(), std::ios::in | std::ios::binary)
|
file_(file_name.c_str(), std::ios::in | std::ios::binary)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
boost::optional<mapnik::mapped_region_ptr> memory =
|
boost::optional<mapnik::mapped_region_ptr> memory =
|
||||||
mapnik::mapped_memory_cache::instance().find(file_name,true);
|
mapnik::mapped_memory_cache::instance().find(file_name,true);
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ public:
|
||||||
|
|
||||||
inline bool is_open() const
|
inline bool is_open() const
|
||||||
{
|
{
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
return (file_.buffer().second > 0);
|
return (file_.buffer().second > 0);
|
||||||
#else
|
#else
|
||||||
return file_.is_open();
|
return file_.is_open();
|
||||||
|
@ -197,7 +197,7 @@ public:
|
||||||
|
|
||||||
inline void read_record(record_type& rec)
|
inline void read_record(record_type& rec)
|
||||||
{
|
{
|
||||||
#ifdef SHAPE_MEMORY_MAPPED_FILE
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
rec.set_data(file_.buffer().first + file_.tellg());
|
rec.set_data(file_.buffer().first + file_.tellg());
|
||||||
file_.seekg(rec.size, std::ios::cur);
|
file_.seekg(rec.size, std::ios::cur);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#if defined(SHAPE_MEMORY_MAPPED_FILE)
|
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
|
||||||
|
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/debug.hpp>
|
#include <mapnik/debug.hpp>
|
||||||
|
|
Loading…
Reference in a new issue