Commit graph

4487 commits

Author SHA1 Message Date
Jiri Drbalek
f10e051e17 Add grid placement for text and shield symbolizer 2018-02-06 15:19:05 +00:00
Jiri Drbalek
fb5ca1bb8e offset_converter: Don't filter out closing and moving segments 2018-01-26 11:55:04 +00:00
Jiri Drbalek
99038229f7 Polylabel: cover the case of empty polygon or exterior ring 2018-01-17 13:39:15 +00:00
Jiri Drbalek
a97eace434 Interior: cover the case of empty polygon or exterior ring 2018-01-17 12:58:42 +00:00
Jiri Drbalek
ec53f3d879 Fix crash in case of empty ring 2018-01-17 09:53:45 +00:00
Artem Pavlenko
ff31c6d6eb SVG parser - add ignore_ member variable to allow skipping of unsupported elements, currently clipPath (#3818) 2018-01-09 15:19:52 +00:00
Artem Pavlenko
c24568f033 Merge branch 'polylabel-as-interior' of https://github.com/mapycz/mapnik into mapycz-polylabel-as-interior 2018-01-08 10:21:09 +00:00
Artem Pavlenko
e2d741bdb7
Merge pull request #3809 from IMQS/pr-text-placements-export
Export all text_placements_ classes from mapnik.dll
2018-01-05 13:02:58 +00:00
Artem Pavlenko
c29f944726 Merge branch 'fix-group-symbolizer-crash' of https://github.com/lightmare/mapnik into lightmare-fix-group-symbolizer-crash 2018-01-05 12:16:41 +00:00
Artem Pavlenko
92afd0bebf Use macro to apply __attribute__((init_priority(val))) where it's supported (gcc+clang) (#3821) 2018-01-04 14:29:00 +00:00
Artem Pavlenko
50169e95b2 Enforce global variables initialisation order via __attribute__((init_priority(<priority>))) (#3821) 2018-01-04 12:22:04 +00:00
Artem Pavlenko
a67f5abb67 consistent syntax 2018-01-03 17:38:16 +00:00
Jiri Drbalek
f52a0fa4f6 new interior algorithm 2017-12-13 21:48:13 +00:00
Jiri Drbalek
ea7ba2c099 add polylabel placement method 2017-12-13 21:48:13 +00:00
Ben Harper
5507ab817a Export all text_placements_ classes from mapnik.dll
Previously, only text_placements_dummy had a MAPNIK_DECL annotation.
This commit adds that annotation to text_placements_simple and
text_placements_list, so that they are also exposed from the Windows DLL
build.
2017-11-28 11:30:35 +02:00
Artem Pavlenko
3cb74f0871 attempting to fix #3793 2017-11-14 10:10:26 +01:00
Artem Pavlenko
97f520c7cf cleanup 2017-11-14 10:10:26 +01:00
Jiri Drbalek
fe268b0e71 char_array_buffer should implement also seekpos() 2017-11-13 22:42:37 +00:00
Artem Pavlenko
5db45d9fa3 use semantic actions to fix #3744 ( >= boost_1_65) 2017-11-13 13:15:47 +01:00
Artem Pavlenko
743c14d3ff add UDL via operator"" _case 2017-11-06 10:31:53 +01:00
Artem Pavlenko
2271e4a5a4 use unsigned int for indexed access 2017-10-31 10:52:09 +01:00
Ben Harper
05849f0da5 Add new angled-point marker placement mode for lines
This adds a new mode called 'angled-point' to the marker-placement modes.
The full list of modes is then:
  point, angled-point, interior, line, vertex-first, vertex-last

Angled point is identical to point, except that when placing a marker on
a line, the marker's angle is taken from the angle of the line segment.

There is another possible use of the "angled-point" concept for polygons,
and that is for placing labels on stand (aka erf) polygons. By computing
a dominant angle for a mostly rectangular polygon, this can produce quite
good results. I'm not sure whether I should implement that now, or if I
could do that later.
2017-10-26 15:09:17 +02:00
talaj
f3cf1ad388 Fix centroid and interior algorithms (#3771)
* fix interior algorithm - closing segment handling

* fix centroid algorithm - closing segment handling

* update visual tests
2017-09-25 15:45:02 +02:00
Artem Pavlenko
3d4963f40c move implementatio into *.cpp + return 'closest_point_result' struct. 2017-09-22 13:21:50 +02:00
Artem Pavlenko
143d1e57cf add 'closest_point' geometry algorithm 2017-09-21 15:40:30 +02:00
Artem Pavlenko
5d5ef602be rename 'geometry_type' to 'topojson_geometry_type' to avoid names clashing
(this was causing miscompilation on linux (ubuntu 17.04/clang))
2017-09-18 11:35:39 +01:00
talaj
d14203561d color font support improvements (#3758)
👍
2017-09-13 10:14:46 +01:00
Artem Pavlenko
acec6ae824 Merge branch 'master' into bbox-index 2017-09-12 14:57:12 +01:00
Artem Pavlenko
8bc080c7b8 Merge branch 'nested-layers-fixes' of https://github.com/mapycz/mapnik into mapycz-nested-layers-fixes 2017-09-12 14:09:47 +01:00
Artem Pavlenko
04f9db4b18 minor format 2017-09-11 17:30:37 +01:00
Jiri Drbalek
6777721391 enclosing calls forgotten in https://github.com/mapnik/mapnik/pull/3474 2017-09-11 15:25:19 +00:00
artemp
441687ecff boost_adapters - apply temp fix via @Algunenano for boost 1.64 (ref #3733) 2017-08-21 14:14:00 +01:00
artemp
9b0fd7a8d7 boost_adapters - apply temp fix via @Algunenano for boost 1.64. 2017-08-21 14:12:12 +01:00
artemp
40c51c469c shape.input/shapeindex - update to use bounding box per item *.index format. 2017-08-21 11:02:34 +01:00
artemp
6c19efa990 store box2d<float> directly in index_record to avoid conversions. 2017-08-18 16:59:58 +01:00
artemp
2aa0ce9d74 New *.index format (bounding box per item) implementation 2017-08-18 11:16:44 +01:00
artemp
2426a44671 initial updated spatial-index implementation 2017-08-16 13:59:44 +01:00
artemp
add410e619 use arch independent types for serialised values 2017-08-15 11:14:11 +01:00
artemp
c4a1df6e91 simplify impl + const correctness + minor cleanup 2017-08-15 11:13:11 +01:00
artemp
6f73181e9b Enforce consistent error handling policy - always throw on fatal errors (both strict and non-strict). In strict mode throw on first parsing error. Remove return values from parse,parse_from_string and traverse_tree methods. Update unit tests. 2017-08-02 10:32:13 +01:00
artemp
093fcee6d1 only include <unicode/unistr.h> if ICU >= 59 (attempting to fix current coverage build on travis). 2017-07-21 10:37:22 +02:00
artemp
9e58c89043 Add support for U_ICU_VERSION_MAJOR_NUM >= 59 (#3729) 2017-07-19 16:07:39 +02:00
artemp
3ae71eea0f JSON - wrap lamda functions into anonymous namespace to fix linking on Windows with VS2017. 2017-07-06 16:09:38 +02:00
artemp
e653f4cc4c make constructor explicit to avoid C2664 error with VS2017. 2017-07-06 16:01:06 +02:00
artemp
e08616aed3 Didn't play well with VS2017, reverting "re-use lamdas definitions and aviod duplicate symbols when building with vs2017"
This reverts commit 4c9322bc0d.
2017-07-06 11:17:14 +02:00
artemp
631c0a59c4 Revert "trying to inline lambdas (VS2017) (!)" this is not allowed in c++14 requires c++17
This reverts commit 0ad1c58009.
2017-07-06 11:14:24 +02:00
artemp
0ad1c58009 trying to inline lambdas (VS2017) (!) 2017-07-06 11:11:01 +02:00
artemp
4c9322bc0d re-use lamdas definitions and aviod duplicate symbols when building with vs2017 2017-07-06 10:59:42 +02:00
artemp
148e77884c don't include xml_parser_read_rapidxml.hpp - forward declaring xml_node is sufficient. 2017-06-29 09:41:16 +02:00
artemp
3fbce913d0 store viewbox transform 2017-06-29 09:41:16 +02:00
artemp
87abf93da3 move name_to_int into separate header for re-use. 2017-06-29 09:41:16 +02:00
artemp
53a69463ea SVG parser - add support for <use> element (ref #763). 2017-06-29 09:41:16 +02:00
artemp
a4e8603af1 svg transform - correct rotate(<a> [<x> <y>]) rule (ref #763)
(The transform attribute defines a list of transform definitions that are applied to an element and the element's children. The items in the transform list are separated by whitespace and/or commas, and are applied from right to left.)
2017-06-29 09:41:16 +02:00
artemp
b6aa45144c svg_parser - refactor => remove mutable temporary_gradient_ member variable + process stop elements from within linearGradient and radialGradient. 2017-06-29 09:41:16 +02:00
artemp
6da83bc986 svg_parser - store unresolved gradient nodes for deferred initalisation. 2017-06-29 09:41:16 +02:00
artemp
ef6c2e71b8 svg-parser : handle parsing failures via error_handler ( throw in strict mode and log+continue when strict==false) 2017-06-29 09:41:16 +02:00
artemp
3f591af871 initial support for strict SVG parsing (WIP) 2017-06-29 09:41:16 +02:00
artemp
dfa8f100b2 freetype_engine - port singleton changes from v3.0.x 2017-06-01 12:47:18 +02:00
Jiri Drbalek
7590cdabb0 fix typo in file name 2017-05-24 13:59:47 +00:00
Jiri Drbalek
0781f230be fix polygon handling 2017-05-24 13:59:44 +00:00
Jiri Drbalek
4084e670ec fix closing polygons on reprojection 2017-05-24 12:10:11 +00:00
artemp
1725b1ebba TIFF.input - port changes from https://github.com/mapnik/mapnik/pull/3668 (ref #3669) 2017-05-10 14:33:29 +02:00
artemp
97a796ba0e fix polygon_coord rule to generate required enclosing brackets. 2017-05-05 16:29:33 +02:00
artemp
333ef9fde1 update copyright year 2017-05-05 13:02:01 +02:00
artemp
d84991bae3 add debug log 2017-05-04 10:50:49 +02:00
artemp
85aebf7268 set most common language based on script for each text run (#3655) 2017-05-03 10:23:42 +02:00
artemp
e75db3aa18 make box2d<T> adapters more generic. 2017-04-10 13:18:00 +01:00
artemp
20824cce79 add const_interior_rings type and stop abusing type system. (NOTE: iterator/const_iterator types are required by boost::range_iterator) 2017-04-03 13:00:35 +01:00
artemp
53a32b59b9 add boost::geometry::traits::push_back specialisation for mapnik::interior_rings<CoordinateType> 2017-03-30 14:04:57 +01:00
artemp
d96e6abe81 const correctness via @flippmoke 2017-03-30 09:54:12 +01:00
artemp
ef7da04cc9 cleanup 2017-03-30 09:23:58 +01:00
artemp
e3bf8cb558 use range based loop via @flippmoke 2017-03-30 09:23:11 +01:00
artemp
c28bf77d5d Merge branch 'master' into geometry.hpp 2017-03-30 08:23:56 +01:00
artemp
dd079183c5 add boost::geometry::resize and boost::geometry::clear traits specialisations for mapnik::interior_rings<CoordinateType> 2017-03-29 17:44:07 +01:00
artemp
3e803b52bb remove has_empty + fix is_empty implementaion to work with geometry.hpp 2017-03-29 11:39:04 +01:00
artemp
064b99168b geometry.hpp 2017-03-27 16:14:51 +01:00
artemp
60e6f5a9ff geojson - fix geometry generator grammar. 2017-03-22 15:09:15 +00:00
artemp
38b4b65911 GeoJSON - refactor geometry generator to preserve geometry type in output (ref https://github.com/mapnik/python-mapnik/issues/139) 2017-03-21 16:48:41 +00:00
artemp
b4b5e33b05 refactor WKT generator to retain geometry type for empty geometries (avoid short-cutting to POINT EMPTY)
For example:

| in |   | out   |
|`POINT EMPTY` |  <--> | 'POINT EMPTY`|
|`LINESTRING EMPTY` |  --> | 'POINT EMPTY`|

| in |   | out   |
|`POINT EMPTY` |  <--> | 'POINT EMPTY`|
|`LINESTRING EMPTY` |  <--> | 'LINESTRING EMPTY`|
etc.
2017-03-21 12:43:42 +00:00
artemp
d9063db0a0 GeoJSON - make geometry element stricter and throw on invalid input. 2017-03-21 12:40:58 +00:00
artemp
5450255c5b revert back to separate tests #if HB_VERSION_MAJOR > 0 #if HB_VERSION_ATLEAST(1, 0 , 5) ref #3642 2017-03-20 14:24:34 +00:00
Jiri Drbalek
d7ba7dc0db agg renderer: recycle internal buffers 2017-03-16 06:54:16 +00:00
Jiri Drbalek
03929b5c76 nested layers, layer level comp-op and opacity 2017-03-16 06:54:16 +00:00
artemp
1d06afeea2 Merge branch 'postgis-quoting' of https://github.com/lightmare/mapnik into lightmare-postgis-quoting 2017-03-14 12:29:32 +00:00
artemp
c1053181f5 Merge branch 'text-extend' of https://github.com/mapycz/mapnik into mapycz-text-extend 2017-03-14 11:53:52 +00:00
artemp
0dff423c44 cleanup 2017-03-14 11:22:11 +00:00
artemp
203d767e73 follow up from 32f5703ed1 - more generic specialisation 2017-03-14 10:26:09 +00:00
artemp
32f5703ed1 provide is_substitute specialisation for mapnik::geometry::linear_ring<double> const& (gcc6) 2017-03-14 11:05:33 +01:00
artemp
a50efcb2bb refactor unicode string grammar - add escaped_unicode rule + use it in expressions. 2017-03-03 15:41:46 +01:00
artemp
fb7139bc63 expressions - only import escaped rule from unicode_string_grammar and construct single/double quoted string rules locally to match expression grammar. NOTE: single quoted strings don't accept unicode encodings 2017-03-03 15:14:01 +01:00
artemp
92f07b7a7a handle utf16 encoding correctly by parsing as sequence and applying utf16->utf32->utf8 conversion. 2017-03-01 18:46:48 +01:00
artemp
04dd05c971 minimise shared_ptr assignments and simplify code 2017-03-01 12:59:34 +01:00
artemp
d29be8a689 If I'm reading docs correctly \uNNNN + \UNNNNNNNN are correct
Revert "relax hex4 parser to allow 5 character \unnnnn code points"

This reverts commit 378fa41db6.
2017-03-01 12:08:22 +01:00
artemp
2d2c5a191b expression_grammar: re-use unicode_string_grammar and add initial support for \uNNNNN code points (TODO) 2017-03-01 11:58:18 +01:00
artemp
378fa41db6 relax hex4 parser to allow 5 character \unnnnn code points 2017-03-01 11:53:27 +01:00
artemp
571b2a0d6a Merge branch 'harfbuzz-shaper' into color-emoji 2017-03-01 11:30:33 +01:00
artemp
7cb587a901 Merge branch 'master' into harfbuzz-shaper 2017-03-01 11:30:08 +01:00
artemp
131f785dce Make parsing \xXX format strict via hex2 parser + append UTF8 encoded \xXX characters directly (fixes #3631) 2017-03-01 11:25:43 +01:00
artemp
e95b16c5ca make hex parser strict (expecting two characters after \x) to avoid greedy parsing of trailing characters as in
"\xF0\x9F\x8D\xB7abc" ==>  ... + "\xB7" +  "abc" not "\xB7abc"
2017-03-01 10:35:39 +01:00
artemp
0076a5a916 make hex parser strict (expecting two characters after \x) to avoid greedy parsing of trailing characters as in
"\xF0\x9F\x8D\xB7abc" ==>  ... + "\xB7" +  "abc" not "\xB7abc"
2017-03-01 10:34:16 +01:00
artemp
570126bd76 make hex parser strict (expecting two characters after \x) to avoid greedy parsing of trailing characters as in
"\xF0\x9F\x8D\xB7abc" ==>  ... + "\xB7" +  "abc" not "\xB7abc"
2017-03-01 10:27:12 +01:00
artemp
cbacaaf0c5 initialize to reasonable values. 2017-02-28 15:05:37 +01:00
artemp
1b67779290 implement color bitmap extraction/scaling/compositing into target pixmap 2017-02-28 15:04:49 +01:00
artemp
7c93514fbc avoid division by zero (units_per_EM is set to 0 for bitmap fonts) 2017-02-28 15:01:46 +01:00
artemp
8e97803e81 add color_font_ member 2017-02-28 14:59:14 +01:00
artemp
32e592fb7a use explicit const& 2017-02-22 12:33:18 +01:00
artemp
d9c81d46fd use else if 2017-02-20 12:12:22 +01:00
artemp
86e5f9305b quarantee glyphinfos has enough capacity to hold cluster 2017-02-17 17:16:36 +01:00
artemp
fbdff42d47 use std::vector<std::vector<T>> instead of std::map<unsigned,std::vector> to simplify lookups 2017-02-17 16:52:31 +01:00
artemp
20cafae780 ensure insert has worked 2017-02-17 15:40:37 +01:00
artemp
e55918788c fix test logic 2017-02-17 15:32:03 +01:00
artemp
302e4c75dd simplify further 2017-02-17 15:28:13 +01:00
artemp
fe7d1e2f53 simplify logic 2017-02-17 15:23:00 +01:00
artemp
49c28cb6ad new font fallback implementation - it is rather inefficient but attempting to do a right thing.
(NOTE: some visual text failures need further look to see if latest implementation is correct)
2017-02-17 14:20:32 +01:00
Mickey Rose
2587bb3a1d sql_utils: improved table_from_sql 2017-02-10 18:55:22 +01:00
Mickey Rose
a4e8ea21be sql_utils: deprecate flawed un-quote functions
unquote* just strip all quotes from both ends of the string,
and don't collapse inner quotes.

quote_attr doesn't duplicate inner quotes.
2017-02-10 18:55:22 +01:00
Mickey Rose
7b217133e2 sql_utils: on-the-fly quoting via operator << 2017-02-10 18:55:22 +01:00
artemp
755d178d20 alternative exaustive face fallback implementation ref #3534 #3559 2017-01-31 17:44:25 +01:00
artemp
d053bddb43 add support for PNG filters (http://www.libpng.org/pub/png/libpng-manual.txt) ref #3479 2017-01-26 15:45:08 +01:00
artemp
2ede054e93 c++ style - use pre-(de)increment operators by default 2017-01-26 14:19:28 +01:00
artemp
f13848e210 move box2.hpp and related files into geometry dir 2017-01-26 09:51:37 +01:00
artemp
a220bda05d check return value from std::fread 2017-01-13 14:38:00 +01:00
artemp
f76060274d Revert back again fixing a typo! (thanks @springmeyer 2f55f0962e (commitcomment-20461372))
"It doesn't work with GCC reverting back "disable [-Wunused-result] warning GCC : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509""

This reverts commit 2f55f0962e.
2017-01-13 09:42:12 +01:00
artemp
0a7e8bb429 fix GCC shadows a member warning [-Wshadow] 2017-01-12 17:48:56 +01:00
artemp
2f55f0962e It doesn't work with GCC reverting back "disable [-Wunused-result] warning GCC : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509"
This reverts commit 3c76e8d7ef.
2017-01-12 11:39:57 +01:00
artemp
3c76e8d7ef disable [-Wunused-result] warning GCC : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 2017-01-12 11:23:46 +01:00
artemp
7db3beda01 add parentheses to supress gcc warning [-Wparentheses] 2017-01-12 10:55:33 +01:00
artemp
de2b44712a move transform related headers into transform dir to minimize clutter 2017-01-11 11:10:03 +01:00
artemp
91f9508654 relax expression_grammar: allow _ underscore characters in global attribute names 2017-01-11 10:38:11 +01:00
artemp
f207ec2da2 cleanup 2017-01-10 17:19:28 +01:00
artemp
65dcb1c935 fix transform grammar to support whitespace/comma argument separation rules (https://github.com/mapnik/mapnik/pull/1416) ref #3569 2017-01-10 17:13:45 +01:00
artemp
7326c0d558 expressions - simplify attribute parsing by combining feature attribute and geometry_type attribute processing. 2017-01-10 11:54:08 +01:00
Artem Pavlenko
e5a93bce52 Merge pull request #3596 from mapycz/text-simple-placement-center
Text simple placement: add center 'C' placement
2017-01-09 11:57:03 +01:00
artemp
6190784350 remove remaining usage of deprecated dymamic exceptions: dtors are implicitely noexcept + qualify what methods with noexcept 2017-01-09 11:47:52 +01:00
Jiri Drbalek
4eae86b7bc text simple placement: add center 'C' placement 2017-01-08 09:05:44 +00:00
artemp
07ab49830f disable is_substitute instantiation for BOOST_VERSION > 106300, fixes gcc6+boost-1_63 build 2017-01-04 18:39:42 +01:00
artemp
e210dfaf8c fix GCC warning by adding missing parentheses around comparison in operand of '|' 2017-01-04 18:23:31 +01:00
Mickey Rose
962bcf84c5 change render_thunk_list to std::list<render_thunk>
Wrapping render_thunk in std::unique_ptr is one extra allocation per
element, with no purpose. The somewhat costly xyz_render_thunk move
constructor is only called once upon insertion, regardless of whether
we're emplacing render_thunk or unique_ptr.
2017-01-03 20:53:55 +01:00
artemp
d3a9e4c4d7 revive support for an empty array => geometry_empty
RFC 7946 "...GeoJSON processors MAY interpret Geometry objects with
          empty "coordinates" arrays as null objects."
2017-01-03 16:17:46 +01:00
artemp
7a8e8014b7 Revert "add ```template <typename T>" - oops we don't need this in master!
This reverts commit b3c4aff2c7.
2017-01-03 11:28:40 +01:00
artemp
b3c4aff2c7 add ```template <typename T>
transform_node(boost::value_initialized<T> const&)
          : base_() {}
``` to address

```c:\mb\windows-builds-64\packages\mapnik-windows\include\mapnik/transform_expression.hpp(175):
error C2664: 'mapbox::util::variant<mapnik::identity_node,mapnik::matrix_node,mapnik::translate_node,mapnik::scale_node,mapnik::rotate_node,mapnik::skewX_node,mapnik::skewY_node>::variant(mapbox::util::variant<mapnik::identity_node,mapnik::matrix_node,mapnik::translate_node,mapnik::scale_node,mapnik::rotate_node,mapnik::skewX_node,mapnik::skewY_node> &&) noexcept(false)':
cannot convert argument 1 from 'const boost::value_initialized<T>' to 'mapbox::util::no_init' [c:\mb\windows-builds-64\packages\mapnik-windows\mapnik-gyp\build\mapnik.vcxproj]
```
when building with VS2017 RC
2017-01-03 11:24:32 +01:00
lightmare
e41f41b0a6 Merge pull request #3566 from mapycz/better-largest-bbox
Better largest bbox
2017-01-02 03:25:14 +01:00
lightmare
a40ce9eefd Merge pull request #3578 from mapnik/cxx11-friendly
C++14-like type traits aliases
2017-01-02 03:24:59 +01:00
artemp
ed648ced46 SVG transform - implement in terms of boost::spirit::x3 2016-12-23 16:32:05 +01:00
artemp
3b52ae97c0 add missing header 2016-12-23 14:42:18 +01:00
artemp
95cc560167 SVG points - implement using boost::spirit::x3 + refactor parse_rule instantiations into separate *.cpp 2016-12-23 14:40:59 +01:00
artemp
584fda88e0 SVG path grammar - return start rule by const& 2016-12-23 13:26:37 +01:00
artemp
30749031cf SVG path parser - boost::spirit::x3 based implementation 2016-12-22 14:57:26 +01:00
artemp
9d0096eff6 remove unused include directive 2016-12-21 15:20:52 +01:00
artemp
506390b735 use curly braces initialiser (c++ style) 2016-12-21 09:05:31 +01:00