Merge branch 'master' into svg-parser-errors
This commit is contained in:
commit
42c8da72e9
34 changed files with 116 additions and 75 deletions
2
.gitmodules
vendored
2
.gitmodules
vendored
|
@ -5,4 +5,4 @@
|
|||
[submodule "test/data-visual"]
|
||||
path = test/data-visual
|
||||
url = https://github.com/mapnik/test-data-visual.git
|
||||
branch = master
|
||||
branch = master
|
17
CHANGELOG.md
17
CHANGELOG.md
|
@ -6,10 +6,25 @@ Developers: Please commit along with changes.
|
|||
|
||||
For a complete change history, see the git log.
|
||||
|
||||
## Future
|
||||
## 3.0.1
|
||||
|
||||
Released: July 27th, 2015
|
||||
|
||||
(Packaged from 28f6f4d)
|
||||
|
||||
#### Summary
|
||||
|
||||
The 3.0.1 fixes a few bugs in geojson parsing, svg parsing, and rendering. It also avoids a potential hang when using `line-geometry-transform` and includes a speedup for text rendering compared to v3.0.0. It is fully back compatibility with v3.0.0 and everyone is encouraged to upgrade.
|
||||
|
||||
- Fixed text placement performance after #2949 (#2963)
|
||||
- Fixed rendering behavior for `text-minimum-path-length` which regressed in 3.0.0 (#2990)
|
||||
- Fixed handling of `xml:id` in SVG parsing (#2989)
|
||||
- Fixed handling of out of range `rx` and `ry` in SVG `rect` (#2991)
|
||||
- Fixed reporting of envelope from `mapnik::memory_datasource` when new features are added (#2985)
|
||||
- Fixed parsing of GeoJSON when unknown properties encountered at `FeatureCollection` level (#2983)
|
||||
- Fixed parsing of GeoJSON when properties contained `{}` (#2964)
|
||||
- Fixed potential hang due to invalid use of `line-geometry-transform` (6d6cb15)
|
||||
- Moved unmaintained plugins out of core: `osm`, `occi`, and `rasterlite` (#2980)
|
||||
|
||||
## 3.0.0
|
||||
|
||||
|
|
19
Makefile
19
Makefile
|
@ -12,6 +12,25 @@ all: mapnik
|
|||
install:
|
||||
$(PYTHON) scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 install
|
||||
|
||||
release:
|
||||
export MAPNIK_VERSION=$(shell ./utils/mapnik-config/mapnik-config --version) && \
|
||||
export TARBALL_NAME="mapnik-v$${MAPNIK_VERSION}" && \
|
||||
cd /tmp/ && \
|
||||
rm -rf $${TARBALL_NAME} && \
|
||||
git clone --depth 1 --branch v$${MAPNIK_VERSION} git@github.com:mapnik/mapnik.git $${TARBALL_NAME} && \
|
||||
cd $${TARBALL_NAME} && \
|
||||
git checkout "tags/v$${MAPNIK_VERSION}" && \
|
||||
git submodule update --depth 1 --init && \
|
||||
rm -rf test/data/.git && \
|
||||
rm -rf test/data/.gitignore && \
|
||||
rm -rf test/data-visual/.git && \
|
||||
rm -rf test/data-visual/.gitignore && \
|
||||
rm -rf .git && \
|
||||
rm -rf .gitignore && \
|
||||
cd ../ && \
|
||||
tar cjf $${TARBALL_NAME}.tar.bz2 $${TARBALL_NAME}/ && \
|
||||
aws s3 cp --acl public-read $${TARBALL_NAME}.tar.bz2 s3://mapnik/dist/v$${MAPNIK_VERSION}/
|
||||
|
||||
python:
|
||||
if [ ! -d ./bindings/python ]; then git clone git@github.com:mapnik/python-mapnik.git --recursive ./bindings/python; else (cd bindings/python && git pull && git submodule update --init); fi;
|
||||
make
|
||||
|
|
|
@ -1897,6 +1897,8 @@ if not HELP_REQUESTED:
|
|||
# Build the requested and able-to-be-compiled input plug-ins
|
||||
GDAL_BUILT = False
|
||||
OGR_BUILT = False
|
||||
POSTGIS_BUILT = False
|
||||
PGRASTER_BUILT = False
|
||||
for plugin in env['PLUGINS']:
|
||||
if env['PLUGIN_LINKING'] == 'static' or plugin not in env['REQUESTED_PLUGINS']:
|
||||
if os.path.exists('plugins/input/%s.input' % plugin):
|
||||
|
@ -1906,11 +1908,17 @@ if not HELP_REQUESTED:
|
|||
if details['lib'] in env['LIBS']:
|
||||
if env['PLUGIN_LINKING'] == 'shared':
|
||||
SConscript('plugins/input/%s/build.py' % plugin)
|
||||
# hack to avoid breaking on plugins with the same dep
|
||||
if plugin == 'ogr': OGR_BUILT = True
|
||||
if plugin == 'gdal': GDAL_BUILT = True
|
||||
if plugin == 'postgis': POSTGIS_BUILT = True
|
||||
if plugin == 'pgraster': PGRASTER_BUILT = True
|
||||
if plugin == 'ogr' or plugin == 'gdal':
|
||||
if GDAL_BUILT and OGR_BUILT:
|
||||
env['LIBS'].remove(details['lib'])
|
||||
elif plugin == 'postgis' or plugin == 'pgraster':
|
||||
if POSTGIS_BUILT and PGRASTER_BUILT:
|
||||
env['LIBS'].remove(details['lib'])
|
||||
else:
|
||||
env['LIBS'].remove(details['lib'])
|
||||
elif not details['lib']:
|
||||
|
|
|
@ -23,13 +23,21 @@
|
|||
// mapnik
|
||||
#include <mapnik/json/geometry_generator_grammar.hpp>
|
||||
#include <mapnik/util/spirit_transform_attribute.hpp>
|
||||
#include <mapnik/geometry_types.hpp>
|
||||
|
||||
// boost
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#pragma GCC diagnostic ignored "-Wunused-local-typedef"
|
||||
#pragma GCC diagnostic ignored "-Wshadow"
|
||||
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
||||
#pragma GCC diagnostic ignored "-Wconversion"
|
||||
#include <boost/spirit/include/karma.hpp>
|
||||
#include <boost/spirit/include/phoenix.hpp>
|
||||
#include <boost/spirit/include/phoenix_core.hpp>
|
||||
#include <boost/spirit/include/phoenix_fusion.hpp>
|
||||
#include <boost/fusion/include/at.hpp>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
namespace mapnik { namespace json {
|
||||
|
||||
|
|
|
@ -212,12 +212,18 @@ public:
|
|||
|
||||
void insert(box2d<double> const& box)
|
||||
{
|
||||
tree_.insert(label(box), box);
|
||||
if (tree_.extent().intersects(box))
|
||||
{
|
||||
tree_.insert(label(box), box);
|
||||
}
|
||||
}
|
||||
|
||||
void insert(box2d<double> const& box, mapnik::value_unicode_string const& text)
|
||||
{
|
||||
tree_.insert(label(box, text), box);
|
||||
if (tree_.extent().intersects(box))
|
||||
{
|
||||
tree_.insert(label(box, text), box);
|
||||
}
|
||||
}
|
||||
|
||||
void clear()
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <mapnik/pixel_position.hpp>
|
||||
#include <mapnik/text/rotation.hpp>
|
||||
#include <mapnik/marker_cache.hpp>
|
||||
#include <mapnik/text/glyph_info.hpp>
|
||||
|
||||
// agg
|
||||
#include "agg_trans_affine.h"
|
||||
|
@ -37,8 +38,6 @@
|
|||
namespace mapnik
|
||||
{
|
||||
|
||||
struct glyph_info;
|
||||
|
||||
struct glyph_position
|
||||
{
|
||||
glyph_position(glyph_info const& _glyph, pixel_position const& _pos, rotation const& _rot)
|
||||
|
|
|
@ -72,7 +72,7 @@ struct MAPNIK_DECL text_item : util::noncopyable
|
|||
// - format
|
||||
// - script (http://en.wikipedia.org/wiki/Scripts_in_Unicode)
|
||||
|
||||
class MAPNIK_DECL text_itemizer
|
||||
class MAPNIK_DECL text_itemizer : util::noncopyable
|
||||
{
|
||||
public:
|
||||
text_itemizer();
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include <mapnik/box2d.hpp>
|
||||
#include <mapnik/pixel_position.hpp>
|
||||
#include <mapnik/text/text_layout.hpp>
|
||||
#include <mapnik/text/placements/base.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
#include <mapnik/text/rotation.hpp>
|
||||
#include <mapnik/util/noncopyable.hpp>
|
||||
|
|
|
@ -19,23 +19,19 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*****************************************************************************/
|
||||
//mapnik
|
||||
#include <mapnik/debug.hpp>
|
||||
#include <mapnik/label_collision_detector.hpp>
|
||||
#include <mapnik/view_transform.hpp>
|
||||
#include <mapnik/expression_evaluator.hpp>
|
||||
|
||||
// mapnik
|
||||
//#include <mapnik/label_collision_detector.hpp>
|
||||
//#include <mapnik/view_transform.hpp>
|
||||
#include <mapnik/text/placement_finder.hpp>
|
||||
#include <mapnik/text/text_layout.hpp>
|
||||
#include <mapnik/text/text_properties.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
//#include <mapnik/text/glyph_positions.hpp>
|
||||
#include <mapnik/vertex_cache.hpp>
|
||||
#include <mapnik/tolerance_iterator.hpp>
|
||||
#include <mapnik/symbolizer_enumerations.hpp>
|
||||
|
||||
// agg
|
||||
#include "agg_conv_clip_polyline.h"
|
||||
|
||||
// stl
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
|
|
@ -22,10 +22,13 @@
|
|||
#ifndef SYMBOLIZER_HELPERS_HPP
|
||||
#define SYMBOLIZER_HELPERS_HPP
|
||||
|
||||
//mapnik
|
||||
// mapnik
|
||||
#include <mapnik/text/placement_finder.hpp>
|
||||
#include <mapnik/text/placements/base.hpp>
|
||||
#include <mapnik/vertex_converters.hpp>
|
||||
#include <mapnik/geometry.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
#include <mapnik/text/text_properties.hpp>
|
||||
|
||||
namespace mapnik {
|
||||
|
||||
|
|
|
@ -26,12 +26,11 @@
|
|||
#include <vector>
|
||||
#include <mapnik/util/noncopyable.hpp>
|
||||
#include <mapnik/config.hpp>
|
||||
#include <mapnik/text/glyph_info.hpp>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
||||
struct glyph_info;
|
||||
|
||||
// This class stores all glyphs of a line in left to right order.
|
||||
// It can be used for rendering but no text processing (like line breaking)
|
||||
// should be done!
|
||||
|
@ -98,6 +97,6 @@ private:
|
|||
unsigned space_count_;
|
||||
};
|
||||
|
||||
} //namespace mapnik
|
||||
} // namespace mapnik
|
||||
|
||||
#endif // MAPNIK_TEXT_LINE_HPP
|
||||
|
|
|
@ -24,6 +24,20 @@
|
|||
#define MAPNIK_UTIL_SPIRIT_TRANSFORM_ATTRIBUTE_HPP
|
||||
|
||||
#include <mapnik/geometry.hpp>
|
||||
#include <mapnik/util/variant.hpp>
|
||||
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
|
||||
// boost
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#pragma GCC diagnostic ignored "-Wunused-local-typedef"
|
||||
#pragma GCC diagnostic ignored "-Wshadow"
|
||||
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
||||
#pragma GCC diagnostic ignored "-Wconversion"
|
||||
#include <boost/spirit/include/karma.hpp>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
namespace boost { namespace spirit { namespace traits {
|
||||
|
||||
|
|
|
@ -23,13 +23,13 @@
|
|||
#ifndef MAPNIK_VERSION_HPP
|
||||
#define MAPNIK_VERSION_HPP
|
||||
|
||||
#define MAPNIK_VERSION_IS_RELEASE 1
|
||||
#define MAPNIK_VERSION_IS_RELEASE 0
|
||||
|
||||
#define MAPNIK_MAJOR_VERSION 3
|
||||
#define MAPNIK_MINOR_VERSION 0
|
||||
#define MAPNIK_PATCH_VERSION 0
|
||||
#define MAPNIK_PATCH_VERSION 1
|
||||
|
||||
// translates to 300000
|
||||
// translates to 300001
|
||||
#define MAPNIK_VERSION (MAPNIK_MAJOR_VERSION*100000) + (MAPNIK_MINOR_VERSION*100) + (MAPNIK_PATCH_VERSION)
|
||||
|
||||
#ifndef MAPNIK_STRINGIFY
|
||||
|
|
|
@ -8,6 +8,7 @@ else
|
|||
fi
|
||||
|
||||
export PATH=$(pwd)/utils/nik2img/:${PATH}
|
||||
export PATH=$(pwd)/utils/mapnik-config/:${PATH}
|
||||
|
||||
# mapnik-settings.env is an optional file to store
|
||||
# environment variables that should be used before
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <mapnik/geom_util.hpp>
|
||||
#include <mapnik/symbolizer.hpp>
|
||||
#include <mapnik/pixel_position.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
#include <mapnik/renderer_common/process_group_symbolizer.hpp>
|
||||
#include <mapnik/renderer_common/clipping_extent.hpp>
|
||||
#include <mapnik/svg/svg_renderer_agg.hpp>
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
#include "agg_span_allocator.h"
|
||||
#include "agg_span_pattern_rgba.h"
|
||||
#include "agg_renderer_outline_image.h"
|
||||
#include "agg_conv_clip_polyline.h"
|
||||
|
||||
namespace mapnik {
|
||||
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
#include "agg_rasterizer_scanline_aa.h"
|
||||
#include "agg_scanline_u.h"
|
||||
#include "agg_path_storage.h"
|
||||
#include "agg_conv_clip_polyline.h"
|
||||
#include "agg_conv_transform.h"
|
||||
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <mapnik/text/symbolizer_helpers.hpp>
|
||||
#include <mapnik/pixel_position.hpp>
|
||||
#include <mapnik/text/renderer.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
#include <mapnik/renderer_common/clipping_extent.hpp>
|
||||
|
||||
namespace mapnik {
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <mapnik/agg_rasterizer.hpp>
|
||||
#include <mapnik/text/symbolizer_helpers.hpp>
|
||||
#include <mapnik/text/renderer.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
#include <mapnik/renderer_common/clipping_extent.hpp>
|
||||
|
||||
namespace mapnik {
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <mapnik/marker.hpp>
|
||||
#include <mapnik/svg/svg_path_adapter.hpp>
|
||||
#include <mapnik/make_unique.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
#include <mapnik/cairo/cairo_renderer.hpp>
|
||||
#include <mapnik/cairo/cairo_render_vector.hpp>
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <mapnik/text/symbolizer_helpers.hpp>
|
||||
#include <mapnik/pixel_position.hpp>
|
||||
#include <mapnik/symbolizer.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <mapnik/text/placement_finder.hpp>
|
||||
#include <mapnik/text/symbolizer_helpers.hpp>
|
||||
#include <mapnik/text/renderer.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
#include <mapnik/svg/svg_renderer_agg.hpp>
|
||||
#include <mapnik/svg/svg_storage.hpp>
|
||||
#include <mapnik/svg/svg_path_adapter.hpp>
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <mapnik/text/symbolizer_helpers.hpp>
|
||||
#include <mapnik/pixel_position.hpp>
|
||||
#include <mapnik/text/renderer.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
|
||||
// agg
|
||||
#include "agg_trans_affine.h"
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <mapnik/text/symbolizer_helpers.hpp>
|
||||
#include <mapnik/pixel_position.hpp>
|
||||
#include <mapnik/text/renderer.hpp>
|
||||
#include <mapnik/text/glyph_positions.hpp>
|
||||
#include <mapnik/renderer_common/clipping_extent.hpp>
|
||||
|
||||
namespace mapnik {
|
||||
|
|
|
@ -34,9 +34,6 @@
|
|||
#include <mapnik/vertex_cache.hpp>
|
||||
#include <mapnik/tolerance_iterator.hpp>
|
||||
|
||||
//agg
|
||||
#include "agg_conv_clip_polyline.h"
|
||||
|
||||
namespace mapnik { namespace detail {
|
||||
|
||||
template <typename Helper>
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <mapnik/view_transform.hpp>
|
||||
#include <mapnik/expression_evaluator.hpp>
|
||||
#include <mapnik/text/placement_finder_impl.hpp>
|
||||
#include <mapnik/text/placements/base.hpp>
|
||||
#include <mapnik/text/text_layout.hpp>
|
||||
#include <mapnik/text/glyph_info.hpp>
|
||||
#include <mapnik/text/text_properties.hpp>
|
||||
|
@ -32,9 +33,6 @@
|
|||
#include <mapnik/vertex_cache.hpp>
|
||||
#include <mapnik/util/math.hpp>
|
||||
|
||||
// agg
|
||||
#include "agg_conv_clip_polyline.h"
|
||||
|
||||
// stl
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -41,8 +41,6 @@
|
|||
#include <mapnik/text/placements/base.hpp>
|
||||
#include <mapnik/text/placements/dummy.hpp>
|
||||
|
||||
//agg
|
||||
#include "agg_conv_clip_polyline.h"
|
||||
|
||||
namespace mapnik { namespace detail {
|
||||
|
||||
|
@ -79,11 +77,10 @@ struct split_multi_geometries
|
|||
{
|
||||
using container_type = T;
|
||||
split_multi_geometries(container_type & cont, view_transform const& t,
|
||||
proj_transform const& prj_trans, double minimum_path_length)
|
||||
proj_transform const& prj_trans)
|
||||
: cont_(cont),
|
||||
t_(t),
|
||||
prj_trans_(prj_trans),
|
||||
minimum_path_length_(minimum_path_length) {}
|
||||
prj_trans_(prj_trans) { }
|
||||
|
||||
void operator() (geometry::geometry_empty const&) const {}
|
||||
void operator() (geometry::multi_point<double> const& multi_pt) const
|
||||
|
@ -95,18 +92,7 @@ struct split_multi_geometries
|
|||
}
|
||||
void operator() (geometry::line_string<double> const& line) const
|
||||
{
|
||||
if (minimum_path_length_ > 0)
|
||||
{
|
||||
box2d<double> bbox = t_.forward(geometry::envelope(line), prj_trans_);
|
||||
if (bbox.width() >= minimum_path_length_)
|
||||
{
|
||||
cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(line)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(line)));
|
||||
}
|
||||
cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(line)));
|
||||
}
|
||||
|
||||
void operator() (geometry::multi_line_string<double> const& multi_line) const
|
||||
|
@ -119,18 +105,7 @@ struct split_multi_geometries
|
|||
|
||||
void operator() (geometry::polygon<double> const& poly) const
|
||||
{
|
||||
if (minimum_path_length_ > 0)
|
||||
{
|
||||
box2d<double> bbox = t_.forward(geometry::envelope(poly), prj_trans_);
|
||||
if (bbox.width() >= minimum_path_length_)
|
||||
{
|
||||
cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(poly)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(poly)));
|
||||
}
|
||||
cont_.push_back(base_symbolizer_helper::geometry_cref(std::cref(poly)));
|
||||
}
|
||||
|
||||
void operator() (geometry::multi_polygon<double> const& multi_poly) const
|
||||
|
@ -158,7 +133,6 @@ struct split_multi_geometries
|
|||
container_type & cont_;
|
||||
view_transform const& t_;
|
||||
proj_transform const& prj_trans_;
|
||||
double minimum_path_length_;
|
||||
};
|
||||
|
||||
} // ns detail
|
||||
|
@ -207,10 +181,9 @@ struct largest_bbox_first
|
|||
|
||||
void base_symbolizer_helper::initialize_geometries() const
|
||||
{
|
||||
double minimum_path_length = text_props_->minimum_path_length;
|
||||
auto const& geom = feature_.get_geometry();
|
||||
util::apply_visitor(detail::split_multi_geometries<geometry_container_type>
|
||||
(geometries_to_process_, t_, prj_trans_, minimum_path_length ), geom);
|
||||
(geometries_to_process_, t_, prj_trans_), geom);
|
||||
if (!geometries_to_process_.empty())
|
||||
{
|
||||
auto type = geometry::geometry_type(geom);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 80c744348de8cb03a519e451129a243610e55f52
|
||||
Subproject commit e3d79ed493485afbb5c79cd90913c8db488561b6
|
|
@ -23,7 +23,6 @@ SECTION("layers") {
|
|||
std::string shape_plugin("./plugins/input/shape.input");
|
||||
if (mapnik::util::exists(shape_plugin))
|
||||
{
|
||||
mapnik::datasource_cache::instance().register_datasources("plugins/input/shape.input");
|
||||
mapnik::parameters p;
|
||||
p["type"]="shape";
|
||||
p["file"]="demo/data/boundaries";
|
||||
|
|
|
@ -62,7 +62,6 @@ SECTION("handling") {
|
|||
std::string csv_plugin("./plugins/input/csv.input");
|
||||
if (mapnik::util::exists(csv_plugin)) {
|
||||
try {
|
||||
mapnik::datasource_cache::instance().register_datasource(csv_plugin);
|
||||
mapnik::parameters p;
|
||||
p["type"]="csv";
|
||||
p["inline"]="x,y\n0,0";
|
||||
|
@ -88,7 +87,6 @@ SECTION("handling") {
|
|||
std::string shape_plugin("./plugins/input/shape.input");
|
||||
if (mapnik::util::exists(shape_plugin)) {
|
||||
try {
|
||||
mapnik::datasource_cache::instance().register_datasource(shape_plugin);
|
||||
mapnik::parameters p2;
|
||||
p2["type"]="shape";
|
||||
p2["file"]="foo";
|
||||
|
|
|
@ -33,7 +33,6 @@ TEST_CASE("geojson") {
|
|||
std::string geojson_plugin("./plugins/input/geojson.input");
|
||||
if (mapnik::util::exists(geojson_plugin))
|
||||
{
|
||||
mapnik::datasource_cache::instance().register_datasources("plugins/input/geojson.input");
|
||||
SECTION("json feature cache-feature=\"true\"")
|
||||
{
|
||||
// Create datasource
|
||||
|
@ -50,6 +49,7 @@ TEST_CASE("geojson") {
|
|||
query.add_property_name(field.get_name());
|
||||
}
|
||||
auto features = ds->features(query);
|
||||
REQUIRE(features != nullptr);
|
||||
auto feature = features->next();
|
||||
REQUIRE(feature != nullptr);
|
||||
}
|
||||
|
@ -69,11 +69,11 @@ TEST_CASE("geojson") {
|
|||
query.add_property_name(field.get_name());
|
||||
}
|
||||
auto features = ds->features(query);
|
||||
REQUIRE(features != nullptr);
|
||||
auto feature = features->next();
|
||||
REQUIRE(feature != nullptr);
|
||||
}
|
||||
|
||||
mapnik::datasource_cache::instance().register_datasources("plugins/input/geojson.input");
|
||||
SECTION("json extra properties cache-feature=\"true\"")
|
||||
{
|
||||
// Create datasource
|
||||
|
@ -90,12 +90,12 @@ TEST_CASE("geojson") {
|
|||
query.add_property_name(field.get_name());
|
||||
}
|
||||
auto features = ds->features(query);
|
||||
REQUIRE(features != nullptr);
|
||||
auto feature = features->next();
|
||||
REQUIRE(feature != nullptr);
|
||||
REQUIRE(feature->envelope() == mapnik::box2d<double>(123,456,123,456));
|
||||
}
|
||||
|
||||
mapnik::datasource_cache::instance().register_datasources("plugins/input/geojson.input");
|
||||
SECTION("json extra properties cache-feature=\"false\"")
|
||||
{
|
||||
// Create datasource
|
||||
|
@ -112,6 +112,7 @@ TEST_CASE("geojson") {
|
|||
query.add_property_name(field.get_name());
|
||||
}
|
||||
auto features = ds->features(query);
|
||||
REQUIRE(features != nullptr);
|
||||
auto feature = features->next();
|
||||
REQUIRE(feature != nullptr);
|
||||
REQUIRE(feature->envelope() == mapnik::box2d<double>(123,456,123,456));
|
||||
|
|
|
@ -21,8 +21,6 @@ SECTION("painting") {
|
|||
std::string csv_plugin("./plugins/input/csv.input");
|
||||
if (mapnik::util::exists(csv_plugin))
|
||||
{
|
||||
datasource_cache::instance().register_datasources(csv_plugin);
|
||||
|
||||
Map m(256, 256);
|
||||
|
||||
feature_type_style lines_style;
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
#define CATCH_CONFIG_RUNNER
|
||||
#include "catch.hpp"
|
||||
|
||||
#include <mapnik/datasource_cache.hpp>
|
||||
|
||||
#include "cleanup.hpp" // run_cleanup()
|
||||
|
||||
int main (int argc, char* const argv[])
|
||||
{
|
||||
mapnik::datasource_cache::instance().register_datasources("plugins/input/");
|
||||
|
||||
int result = Catch::Session().run( argc, argv );
|
||||
|
||||
testing::run_cleanup();
|
||||
|
|
Loading…
Reference in a new issue