Commit graph

95 commits

Author SHA1 Message Date
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
Artem Pavlenko
8c374a22a6 Label position tolerance and text spacing patch from David Leaver. Thanks! 2006-11-29 10:44:42 +00:00
Artem Pavlenko
f1393cc019 1. hit_test implementation for geometry objects:
bool hit_test(double x, double y, double tol);
       
2. added image_view(unsigned x, unsigned y, unsigned width, unsigned height)
   allowing to select region from image data e.g (in Python):

    im = Image(2048,2048)
    view = im.view(0,0,256,256)
    save_to_file(filename,type, view)
    
3. changed envelope method to return vy value in datasource classes

4. features_at_point impl for shape and postgis plug-ins
2006-11-25 11:02:59 +00:00
Artem Pavlenko
1c5eeb19af added basic support for unicode string 2006-11-22 22:01:37 +00:00
Artem Pavlenko
ebdd0f6030 disable clog printing in release mode. Pass -DMAPNIK_DEBUG to enable. 2006-11-19 17:13:33 +00:00
Artem Pavlenko
004f720fbd commented out usage of rasterizer_outline_aa for strokes <= 1.0 2006-11-18 16:47:29 +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
bf297ec3ca 1.upgrade to latest agg2.4
2.added default PointSymbolizer in load_map.cpp
2006-11-09 23:44:34 +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
vspader
118e8f0d52 Added face_name parameter to text and shield symbolizers,
which specifies the font face to be used for rendering.
New constructor is: text_symbolizer(name, face_name, size, ...)
2006-10-19 17:11:45 +00:00
Artem Pavlenko
7cae55f73f * trim leading and trailing whitespace from all strings before
rendering them as labels when using the text or shield symbolisers
  (blame my horrible datasets)
* correctly recognise the Postgis "text" data type (it was in
  postgisfs.cpp just not postgis.cpp) - my initial workaround to the
  above was "SELECT trim(from label) AS label ..." which failed
  miserably because it returned a text data type. 

Thanks to Robert Coup for the patch!
2006-10-19 09:24:26 +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
Artem Pavlenko
bb235fa316 1.added projection transformation support based on proj4 (new dependency!!!)
Map and Layer objects both have a new parameter 'srs', initialized to "+proj=latlong +datum=WGS84" by default. 
    
  Basic usage (Python):
    p = Projection("+proj=merc +datum=WGS84")
    point = p.forward(Coord(-2,51))
    ...        
2.reflected arithmetic operators for Envelope/Coord into Python
3.altered return policies for python objects
4.modified build system to require proj4 lib and headers
2006-10-16 13:44:52 +00:00
Artem Pavlenko
e2d645ad80 simplified coord transformation interface. 2006-10-09 09:52:15 +00:00
Artem Pavlenko
992af4747d 1. move include to mapnik/include
2. update demos,bibdibgs etc.
2006-10-04 11:22:18 +00:00
Artem Pavlenko
2f360a6549 1.removed map width/height from query interface
2.small cleanups
2006-09-12 14:29:22 +00:00
Artem Pavlenko
ffe47e4816 1. return shared_ptr from point_symbolizer
2. small cleanup
2006-05-26 13:11:31 +00:00
Artem Pavlenko
d0ddc88253 1. move parameters to datasource
2. general cleanup
2006-05-23 16:52:10 +00:00
Artem Pavlenko
61fd258fd1 changing licence from GPL to LGPL 2006-03-31 10:32:02 +00:00
Artem Pavlenko
8986108775 added set_datasource method (TODO!!!)
fixed pointz in shapeindex
2006-03-28 08:29:36 +00:00
Artem Pavlenko
ddaa9b5368 removed unused static gamma member 2006-03-22 15:57:12 +00:00
Artem Pavlenko
673bd4bc19 replaced cout and cerr with clog (by default redirected to cerr) 2006-03-19 21:53:47 +00:00
Artem Pavlenko
cba1063346 fixed label bbox calc 2006-03-08 23:03:19 +00:00
Artem Pavlenko
0f3fcc7f34 updated text symboilizer
fixed memory leak in FT_Glyph
2006-03-01 15:16:45 +00:00
Artem Pavlenko
3818da6bc5 added quad_tree implementaion 2006-02-27 21:25:25 +00:00
Artem Pavlenko
9de253198b 1.python bindings updated to reflect symbolizers changes
2.added label collision detector ( TODO - proper impl!)
2006-02-25 11:03:30 +00:00
Artem Pavlenko
1728bdbc7e added:
1. start/end map/layer handlers 
2. some cleanups
2006-02-21 20:17:08 +00:00
Artem Pavlenko
bd173527a0 added font_engine impl - work in progress:) 2006-02-21 19:55:24 +00:00
Artem Pavlenko
e3c1365043 some line rendering fixes and optimizations 2006-02-11 00:39:50 +00:00
Artem Pavlenko
aed5516197 1. new feature model - based on boost::property_map concept
f = feature(id);
       f["name"] = "what is my name?";
       boost.put(f,"area",123123.4325);
       
2. simplified and corrected value class and operators
3. updated input plug-ins to work with new features
4. add text_symbolizer (getting there:)
5. template version of agg_renderer 
6. attribute_collector how accepts rules 
	(to collect attribute names for text labels)
2006-02-10 17:13:02 +00:00
Artem Pavlenko
6a4070a32a added raster_symbolizer 2006-02-07 16:16:54 +00:00
Artem Pavlenko
af2601eea0 1. new style/feature processor abstraction allowing plugable backends.
(to construct custom 'Output' derive from feature_style_processor (CRTP) e.g
	class MyOutput : public feature_style_processor<MyOutput>
     and implement:
	 process(***_symbolizer const&, Feature const&)
     methods
   At the moment only AGG renderer is implemented
2006-02-07 14:41:41 +00:00