Merge branch 'master' into geometry-refactor

This commit is contained in:
artemp 2016-04-29 10:47:43 +02:00
commit de927a1571
10 changed files with 126 additions and 109 deletions

View file

@ -98,7 +98,7 @@ Additional optional dependencies:
* PostgreSQL (for PostGIS plugin support)
- libpq - PostreSQL libraries
- pg_config - PostgreSQL installation capabilities
* libgdal - GDAL/OGR input (For gdal and ogr plugin support)
* libgdal - GDAL/OGR input (For gdal and ogr plugin support) (>= GDAL 2.0.2 for thread safety - https://github.com/mapnik/mapnik/issues/3339)
* libsqlite3 - SQLite input (needs RTree support builtin) (sqlite plugin support)
Instructions for installing many of these dependencies on

View file

@ -20,7 +20,7 @@ For further information see [http://mapnik.org](http://mapnik.org) and also our
# Installation
See [INSTALL.md](https://github.com/mapnik/mapnik/blob/master/INSTALL.md) for installation instructions and the [Install](https://github.com/mapnik/mapnik/wiki/Mapnik-Installation) page on the wiki for guides.
See [INSTALL.md](INSTALL.md) for installation instructions and the [Install](https://github.com/mapnik/mapnik/wiki/Mapnik-Installation) page on the wiki for guides.
# Code of Conduct

View file

@ -1451,6 +1451,7 @@ if not preconfigured:
# just turn it off like this, but seems the only available work-
# around. See https://svn.boost.org/trac/boost/ticket/6779 for more
# details.
if not env['HOST']:
boost_version = [int(x) for x in env.get('BOOST_LIB_VERSION_FROM_HEADER').split('_')]
if not conf.CheckBoostScopedEnum():
if boost_version < [1, 51]:

View file

@ -237,7 +237,7 @@ namespace agg
sl.reset_spans();
unsigned num_cells = m_outline.scanline_num_cells(m_scan_y);
const cell_aa* const* cells = m_outline.scanline_cells(m_scan_y);
int cover = 0;
unsigned cover = 0;
while(num_cells)
{
@ -507,4 +507,3 @@ namespace agg
#endif

View file

@ -69,15 +69,15 @@ public:
static void set_severity(severity_type severity_level)
{
//#ifdef MAPNIK_THREADSAFE
// std::lock_guard<std::mutex> lock(severity_mutex_);
//#endif
severity_level_ = severity_level;
}
// per object security levels
static severity_type get_object_severity(std::string const& object_name)
{
#ifdef MAPNIK_THREADSAFE
std::lock_guard<std::mutex> lock(severity_mutex_);
#endif
severity_map::iterator it = object_severity_level_.find(object_name);
if (object_name.empty() || it == object_severity_level_.end())
{

View file

@ -26,22 +26,20 @@
// mapnik
#include <mapnik/util/variant.hpp>
#include <mapnik/value_types.hpp>
// stl
#include <functional>
#pragma GCC diagnostic push
#include <mapnik/warning_ignore.hpp>
#include <unicode/unistr.h>
#pragma GCC diagnostic pop
namespace mapnik { namespace detail {
template <class T>
inline void hash_combine(std::size_t & seed, T const& v)
inline void hash_combine(std::size_t & seed, std::size_t val)
{
std::hash<T> hasher;
seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2);
seed ^= val + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
struct value_hasher
@ -56,6 +54,11 @@ struct value_hasher
return static_cast<std::size_t>(val.hashCode());
}
std::size_t operator()(value_integer val) const
{
return static_cast<std::size_t>(val);
}
template <class T>
std::size_t operator()(T const& val) const
{
@ -69,7 +72,8 @@ struct value_hasher
template <typename T>
std::size_t mapnik_hash_value(T const& val)
{
std::size_t seed = util::apply_visitor(detail::value_hasher(), val);
std::size_t seed = 0;
detail::hash_combine(seed, util::apply_visitor(detail::value_hasher(), val));
detail::hash_combine(seed, val.which());
return seed;
}

View file

@ -27,7 +27,7 @@
#define MAPNIK_MAJOR_VERSION 3
#define MAPNIK_MINOR_VERSION 0
#define MAPNIK_PATCH_VERSION 11
#define MAPNIK_PATCH_VERSION 12
#define MAPNIK_VERSION (MAPNIK_MAJOR_VERSION*100000) + (MAPNIK_MINOR_VERSION*100) + (MAPNIK_PATCH_VERSION)

View file

@ -16,6 +16,7 @@
#include <vector>
#include <fstream>
#if BOOST_VERSION >= 105800
namespace {
struct spatially_equal_visitor
@ -79,6 +80,7 @@ bool spatially_equal(mapnik::geometry::geometry<T> const& g0, mapnik::geometry::
}
}
#endif
TEST_CASE("Well-known-geometries")
{
@ -106,7 +108,9 @@ TEST_CASE("Well-known-geometries")
{
REQUIRE(wkt0 == wkt1);
// compare spatially (NOTE: GeometryCollection comparison also enforces strict order)
#if BOOST_VERSION >= 105800
REQUIRE(spatially_equal(geom_0, geom_1));
#endif
}
}
}

View file

@ -180,7 +180,11 @@ int main (int argc, char** argv)
{
std::clog << "processing '" << filename << "' as CSV\n";
auto result = mapnik::detail::process_csv_file(boxes, filename, manual_headers, separator, quote);
if (!result.first) continue;
if (!result.first)
{
std::clog << "Error: failed to process " << filename << std::endl;
return EXIT_FAILURE;
}
extent = result.second;
}
else if (mapnik::detail::is_geojson(filename))
@ -190,7 +194,7 @@ int main (int argc, char** argv)
if (!result.first)
{
std::clog << "Error: failed to process " << filename << std::endl;
continue;
return EXIT_FAILURE;
}
extent = result.second;
}
@ -224,6 +228,11 @@ int main (int argc, char** argv)
file.close();
}
}
else
{
std::clog << "Invalid extent " << extent << std::endl;
return EXIT_FAILURE;
}
}
std::clog << "done!" << std::endl;
return EXIT_SUCCESS;

View file

@ -21,7 +21,7 @@ int main (int argc,char** argv)
namespace po = boost::program_options;
bool verbose = false;
bool auto_open = true;
bool auto_open = false;
int return_value = 0;
std::string xml_file;
std::string img_file;
@ -37,7 +37,7 @@ int main (int argc,char** argv)
("help,h", "produce usage message")
("version,V","print version string")
("verbose,v","verbose output")
("open","automatically open the file after rendering (os x only)")
("open","automatically open the file after rendering")
("xml",po::value<std::string>(),"xml map to read")
("img",po::value<std::string>(),"image to render")
("scale-factor",po::value<double>(),"scale factor for rendering")