diff --git a/.gitmodules b/.gitmodules index 345b8a2aa..f674d341a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -14,4 +14,3 @@ path = deps/mapbox/geometry url = https://github.com/mapbox/geometry.hpp.git branch = master - diff --git a/Makefile b/Makefile index 090be8d5d..e3b4b53dc 100755 --- a/Makefile +++ b/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 && \ diff --git a/include/mapnik/geometry/boost_adapters.hpp b/include/mapnik/geometry/boost_adapters.hpp index c30143445..115cfa46a 100644 --- a/include/mapnik/geometry/boost_adapters.hpp +++ b/include/mapnik/geometry/boost_adapters.hpp @@ -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 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, max_corner, 1> static inline void set(mapnik::box2d &b , ct const& value) { b.set_maxy(value); } }; +<<<<<<< HEAD:include/mapnik/geometry/boost_adapters.hpp +======= +// box2d +template<> struct tag > { using type = box_tag; }; +template<> struct point_type > { using type = mapnik::coord2f; }; + +template <> +struct indexed_access, min_corner, 0> +{ + using ct = coordinate_type::type; + static inline ct get(mapnik::box2d const& b) { return b.minx();} + static inline void set(mapnik::box2d &b, ct const& value) { b.set_minx(value); } +}; + +template <> +struct indexed_access, min_corner, 1> +{ + using ct = coordinate_type::type; + static inline ct get(mapnik::box2d const& b) { return b.miny();} + static inline void set(mapnik::box2d &b, ct const& value) { b.set_miny(value); } +}; + +template <> +struct indexed_access, max_corner, 0> +{ + using ct = coordinate_type::type; + static inline ct get(mapnik::box2d const& b) { return b.maxx();} + static inline void set(mapnik::box2d &b, ct const& value) { b.set_maxx(value); } +}; + +template <> +struct indexed_access, max_corner, 1> +{ + using ct = coordinate_type::type; + static inline ct get(mapnik::box2d const& b) { return b.maxy();} + static inline void set(mapnik::box2d &b , ct const& value) { b.set_maxy(value); } +}; + +// mapnik::geometry::line_string +template +struct tag > +{ + using type = linestring_tag; +}; + +// mapnik::geometry::polygon +>>>>>>> master:include/mapnik/geometry/boost_adapters.hpp template struct tag > { diff --git a/include/mapnik/geometry/reprojection_impl.hpp b/include/mapnik/geometry/reprojection_impl.hpp index f4903613e..77f9a9e2e 100644 --- a/include/mapnik/geometry/reprojection_impl.hpp +++ b/include/mapnik/geometry/reprojection_impl.hpp @@ -20,14 +20,11 @@ * *****************************************************************************/ -// mapnik +// mapnik +#include #include -namespace mapnik { - -namespace geometry { - -namespace detail { +namespace mapnik { namespace geometry { namespace detail { //template 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 diff --git a/include/mapnik/json/geometry_generator_grammar_impl.hpp b/include/mapnik/json/geometry_generator_grammar_impl.hpp index 1298803bb..e9ba6dd91 100644 --- a/include/mapnik/json/geometry_generator_grammar_impl.hpp +++ b/include/mapnik/json/geometry_generator_grammar_impl.hpp @@ -24,7 +24,6 @@ #include #include - namespace mapnik { namespace json { namespace karma = boost::spirit::karma; diff --git a/include/mapnik/wkt/wkt_grammar_x3_def.hpp b/include/mapnik/wkt/wkt_grammar_x3_def.hpp index b8d5065d1..ad1e271ed 100644 --- a/include/mapnik/wkt/wkt_grammar_x3_def.hpp +++ b/include/mapnik/wkt/wkt_grammar_x3_def.hpp @@ -80,7 +80,6 @@ x3::rule > 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(')'); diff --git a/plugins/input/gdal/build.py b/plugins/input/gdal/build.py index 0db10c208..4dc631dde 100644 --- a/plugins/input/gdal/build.py +++ b/plugins/input/gdal/build.py @@ -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 diff --git a/plugins/input/ogr/build.py b/plugins/input/ogr/build.py index 143289d69..1681d0b4d 100644 --- a/plugins/input/ogr/build.py +++ b/plugins/input/ogr/build.py @@ -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 diff --git a/scripts/check-padding b/scripts/check-padding index b10d34b73..107d6369d 100755 --- a/scripts/check-padding +++ b/scripts/check-padding @@ -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 diff --git a/utils/pgsql2sqlite/build.py b/utils/pgsql2sqlite/build.py index 45d90035b..3dac9003a 100644 --- a/utils/pgsql2sqlite/build.py +++ b/utils/pgsql2sqlite/build.py @@ -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']))