Merge branch 'master' into geometry.hpp
This commit is contained in:
commit
c28bf77d5d
10 changed files with 69 additions and 37 deletions
1
.gitmodules
vendored
1
.gitmodules
vendored
|
@ -14,4 +14,3 @@
|
|||
path = deps/mapbox/geometry
|
||||
url = https://github.com/mapbox/geometry.hpp.git
|
||||
branch = master
|
||||
|
||||
|
|
14
Makefile
14
Makefile
|
@ -1,7 +1,5 @@
|
|||
OS := $(shell uname -s)
|
||||
|
||||
PYTHON = python
|
||||
|
||||
ifeq ($(JOBS),)
|
||||
JOBS:=1
|
||||
endif
|
||||
|
@ -21,11 +19,6 @@ release:
|
|||
test-release:
|
||||
./scripts/test_release.sh
|
||||
|
||||
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
|
||||
python bindings/python/test/visual.py -q
|
||||
|
||||
src/json/libmapnik-json.a:
|
||||
# we first build memory intensive files with -j$(HEAVY_JOBS)
|
||||
$(PYTHON) scons/scons.py -j$(HEAVY_JOBS) \
|
||||
|
@ -96,13 +89,6 @@ bench:
|
|||
demo:
|
||||
cd demo/c++; ./rundemo `mapnik-config --prefix`
|
||||
|
||||
pep8:
|
||||
# https://gist.github.com/1903033
|
||||
# gsed on osx
|
||||
@pep8 -r --select=W293 -q --filename=*.py `pwd`/tests/ | xargs gsed -i 's/^[ \r\t]*$$//'
|
||||
@pep8 -r --select=W391 -q --filename=*.py `pwd`/tests/ | xargs gsed -i -e :a -e '/^\n*$$/{$$d;N;ba' -e '}'
|
||||
@pep8 -r --select=W391 -q --filename=*.py `pwd`/tests/ | xargs ged -i '/./,/^$$/!d'
|
||||
|
||||
# note: pass --gen-suppressions=yes to create new suppression entries
|
||||
grind:
|
||||
@source localize.sh && \
|
||||
|
|
|
@ -46,6 +46,7 @@ BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(mapnik::geometry::line_string)
|
|||
BOOST_GEOMETRY_REGISTER_RING_TEMPLATED(mapnik::geometry::linear_ring)
|
||||
// needed by box2d<T>
|
||||
BOOST_GEOMETRY_REGISTER_POINT_2D(mapnik::coord2d, double, boost::geometry::cs::cartesian, x, y)
|
||||
BOOST_GEOMETRY_REGISTER_POINT_2D(mapnik::coord2f, float, boost::geometry::cs::cartesian, x, y)
|
||||
|
||||
namespace mapnik {
|
||||
|
||||
|
@ -137,6 +138,53 @@ struct indexed_access<mapnik::box2d<double>, max_corner, 1>
|
|||
static inline void set(mapnik::box2d<double> &b , ct const& value) { b.set_maxy(value); }
|
||||
};
|
||||
|
||||
<<<<<<< HEAD:include/mapnik/geometry/boost_adapters.hpp
|
||||
=======
|
||||
// box2d<float>
|
||||
template<> struct tag<mapnik::box2d<float> > { using type = box_tag; };
|
||||
template<> struct point_type<mapnik::box2d<float> > { using type = mapnik::coord2f; };
|
||||
|
||||
template <>
|
||||
struct indexed_access<mapnik::box2d<float>, min_corner, 0>
|
||||
{
|
||||
using ct = coordinate_type<mapnik::coord2f>::type;
|
||||
static inline ct get(mapnik::box2d<float> const& b) { return b.minx();}
|
||||
static inline void set(mapnik::box2d<float> &b, ct const& value) { b.set_minx(value); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct indexed_access<mapnik::box2d<float>, min_corner, 1>
|
||||
{
|
||||
using ct = coordinate_type<mapnik::coord2f>::type;
|
||||
static inline ct get(mapnik::box2d<float> const& b) { return b.miny();}
|
||||
static inline void set(mapnik::box2d<float> &b, ct const& value) { b.set_miny(value); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct indexed_access<mapnik::box2d<float>, max_corner, 0>
|
||||
{
|
||||
using ct = coordinate_type<mapnik::coord2f>::type;
|
||||
static inline ct get(mapnik::box2d<float> const& b) { return b.maxx();}
|
||||
static inline void set(mapnik::box2d<float> &b, ct const& value) { b.set_maxx(value); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct indexed_access<mapnik::box2d<float>, max_corner, 1>
|
||||
{
|
||||
using ct = coordinate_type<mapnik::coord2f>::type;
|
||||
static inline ct get(mapnik::box2d<float> const& b) { return b.maxy();}
|
||||
static inline void set(mapnik::box2d<float> &b , ct const& value) { b.set_maxy(value); }
|
||||
};
|
||||
|
||||
// mapnik::geometry::line_string
|
||||
template<typename CoordinateType>
|
||||
struct tag<mapnik::geometry::line_string<CoordinateType> >
|
||||
{
|
||||
using type = linestring_tag;
|
||||
};
|
||||
|
||||
// mapnik::geometry::polygon
|
||||
>>>>>>> master:include/mapnik/geometry/boost_adapters.hpp
|
||||
template<typename CoordinateType>
|
||||
struct tag<mapnik::geometry::polygon<CoordinateType> >
|
||||
{
|
||||
|
|
|
@ -20,14 +20,11 @@
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
// mapnik <mapnik/geometry_reprojection.hpp>
|
||||
// mapnik
|
||||
#include <mapnik/geometry/reprojection.hpp>
|
||||
#include <mapnik/geometry.hpp>
|
||||
|
||||
namespace mapnik {
|
||||
|
||||
namespace geometry {
|
||||
|
||||
namespace detail {
|
||||
namespace mapnik { namespace geometry { namespace detail {
|
||||
|
||||
//template <typename T>
|
||||
geometry_empty reproject_internal(geometry_empty const&, proj_transform const&, unsigned int &)
|
||||
|
@ -388,5 +385,4 @@ bool reproject(T & geom, projection const& source, projection const& dest)
|
|||
}
|
||||
|
||||
} // end geometry ns
|
||||
|
||||
} // end mapnik ns
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include <mapnik/json/geometry_generator_grammar.hpp>
|
||||
#include <mapnik/geometry/fusion_adapted.hpp>
|
||||
|
||||
|
||||
namespace mapnik { namespace json {
|
||||
|
||||
namespace karma = boost::spirit::karma;
|
||||
|
|
|
@ -80,7 +80,6 @@ x3::rule<class geometries, mapnik::geometry::geometry_collection<double> > const
|
|||
|
||||
auto const point_text_def = '(' > double_ > double_ > ')';
|
||||
auto const positions_def = lit('(') > (double_ > double_) % lit(',') > lit(')');
|
||||
//auto const polygon_rings_def = '(' > positions[set_exterior] > *(lit(',') > positions[add_hole]) > ')';
|
||||
auto const polygon_rings_def = '(' > positions[add_ring] % lit(',') > ')';
|
||||
auto const points_def = (lit('(') >> ((point_text_def % ',') > lit(')'))) | positions_def ;
|
||||
auto const lines_def = lit('(') > (positions_def % lit(',')) > lit(')');
|
||||
|
|
|
@ -38,7 +38,7 @@ plugin_env['LIBS'] = []
|
|||
plugin_env.Append(LIBS=env['PLUGINS']['gdal']['lib'])
|
||||
|
||||
if env['RUNTIME_LINK'] == 'static':
|
||||
cmd = 'gdal-config --dep-libs'
|
||||
cmd = '%s --dep-libs' % plugin_env['GDAL_CONFIG']
|
||||
plugin_env.ParseConfig(cmd)
|
||||
|
||||
# Link Library to Dependencies
|
||||
|
|
|
@ -42,7 +42,7 @@ plugin_env['LIBS'] = []
|
|||
plugin_env.Append(LIBS=env['PLUGINS']['ogr']['lib'])
|
||||
|
||||
if env['RUNTIME_LINK'] == 'static':
|
||||
cmd = 'gdal-config --dep-libs'
|
||||
cmd = '%s --dep-libs' % plugin_env['GDAL_CONFIG']
|
||||
plugin_env.ParseConfig(cmd)
|
||||
|
||||
# Link Library to Dependencies
|
||||
|
|
|
@ -26,7 +26,7 @@ function add() {
|
|||
CXX=${CXX:-clang++}
|
||||
|
||||
function compile() {
|
||||
${CXX} -o ${app} ${cpp} -Wpadded -I./ -isystem ./mason_packages/.link/include `mapnik-config --all-flags` -Ideps -Lsrc -Ideps/agg/include -Iinclude
|
||||
${CXX} -o ${app} ${cpp} -Wpadded -I./ -I./deps/mapbox/variant/include -isystem ./mason_packages/.link/include -std=c++11 -Ideps -Lsrc -Ideps/agg/include -Iinclude
|
||||
}
|
||||
|
||||
if [[ ${1:-unset} == "unset" ]] || [[ ${2:-unset} == "unset" ]] || [[ $@ == '-h' ]] || [[ $@ == '--help' ]]; then
|
||||
|
|
|
@ -39,6 +39,20 @@ source = Split(
|
|||
program_env['CXXFLAGS'] = copy(env['LIBMAPNIK_CXXFLAGS'])
|
||||
program_env['LINKFLAGS'] = copy(env['LIBMAPNIK_LINKFLAGS'])
|
||||
program_env.Append(CPPDEFINES = env['LIBMAPNIK_DEFINES'])
|
||||
program_env['LIBS'] = []
|
||||
|
||||
if env['RUNTIME_LINK'] == 'static':
|
||||
# pkg-config is more reliable than pg_config across platforms
|
||||
cmd = 'pkg-config libpq --libs --static'
|
||||
try:
|
||||
program_env.ParseConfig(cmd)
|
||||
except OSError, e:
|
||||
program_env.Append(LIBS='pq')
|
||||
else:
|
||||
program_env.Append(LIBS='pq')
|
||||
|
||||
# Link Library to Dependencies
|
||||
libraries = copy(program_env['LIBS'])
|
||||
|
||||
if env['HAS_CAIRO']:
|
||||
program_env.PrependUnique(CPPPATH=env['CAIRO_CPPPATHS'])
|
||||
|
@ -46,9 +60,8 @@ if env['HAS_CAIRO']:
|
|||
|
||||
program_env.PrependUnique(CPPPATH=['#plugins/input/postgis'])
|
||||
|
||||
libraries = []
|
||||
boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND']
|
||||
libraries.extend([boost_program_options,'sqlite3','pq',env['MAPNIK_NAME'],'icuuc'])
|
||||
libraries.extend([boost_program_options,'sqlite3',env['MAPNIK_NAME'],'icuuc'])
|
||||
|
||||
if env.get('BOOST_LIB_VERSION_FROM_HEADER'):
|
||||
boost_version_from_header = int(env['BOOST_LIB_VERSION_FROM_HEADER'].split('_')[1])
|
||||
|
@ -59,14 +72,6 @@ if env.get('BOOST_LIB_VERSION_FROM_HEADER'):
|
|||
if env['SQLITE_LINKFLAGS']:
|
||||
program_env.Append(LINKFLAGS=env['SQLITE_LINKFLAGS'])
|
||||
|
||||
if env['RUNTIME_LINK'] == 'static':
|
||||
if env['PLATFORM'] == 'Darwin':
|
||||
libraries.extend(['ldap', 'pam', 'ssl', 'crypto', 'krb5'])
|
||||
else:
|
||||
# TODO - parse back into libraries variable
|
||||
program_env.ParseConfig('pg_config --libs')
|
||||
libraries.append('dl')
|
||||
|
||||
pgsql2sqlite = program_env.Program('pgsql2sqlite', source, LIBS=libraries)
|
||||
Depends(pgsql2sqlite, env.subst('../../src/%s' % env['MAPNIK_LIB_NAME']))
|
||||
|
||||
|
|
Loading…
Reference in a new issue