[mapnik] 01/04: Imported Upstream version 3.0.9+ds
Sebastiaan Couwenberg
sebastic at moszumanska.debian.org
Thu Nov 26 21:41:03 UTC 2015
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch master
in repository mapnik.
commit ff1aee446eb7e8ee26e1e79bb8543ebf0496e025
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Thu Nov 26 21:08:02 2015 +0100
Imported Upstream version 3.0.9+ds
---
CHANGELOG.md | 9 +++++--
test/unit/datasource/geojson.cpp | 58 +++++++++++++++++++++++++++++++++++++++-
2 files changed, 64 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d33353a..c6114f8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,9 +8,9 @@ For a complete change history, see the git log.
## 3.0.9
-Released:
+Released: November 26, 2015
-(Work-in-progress)
+(Packaged from 03a0926)
#### Summary
@@ -24,7 +24,12 @@ Released:
- JSON parsing: unified error_handler across all grammars
- Improved unit test coverage
- Raster scaling: fixed nodata handling, acurracy when working with small floats and clipping floats by \[0; 255\] (https://github.com/mapnik/mapnik/pull/3147)
+ - Added [`code of conduct`](http://contributor-covenant.org)
+ - GeoJSON plug-in is updated to skip feature with empty geometries
+ - GeoJSON plug-in : ensure original order of features is preserved (fixed) (https://github.com/mapnik/mapnik/issues/3182)
+ - Shapeindex utility: fixed `empty` shapes handling and ported tests to c++
- Centroid algorithm: fixed invalid input handling, particularly empty geometries (https://github.com/mapnik/mapnik/pull/3185)
+ - Updated SCons build system to the latest version 2.4.1 (http://scons.org/)
## 3.0.8
diff --git a/test/unit/datasource/geojson.cpp b/test/unit/datasource/geojson.cpp
index ad1f2d9..d27347c 100644
--- a/test/unit/datasource/geojson.cpp
+++ b/test/unit/datasource/geojson.cpp
@@ -503,7 +503,7 @@ TEST_CASE("geojson") {
for (auto cache_features : {true,false})
{
- params["cache_features"] = false;
+ params["cache_features"] = cache_features;
auto ds = mapnik::datasource_cache::instance().create(params);
auto fields = ds->get_descriptor().get_descriptors();
mapnik::query query(ds->envelope());
@@ -573,5 +573,61 @@ TEST_CASE("geojson") {
}
}
}
+
+ SECTION("GeoJSON ensure original feature ordering is preserved")
+ {
+ mapnik::parameters params;
+ params["type"] = "geojson";
+
+ std::string filename("./test/data/json/ordered.json");
+ params["file"] = filename;
+
+ // cleanup in the case of a failed previous run
+ if (mapnik::util::exists(filename + ".index"))
+ {
+ mapnik::util::remove(filename + ".index");
+ }
+
+ for (auto create_index : { true, false })
+ {
+ if (create_index)
+ {
+ CHECK(!mapnik::util::exists(filename + ".index"));
+ int ret = create_disk_index(filename);
+ int ret_posix = (ret >> 8) & 0x000000ff;
+ INFO(ret);
+ INFO(ret_posix);
+ CHECK(mapnik::util::exists(filename + ".index"));
+ }
+
+ for (auto cache_features : {true, false})
+ {
+ params["cache_features"] = cache_features;
+ auto ds = mapnik::datasource_cache::instance().create(params);
+ REQUIRE(bool(ds));
+ auto fields = ds->get_descriptor().get_descriptors();
+ mapnik::query query(ds->envelope());
+ for (auto const& field : fields)
+ {
+ query.add_property_name(field.get_name());
+ }
+ auto features = ds->features(query);
+ auto feature = features->next();
+ mapnik::value_integer count = 0;
+ while (feature != nullptr)
+ {
+ // ids are in ascending order, starting from 1
+ mapnik::value val= feature->get("id");
+ REQUIRE(val.get<mapnik::value_integer>() == ++count);
+ feature = features->next();
+ }
+ }
+ // cleanup
+ if (create_index && mapnik::util::exists(filename + ".index"))
+ {
+ mapnik::util::remove(filename + ".index");
+ }
+ }
+ }
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/mapnik.git
More information about the Pkg-grass-devel
mailing list