Wykres commitów

63 Commity (5682422e2fc43a0f1f565ee15e14c982a623a2db)

Autor SHA1 Wiadomość Data
Maxime Petazzoni cb4d258d2e Implement street index layout
Implement all functionality for rendering the index in a specified
graphical area. The index automatically shrinks to the minimum space it
needs by adjusting one of the dimension (passed as a parameter).

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-07 00:22:03 +02:00
Maxime Petazzoni a9ba85ea1f Fix PNG rendering
The layout renderers now work in a unitless fashion where dimensions are
expressed in "dots". A RenderingSession object defines and stores how
dots are obtained from typographic/printing points depending on the
provided DPI.

The DPI for vector-based surfaces is set to 72, because a typographic
point is 1/72th of an inch. For PNG surfaces, its value is configurable
in the OCitySMap configuration as 'png_dpi' in the 'rendering' section.
It defaults to 300dpi.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-06 12:04:20 +02:00
Maxime Petazzoni ebc7a51d3c Automatic portrait/landscape orientation
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-06 10:03:22 +02:00
Maxime Petazzoni 148aa82641 Lazy database connection in OCitySMap
Only connect to the PostGIS datasource when needed so OCitySMap objects
can be instancied and used without connecting to the database if it is
not required.

Remove some debugging messages, and tweaks to the layout renderers
registry.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-06 10:00:46 +02:00
Maxime Petazzoni 7858037fac Cleanup and documentation
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-06 10:00:03 +02:00
Maxime Petazzoni 92bbb4b713 Implement stylesheet configuration parsing and registry
Parse the stylesheet definitions (we'll support several Mapnik
stylesheets, eventually from contributors) from the OCitySMap
configuration file. Provide a registry to list and access them.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-06 09:49:12 +02:00
Maxime Petazzoni a7b9382bd7 Implement a renderers registry in the renderers module
OCitySMap now provides a quick public API to get the list of all
implemented layout renderers, or to get one directly by name. Renderer
classes are returned, not instances.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-06 09:45:30 +02:00
Maxime Petazzoni 5b51658254 Draw grid labels in the PlainRenderer
Grid labels (letters horizontally, numbers vertically) are now drawn
directly in Cairo. The plain renderer draws them outside of the map area
in a small margin. Other renderers may choose to do otherwise (directly
on the map area, not displaying them at all, etc.).

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-06 09:40:39 +02:00
Maxime Petazzoni 07eb3a9690 Re-implement the grey shading
When rendering an administrative boundary, we overlay a transparent grey
shade around the city.

A WKT MULTIPOLYGON is created from the corrected bounding box and the
administrative boundary (as an inner hole). A shape file is then created
from this polygon and added to the rendering.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-06 09:35:24 +02:00
Maxime Petazzoni 7707cdf37e Make the OCitySMap object actually render maps
Integrate the main OCitySMap object to the layout renderers so it can
render maps. Renderers now work in typographic points.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-06 09:30:12 +02:00
Maxime Petazzoni 04ed36dd85 Automatically adapt the geographical bounding box to the paper size
After a compatible paper has been chosen, the geographic bounding box
requested for rendering (or the bounding box of the administrative
boundary requested) doesn't fill the paper entirely. The bounding box is
thus extented by Mapnik into a corrected bounding box, corresponding
exactly to what is rendered on the paper.

The bounding box used by the Grid object is also slightly expanded to
accomodate for the small imprecisions of the various projections, which
made the grid lines not fill the bounding box entirely.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-06 09:18:56 +02:00
Maxime Petazzoni 35e9fcac8f Continue heavy work on OCitySMap 2
Re-implement configuration file parsing to get access to the database.
The request timeout is now configurable in the 'datasource'
configuration section as 'request_timeout'. It defaults to 15 minutes.

Re-integrate the i18n and languages support.

Re-implement the map grid support. From the corrected geographical
bounding box, the Grid object can generate an ESRI Shapefile with the
grid lines. The grid size automatically adjusts to lower sizes if the
bounding box is smaller.

Stub implementation of the StreetIndex object that will handle data
gathering, outputting as CSV and rendering into a given surface.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-06 09:04:20 +02:00
Maxime Petazzoni ddd59b11f9 Foundation for the new OCitySMap rendering module
This new OCitySMap version aims at providing a more print-oriented
map rendering engine.

Its main features include being aware of paper sizes and constraints,
but also providing different "renderers" implementing rendering layouts
for the maps. For now, only the PlainRenderer which renderers a
full-page map is implemented, but renderers that also generate an index
will be available.

The main idea is that we no longer generate a separate index. The
generated map includes (or not) an index depending on the rendering
layout used to render it.

Finally, each renderer is able to tell which paper sizes are compatible
with the bounding box from a "geographic" resolution.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-06 08:48:07 +02:00