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')
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
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.
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!
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
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)
(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