Commit graph

89 commits

Author SHA1 Message Date
Artem Pavlenko
05f5473924 + correct image bonding box calculation
+ check for zero sized images
2010-02-03 12:19:49 +00:00
Dane Springmeyer
6115a1590d add 'gamma' attribute to PolygonSymbolizer, along with tests against simplified world borders shapefile - setting gamma to .5-.7 can remove gaps in processed_p.shp depending on background color - closes #428 2010-01-13 00:31:45 +00:00
Artem Pavlenko
47dc1e197b + merge mapnik2 to trunk 2009-12-16 20:02:06 +00:00
Artem Pavlenko
a3a5859466 Patch from David Eastcott :
1.  Modified Text Symbolizer

  a) corrected line fragment centering (for 2nd and subsequent lines, when line breaks occur).

  b) adjusted vertical alignment calculation so that:
      i)      middle -> has the center of the text line(s) at the point origin
      ii)     bottom -> has the text line(s) below the point origin
      iii)    top -> has the text line(s) above the point origin

  c) added new text_symbolizer attribute: 'wrap_before', value range: true/false, default == false

     allows line breaks at first wrap_char before wrap_width as an alternative to the original
     which was to create the line break at the first wrap_char after wrap_width

  d) added new text_symbolizer attribute: 'horizontal_alignment', value range: left/middle/right, default == middle
      i)      left -> has all text line(s) to left of the point origin
      ii)     middle -> has all text line(s) centered on the the point origin
      iii)    right -> has all text line(s) to the right of the point origin

      NOTE:   dx, dy position adjustments are applied after alignments and before Justify.

  e) added new text_symbolizer attribute: 'justify_alignment', value range: left/middle/right, default == middle
      i)      left -> after alignments, has all text line(s) are left justified (left to right reading)
      ii)     middle -> after alignments, has all text line(s) center justified
      iii)    right -> after alignments, has all text line(s) right justified (right to left reading)

  f) added new text_symbolizer attribute:  'opacity', value range: 0.0 thru 1.0; 1.0 == fully opaque

  g) modified positioning to compensate for both line_spacing and character_spacing, to ensure proper
     centering of the text envelope.  Also ensure that centering occurs correctly even if no wrapping
     occurs.  Line spacing is uniform and consistent and compensates for errors between text_size and
     the actual size (ci.height is inconsistent, depending on case and character); fixes issue with
     multi-line text where some lines have a slight gap and others are compressed together.


2.  Modified shield_symbolizer

  a) added the attributes:
      i)      allow_overlap
      ii)     vertical_alignment
      iii)    horizontal_alignment
      iv)     justify_alignment
      v)      wrap_width
      vi)     wrap_character
      vii)    wrap_before
      viii)   text_convert
      ix)     line_spacing
      x)      character_spacing
      xi)     opacity

  b)  added new shield_symbolizer attribute: 'unlock_image', value range: true/false, default == false
      i)  false == image and text placement behaviour same as before
      ii) true == image placement independant of text, image is always centered at geometry point, text placed per attributes,
                  dx/dy only affect text.

      Allows user to create point markers with text, but both the text and image rendering collision detection are done
      as a pair (they come and go together - solves problem if using point_symbolizer and text_symbolizers where one or the
      other are omitted due to overlaps, but not both)

  c)  extended choices for the attribute 'placement' to include vertex; effect is limited to the shield_symbolizer

      Allows an attempted placement at every vertex available, gives additional shield placement volume when using line geometry

  d)  ensured that the text placement was not updating the detector unless a shield image was actually placed.

  e)  added new shield_symbolizer attribute: 'no_text', value range: true/false, default = false

      When set true, the text for the feature is ignored ('space' subsituted) so that pure graphic symbols can be used
      and no text is rendered over top of them.
2009-10-19 13:52:53 +00:00
Artem Pavlenko
85ecc33d7f + applied patch from Jochen Topf :
* text_convert="none|toupper|tolower"
 Convert all text to upper/lower case before rendering. "none" doesn't do
 anything with the text and is the default. Works for labels along lines
 or at points.

* line_spacing="<number>"
 Add this many pixels space between two lines in text labels that have
 been broken into several lines. Default is 0. Doesn't do anything for
 labels along lines.

* character_spacing="<number>"
 Add this many pixels space between two characters in a text. Default is 0.
 Currently only works for text labels on point geometries. This should
 also be implemented for labels along lines, but I'll leave that for
 another day.

* wrap_character="<character>"
 Instead of breaking text into lines on spaces, use this character. This
 is useful, when you want to make sure that labels are broken at the right
 spot. Note that you'll probably want to make wrap_width small so that
 your lines are actually broken, otherwise you'll see the wrap_character
 in the output. Default is ' ' (space). Doesn't do anything for labels
 along lines.
2009-07-20 15:30:19 +00:00
Artem Pavlenko
d100cb7587 + this change was needed to avoid raster tiles alignment problems
TODO: Review raster handling pipeline to ensure correct alignments across all sources.
2009-04-10 12:07:13 +00:00
Dane Springmeyer
544cbb249a Apply patch from Marcin to handle smooth transitions between raster layers for both gdal and raster plugin - closed #295 2009-04-07 23:06:51 +00:00
Artem Pavlenko
4a3a9128ec + move compositing modes implementation out of Image class 2009-03-31 10:08:33 +00:00
Artem Pavlenko
0b20e2a768 + removed specializations for text renderer 2009-03-31 09:23:23 +00:00
Artem Pavlenko
10f55a678b + add support for vertical_alignment (text_symbolizer)
valid values are : top, middle, bottom
  default to middle which can now center multi-line text
2009-03-30 20:47:26 +00:00
Artem Pavlenko
2eec236fc2 + applied "hill shading" patch from Marcin Rudowski
a) Raster opacity
   b) Raster merging modes (TODO:add more modes, consider agg impl)
   c) Raster scaling algos: fast,bilinear,bilinear8
      (TODO: add alpha support in bilinear8) 
   d) improvements to png256

   *Great work, thanks!*
2009-03-29 11:05:20 +00:00
Artem Pavlenko
ae568d3223 make text_symbolizer behave like shield_symbolizer 2009-03-29 09:46:02 +00:00
Artem Pavlenko
e598348e56 + only allow LINE_PLACEMENT for geometries with more than one point 2009-03-29 09:37:51 +00:00
Jon Burgess
d11654895b Utilise color alpha information when rendering. Multiplies the color alpha with the rendering opacity. Fixes 221. 2009-02-07 14:09:23 +00:00
Artem Pavlenko
a07767ef3d + (c++) renamed mapnik::Color to mapnik::color
+ (c++) added mapnik::color ctor from named colours (TODO: consider not to export color_factory) 
+ (Python) fixed pickling
+ (Python) added to_hex_string method
2009-01-14 12:10:24 +00:00
Artem Pavlenko
11100cf30e + apply has_dimensions for line_placement only 2008-09-21 10:42:51 +00:00
Artem Pavlenko
20f3a9460d + expose buffer_size parameter (default 0)
influences envelope used by placement detector 
  ( i.e. 'avoid_edges' parameter)
2008-09-21 10:14:38 +00:00
Artem Pavlenko
565da55742 + point symbolizer opacity patch from Brian (openstreetmap@brian.quinion.co.uk) 2008-09-19 08:27:32 +00:00
Artem Pavlenko
3b85ebad9b make shield_symbolizer to work with point geometries (TODO!!) 2008-09-15 08:48:21 +00:00
Tom Hughes
026e4e71e7 Refactor some of the font set stuff so that the cairo renderer can be
made to work again.
2008-07-25 00:23:33 +00:00
Artem Pavlenko
48d7d639f9 added missing avoid_edges parameter 2008-06-30 16:05:25 +00:00
Artem Pavlenko
1b47afde07 applied font fallback patch from Beau Gunderson 2008-06-29 10:58:48 +00:00
Artem Pavlenko
3f9127b5d0 reverting back to 700 2008-06-29 10:58:29 +00:00
Artem Pavlenko
3275cf9ce6 applied font fallbacj patch from Beau Gunderson 2008-06-29 10:40:08 +00:00
Tom Hughes
4483d59797 Revert previous fix for #89 and add a new improved fix that enhances the
value class to have a proper null type and do comparisions SQL style so
that null is neither equal nor not equal to other things.
2008-04-12 15:22:27 +00:00
Tom Hughes
a27bde741e Don't try and render text if the attribute containing the text does
not exist for the feature. Closes #89.
2008-04-11 23:11:35 +00:00
Artem Pavlenko
cb905b533a restored templated version 2008-02-26 08:48:47 +00:00
Tom Hughes
02962156c5 Add support for rendering to a cairo surface. 2008-02-23 00:17:53 +00:00
Artem Pavlenko
308e315432 added Unicode support based on ICU 2008-02-18 21:40:34 +00:00
Artem Pavlenko
1ea7bffd4c pass parameter by reference
store reference to wstring in text_path
2008-02-12 20:05:04 +00:00
Artem Pavlenko
1b03c81e84 hide implementation details 2008-02-05 13:58:47 +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
f11a62b849 throw an exception rather than exit the program when an unknown font is specified.
It would be better if this was done when contructing the text_symbolizer, but this will do.
2008-01-23 21:56:04 +00:00
Dave
671c215ae6 Make specifying an invalid font a fatal error. ticket #31 2008-01-23 20:31:50 +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
017a966ea1 Fix blending onto transparent background. Detailed on mailing list. 2008-01-14 20:43:55 +00:00
Artem Pavlenko
c0d411d14e small cleanup 2007-11-07 14:07:12 +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
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
d959701d5a 1. added boost::optional<T> to/form Python converter
2. make background color optional (Map object)
3. exposed 'blend' method for Image object
2007-08-01 09:59:23 +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
Artem Pavlenko
f3ae318ca3 1. added 'allow_overlap' in load_map from xml
2. added overlap_ field to TextSymbolizer (ignored by renderer at the moment)
2007-06-20 21:08:23 +00:00
Artem Pavlenko
15e73b98f4 small formatting 2007-06-05 09:10:40 +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