Commit graph

42 commits

Author SHA1 Message Date
Tom Hughes
7e137e3ad7 Remove unused variable.
Patch from Jon Burgess <jburgess777@googlemail.com>.
2008-07-27 11:08:02 +00:00
Tom Hughes
5432c8a7d0 Make sure we set the height of the string if it doesn't contain
any spaces where we could break the line.

Patch from Jon Burgess <jburgess777@googlemail.com>.
2008-07-27 11:07:12 +00:00
Dominic Hargreaves
e128d51534 Patch to disallow placement if segment_length=0 from jonb (fixes #86) 2008-03-29 20:02:16 +00:00
Dave
a3652c6e66 Return old label_position_tolerance=0 behaviour.
- Place within 1/2 of spacing rather than 1/3.
2008-02-06 20:38:54 +00:00
Dave
6b2285f237 Fix placing 1 character line labels. 2008-01-28 21:41:53 +00:00
Dave
5bbe90b85f Remove find_placements, build_path_follow, build_path_horizontal.
Add new find_point_placements to cover the gap left.
Change shield symbolizer to use find_point_placements.
Results are the same as before, but with much less duplicate code.
2008-01-24 01:16:14 +00:00
Dave
a73687aeee Woops, remove debug output. 2008-01-23 21:39:49 +00:00
Dave
1d556b54fd Make line placement retry if it places >= 50% of the characters upside down. 2008-01-23 21:38:48 +00:00
Dave
918bd1ef6b Improved character placement code.
Slightly changes the result of max_char_angle_delta as now character angles aren't strict against the line angles.
Example screenshots on mailing list! :)
2008-01-23 04:18:17 +00:00
Artem Pavlenko
a61553edb8 removed redundant bounding box from label_placement 2008-01-21 16:18:46 +00:00
Dave
d3ec70aff9 Return pre-r557 rendering of line aligned labels. (Not the code, the algorithm ideas)
Spacing and no spacing line rendering are done by the same function.
Code is cleaner, performance should be equal or improved.
Text displacement is "Different", better in some cases and worse in others, I can revert it if wanted.
Old non spacing code is not yet removed as it is used by ShieldSymbolizer which I haven't investigated yet.
Individual character placement still has issues, that is my next task to fix!
2008-01-21 03:08:18 +00:00
Dave
e96e7b18fa Fix find_placements_with_spacing in relation to http://trac.mapnik.org/ticket/62
force_odd_labels also works again.
2008-01-16 01:13:27 +00:00
Dave
a401a26ccb Additional comments for the placement finder. 2008-01-15 22:32:14 +00:00
Artem Pavlenko
6eadaafd49 use 'avoid_edges' parameter for point placement 2007-11-06 09:07:18 +00:00
Artem Pavlenko
01de9d9e8c 1. revived 'avoid_edges' option
2. fixed 'placement_finder' extent in agg_renderer.cpp
3. added 'avoid_edges' to map loader
2007-11-05 10:32:01 +00:00
Artem Pavlenko
ce6985aaad use 'contains' instead of 'intersects' test to provide 'avoid_edges' functionality.
(Should 'avoid_edges' be always enabled ???)
2007-11-05 09:15:53 +00:00
Artem Pavlenko
8d51cb421b 1. re-factored placement_finder to be more efficient. 'find_*' methods are templated on PathType.
2. PostGIS plug-in - optional 'multiple_geometries' parameter to control how Multi* geometries built. 
3. MarkersSymbolizer (work in progress) to render vector shapes (markers) alonh a path with collision detection.
2007-11-02 12:50:15 +00:00
David
bc54b150ea - reversed header include order 2007-10-08 17:42:41 +00:00
Artem Pavlenko
d1a345a3d2 1.don't share FT_Library object between threads (TODO : implement freetype_engine pool)
2. merged changes with latest load_map
2007-10-05 11:27:00 +00:00
David
b2df387a9d - merged strict-xml-branch r530:532 to trunk:
- libxml2 support
    - strict error handling while parsing XML map files
    - implemented save_map()
    - removed some duplicate defaults
    - all symbolizers with icons share a common base class now
2007-09-25 18:47:12 +00:00
Artem Pavlenko
8e071f84c7 1. Changed internal geometry representation (explicit support for multi geometries)
(FIXME : label_spacing is still, too slow!!) 
2. Re-use some agg objects.
3. placement_finder cleanups! 
4. Added support for 'building_symbolizer' - extruded polygons
2007-09-16 11:23:51 +00:00
Artem Pavlenko
a53fbf2ca3 applied patch that makes sure names of vertical roads are
rendered in a consistent direction (from Cameron Patrick)
2007-08-01 10:57:27 +00:00
Artem Pavlenko
8eac22911a applied mapnik_line_displacement patch from Cameron Patrick 2007-07-26 21:09:40 +00:00
vspader
9fe4a94c98 Added minimum_distance property to text symbolizers. This prevents the same label from appearing within N pixels (across features).
Shield symbolizer is now a subclass of text symbolizer.
Some small improvements to text rendering.
Fixed up placement finder for horizontal placement.
Cleaned up placement finder.
2007-07-02 13:39:08 +00:00
vspader
560de0b9b1 Fix so labels stay within the road. 2007-06-21 15:29:47 +00:00
Artem Pavlenko
d3d40234c9 share collision detector between labels and text. 2007-05-12 11:34:55 +00:00
Artem Pavlenko
a6a31f42f6 implelmented optional 'clear' text labels cache at the layer level 2007-05-01 07:53:20 +00:00
Artem Pavlenko
4cc771546d small cleanup 2007-02-25 10:54:36 +00:00
Artem Pavlenko
d024c86b1b Restored support for the text displacement (point placement only at moment) 2007-02-09 16:32:44 +00:00
Artem Pavlenko
dcfe5d3fad oops, fixed 2006-12-05 13:15:43 +00:00
Artem Pavlenko
00fd2a9f00 1. placement_finder.cpp
fixed 'for' loops to work correctly when geom->num_points() < 2
    always use prefix increment even for built-in types (good practice!)
    e.g ++i 

2. agg_renderer.cpp 
    check for number points in geometries when 
    applying text/shield_symbolizer.
2006-12-05 00:16:05 +00:00
Artem Pavlenko
8c374a22a6 Label position tolerance and text spacing patch from David Leaver. Thanks! 2006-11-29 10:44:42 +00:00
Artem Pavlenko
6b88293808 use 2*M_PI for max_char_angle_delta normalizing. 2006-11-28 22:24:24 +00:00
Artem Pavlenko
7ee890bc12 define M_PI if undef 2006-11-28 10:38:56 +00:00
vspader
a6994cfc45 Fixed up text placement.
Removed the patch for better cornering from r365,
since it wasn't working properly.
2006-11-22 22:09:11 +00:00
vspader
d7b94f5d8c Added avoid_edges property to shield and text symbolizers.
If this is enabled, no shield/text symbolizers will be cut off
at the edges of the image.
2006-11-17 14:07:41 +00:00
Artem Pavlenko
e7bab0b8c8 1. fixed vertical alignement (??)
2. initialize overlap_ in ctor
2006-11-08 20:58:40 +00:00
Artem Pavlenko
889ac41694 Patch from Toby: adds a maximum angle delta for text placement (if the
angle changes too much between characters it finds an alternate
placement), this is specified in the max_char_angle_delta property in
radians (feel free to change it to degrees).

It also improves the text placement around corners trying to minimise
the distance between the center of the character and the line on each
side. This is the major portion of the patch.
2006-11-04 10:38:24 +00:00
Artem Pavlenko
e924b597f4 1. patch from Toby that allows repeated labels to be placed on a line
geometry (such as roads)
2. restored text labels for point geometry.
3. process 'spacing' attribute in load_map.cpp
2006-11-01 23:17:05 +00:00
Artem Pavlenko
d7fcefc848 1. applied text-wrap patch from Robert Coup. Thanks!
2. by default use tinyxml as a property_tree parser
3. modified load_map.cpp to allow to test new features
2006-10-27 17:29:39 +00:00
Artem Pavlenko
a3817cc362 added missing projection transformation for label placement.
TODO: move to geometry class to always return transformed label position
2006-10-21 12:16:19 +00:00
vspader
f76079f15b 1) Added line following labels. Use set_label_placement(POINT_PLACEMENT) or set_label_placement(LINE_PLACEMENT) on a text symbolizer.
2) Added placement_finder class so labels try to avoid each other.
3) Added Shield Symbolizer which is essentially a combined image/text symbolizer.
2006-10-17 14:12:53 +00:00