Wykres commitów

63 Commity (5682422e2fc43a0f1f565ee15e14c982a623a2db)

Autor SHA1 Wiadomość Data
Thomas Petazzoni 82ab5d0286 Revert "Add the jobid in the temp directory prefix"
This reverts commit 668b02ae93.
2012-04-23 21:17:31 +02:00
Thomas Petazzoni af2aa4a985 Revert "Fixup syntax typo in previous commit"
This reverts commit c10e75b147.
2012-04-23 21:17:21 +02:00
Thomas Petazzoni 53735e2815 Revert "Add the jobid in the temp directory prefix"
This reverts commit 1b2cfcbcd8.
2012-04-23 21:17:14 +02:00
Thomas Petazzoni 1b2cfcbcd8 Add the jobid in the temp directory prefix
This is committed only for debugging purposes, to help us investigate
the file descriptors leak problem.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
2012-04-16 11:39:11 +02:00
Thomas Petazzoni c10e75b147 Fixup syntax typo in previous commit
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
2012-04-16 11:33:51 +02:00
Thomas Petazzoni 668b02ae93 Add the jobid in the temp directory prefix
This is committed only for debugging purposes, to help us investigate
the file descriptors leak problem.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
2012-04-16 11:30:00 +02:00
Gael UTARD e34791cd55 Remove dead code about zoom_level
Signed-off-by: Gael UTARD <gael.utard@kisis.fr>
2012-04-01 01:46:31 +02:00
David MENTRE 2a4109f41a Move street index creation into single page renderer
Signed-off-by: David MENTRE <dmentre@linux-france.org>
2012-03-31 22:59:10 +02:00
Étienne Loks fa81ce86a8 multi-page: add a more suitable style for shade of outside town 2012-03-31 16:39:41 +02:00
Gael UTARD ad1eb8789f Reduce multipage grid line width
Signed-off-by: Gael UTARD <gael.utard@kisis.fr>
2012-03-31 02:02:22 +02:00
Étienne Loks 8f2b75d4ab Fix name grouping in the index 2012-03-31 02:02:21 +02:00
Gael UTARD 99a6e16095 Move the background setting to the renderer
And fix it by the way when png_dpi != 72.

Signed-off-by: Gael UTARD <gael.utard@kisis.fr>
2012-03-30 18:20:48 +02:00
Thomas Petazzoni be146e3a76 renderers: pass the db connection to the Renderer class constructor
For the multi-page renderer, we need a reference to the GIS database
connection in order to build custom indexes for each page of the
map. Therefore, we modify the Renderer constructor so that it takes as
argument a reference to the database connection.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
2012-03-30 13:04:21 +02:00
Gael UTARD bec711df89 Remove the scaling step from the rendering process
There are 2 kinds of problems with scaling:
- the rendering has some bugs (position of arrows, text halo)
- the rendered sizes (font size, road width) do not match the ones specified
  in the stylesheet

Signed-off-by: Gael UTARD <gael.utard@kisis.fr>
2012-03-30 10:21:23 +02:00
Gael UTARD a5fdf509c4 Set a solid white map background
The transparent background is rendered with grey by some softwares.

Signed-off-by: Gael UTARD <gael.utard@kisis.fr>
2012-03-30 10:15:09 +02:00
Thomas Petazzoni 1f115962da ocitysmap2: show OSM data last update timestamp on rendered maps
We use the maposmatic_admin table that is now part of the GIS database
and updated by the planet-update.sh script to show the timestamp of
the OSM data on rendered maps. If this table does not exist, we
gracefully fallback to an "unknown" timestamp, so that the rendering
doesn't fail.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
2012-03-25 21:11:16 +02:00
Étienne Loks 01b7253e07 Index improvment: group locations whith the same name and the same position 2012-03-25 17:55:42 +02:00
Thomas Petazzoni d27a323fda config: make it possible to configure the port to connect to the GIS database
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
2012-03-25 11:28:28 +02:00
David Decotigny aafa11268b Fixed references to Poygon ctor in shapely 2010-10-11 10:11:16 +02:00
David Decotigny 5d121d4587 Accept empty indexes
This patch allows ocitysmap to support empty indexes (empty areas).
2010-10-10 16:01:37 +02:00
David Decotigny 093b95bcf6 Support for complex city envelopes
Some OSM Ids such as 365634 have several entries in the polygon/line
tables. The original maposmatic code crashed because it assumed only
one entry was in the DB, and the ocitysmap code only considered the
1st entry returned by postgis.

This patch allows to work on the union of all the areas returned by
the polygon and line tables.

It adds another dependency: shapely. This allows to call libgeos
functions from within python. This also calls for some code
refactoring (=> TODO): the coords et al. API should be replaced by the
plain shapelib API
(http://gispython.org/shapely/docs/1.2/manual.html).
2010-10-10 15:54:55 +02:00
David Decotigny f595f4520d Updated for compat with maposmatic 2010-09-19 17:18:48 +02:00
David Decotigny b46e66b7cc Make sure PostGIS is >= 1.5
Raise an AssertionError when postgis is not >= 1.5.
2010-09-11 15:27:38 +02:00
David Decotigny a3286243a2 Command-line frontend.
Implemented ocitysmap2-render command-line frontend. Tested it on
Chevreuse (OSM ID -943886) with many possible cmdline option
combinations. Default layout is now map with index at bottom.
2010-09-11 15:14:03 +02:00
David Decotigny 04377283a9 Major reorganization, new maplib/indexlib/layoutlib hierarchy
New maplib (map creation routines), indexlib (index creation routines)
and layoutlib (page layout & rendering) structure. Besides moving
files around, a new layoutlib.commons module has been create to host
the mm to/from pt conversion routines.
2010-09-11 12:31:08 +02:00
David Decotigny 0d165fb78a Support ps.gz output 2010-09-05 20:30:28 +02:00
David Decotigny 1c26a805ba more verbose 2010-09-05 20:28:28 +02:00
David Decotigny abb04dd4bf pure cosmetics 2010-09-05 20:27:47 +02:00
David Decotigny 524c7baca5 Support for PNG output identical to PDF
This has not been so easy because:
 - we need some kind of scaling because by default 1 pt in PDF = 1 px
   in PNG... And we would prefer to have 1 pt in PDF = 300/72. px
   (assuming PNG is 300dpi)
 - we cannot call ctx.scale() before rendering the index because pango
   takes the transformation matrix into account when it chooses the
   font metrics. So with ctx.scale(), we could have the actual font
   metrics different from those computed in
   precompute_index_occupation() { which is called on a PDF surface by
   SinglePageRenderer::render() }.
 - we cannot render to a 72dpi vector surface (eg. PDF) and then
   project it with a scaling factor onto a 300 DPI PNG surface,
   because the result is ugly (pixelized)
 - we cannot push_group()/post_group().set_matrix(xx=factor,
   yy=factor=)/set_source() for the same reasons (pixelized)

So the solution we adopt is to trick pango into believing it is
rendering without any scale factor, which for us corresponds to a
72dpi resolution, and which for it corresponds to a 96 dpi cairo
resolution (see sources): this should always generate the same font
metrics as precompute_index_occupation() did. Then we tell it that the
cairo resolution, instead of being 96dpi as it assumes, is
96*desired_resolution/72. This is what this patch does.

One more note: we don't use an ImageSurface cairo surface for PNG
output because, for some other reason, it leads to different font
metrics. So, for PNG, we do use a PDF cairo surface !...
2010-09-05 19:06:37 +02:00
David Decotigny bbce200910 Demonstrate rendering with all possible output formats 2010-09-05 12:39:33 +02:00
David Decotigny 93a58eca87 Minor index rendering fiexes + cosmetics + comments
Fixed a trivial function name bug in __init__.py and a few index style
issues with the margins around the index. Added comments and reorder
the drawing operations to make sure the rectangle are printed last.

As a result, all 3 page layout renderer work in vector format... but
NOT in raster because the layout preparation is entirely based on
vector rendering engines even if the actual rendering engine is
raster... and both seem to handle font parameters differently.
2010-09-05 12:29:49 +02:00
David Decotigny 538ccfe92d Prepared 3 renderers, out of which only SinglePageRendererNonIndex has been tested
This patch defines a generic SinglePageRenderer renderer which is able
to render a single page without an index, with an index on the side
(on the right for non RTL languages, on the left for RTL) or with an
index at the bottom of the page. This generic renderer is subclassed
to define the SinglePageRendererNoIndex ("plain") class, the
SinglePageRendererIndexOnSide ("single_page_index_side") class,
SinglePageRendererIndexBottom ("single_page_index_bottom").

IMPORTANT: Only SinglePageRendererNoIndex has been tested and leads to
the exact same result as before. Chances are that the index rendering
doesn't work for raster cairo devices, because of the lack of DPI
support in the index rendering API.

The RenderingConfiguration has a new "i18n" field, setup by render()
and which replaces rtl: corresponds to the language used in the
rendering.

Added docstrings.

Note: the struct placeholder mechanism implemented in previous patch
has been dropped, in favor of a much cleaner API with only 2
parameters passed (w_dots, h_dots).
2010-09-04 19:48:51 +02:00
David Decotigny 81d0afa312 Major refactoring of the main rendering process
The RenderingSession system has disappeared in favor of a much simpler
ctor()/render() API for the Renderers. As a consequence, it's the job
of each renderer to create the grid, the map_canvas and the index
renderer (if any). But this is needed because the renderer is in
charge of the page layout, which impacts the way the map_canvas is
rendered and which depends on the index. Potentially every renderer
need to manage the chicken-and-egg problem in their own way. Of
course, now this ctor takes a street_index as parameter, which allows
it (by way of an index renderer) to update the global layout depending
on the size of the index.

For now only the PlainRenderer has been updated. It users an object
placeholder to replace the RenderingSession object. This object
placeholder allows one to define a set of attributes and to access
them through the standard dotted notation. This object has a meaning
only internally to the PlainRenderer::render(). We don't define a
global structure like RenderingSession in order not to pollute the
code with global names. And such an object placeholder is only a
private placeholder for render() and the function it calls, to avoid
having to write 6235 arguments to pass the helper functions it calls.
2010-09-02 23:43:24 +02:00
David Decotigny 230e2ccda2 Updated doc and simpler object for StreetIndex objects
This patch makes the ctor args minimal for the StreetIndex indexer
objects, and also drops the ref to the DB after the object has been
created. Also cleans up the rendering process a bit (WIP, still).
2010-09-02 21:20:39 +02:00
David Decotigny 362a0f8812 write to csv reimplemented
Signed-off-by: David Decotigny <david@decotigny.fr>
2010-08-15 16:37:21 +02:00
Maxime Petazzoni ec9f38cfbb More cleanup
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-08 12:36:48 +02:00
Maxime Petazzoni 42c360378f Provide a unified way to get bounding box and contour from OSM IDs
The new get_geographic_info method in OCitySMap allows one to query the
PostGIS database for the commonly-needed geographic information about a
set of OSM IDs.

This is used by OCitySMap itself, of course, for map rendering when it
needs to find the bounding box and contour of the requested OSM ID. This
will also be used by the Nominatim search gateway in MapOSMatic in the
near future.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-08 12:36:48 +02:00
Maxime Petazzoni f776df2938 Improve OCitySMap's API and documentation
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-08 12:36:27 +02:00
David Decotigny bacb8e42a0 fixed todo + dead code 2010-08-08 09:47:06 +02:00
David Decotigny ebb9e6ca01 Integrate street index api + tests 2010-08-07 21:40:49 +02:00
David Decotigny b9850b4ce5 Cosmetics: nicer use of coords API
We use BoundingBox::as_wkt() to build the surrounding rectangle for
the shade.

Signed-off-by: David Decotigny <d2@maposmatic.org>
2010-08-07 21:39:38 +02:00
Maxime Petazzoni 31c198f60a Starting cleanup of the renderer code
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-07 21:37:46 +02:00
Maxime Petazzoni fb9fb66d66 More work on the plain renderer
Fix the automatic font size calculation for the title and the copyright
notice.

Fix the placement, size and display of the copyright notice.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-07 20:45:23 +02:00
Maxime Petazzoni 8bfe936eb2 Improving the plain renderer's layout
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-07 19:10:04 +02:00
Maxime Petazzoni 355815b56c Cleanup and documentation
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-07 19:10:04 +02:00
David Decotigny f83fe95126 Unit test uses relative paths for config files
Signed-off-by: David Decotigny <d2@maposmatic.org>
2010-08-07 13:16:54 +02:00
David Decotigny 5885e3a630 Rearranged files and sources for index rendering
Signed-off-by: David Decotigny <d2@maposmatic.org>
2010-08-07 12:39:39 +02:00
Maxime Petazzoni 54d5c4073f Cleanup and documentation
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-07 11:52:39 +02:00
Maxime Petazzoni 7b1e07d292 Re-integrating index data requests
Start working on re-integrating the SQL queries to feed the index (not
functional right now).

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-07 09:49:12 +02:00
Thomas Petazzoni c0e5d094dd Change how the configuration files path are passed to OCitySMap
Instead of having to pass a list, we can now also pass just a single
string or None, in which case a default set of config file paths will
be tried.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-07 09:18:27 +02:00