Commit graph

83 commits

Author SHA1 Message Date
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
Artem Pavlenko
2d256166b4 Store text attributes as USC-2 encoded std::wstring 2007-02-14 19:54:39 +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
e016bd61f8 Added transcoder based on iconv. Internally we use UCS-2 at the moment.
* Postgis plug-in determines encoding by querying 'client_encoding' parameter (libpq). 
 * Shapfiles (dbf!) don't store character encoding information. Users can apply 'encoding' parameter at datasource creation stage (defaults to Latin1 (ISO-8859-1))
 * Raster plug-in utf-8
2007-02-06 14:27:21 +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
c6ee7ce438 trim strings at data source level 2006-12-01 10:37:15 +00:00
Artem Pavlenko
4d4e9f5d91 Tiling patch from Toby allows for a selected pixel region within an extent
to be rendered. This allows for a large extent (larger than can be
rendered into a single image in memory) to be rendered out as tiles.
Since the full extent is used for the placement calculations text
crossing tile boundaries will be consistent.

This method is a little inefficient when a large number of labels need
placed, an improved method would be to cache these placements between
tiles, but the attached is a start.

c++ users should simple call the render method with a start X and Y
coordinate specified, 

for (int TileX = 0;TileX < 5;++TileX)
{
	for(int TileY = 0;TileY < 5; ++TileY)
	{
		int TileSize=250;
		int StartX = TileX*TileSize;
		int StartY = TileY*TileSize;
		
		Image32 buf(TileSize,TileSize);
		agg_renderer<Image32> ren(m,buf,StartX,StartY);
		
		ren.apply();
		char name[324];
		sprintf(name,"tile_%d_%d.png",TileX,TileY);
		ImageUtils::save_to_file(name,"png",buf);
	}
}

python users should call render_tile_to_file

for y in range(tile_count_y):
	for x in range(tile_count_x):
		if not os.path.exists("tiles/%d/%d/" % (map_scale, y)):
			os.makedirs("tiles/%d/%d/" % (map_scale, y))
		render_tile_to_file(m, x*tile_size, y*tile_size, tile_size, tile_size,
'tiles/%d/%d/%d.png' % (map_scale,y,x), 'png')
2006-12-01 09:37:37 +00:00