Wykres commitów

154 Commity (site-osm-baustelle)

Autor SHA1 Wiadomość Data
Hartmut Holzgraefe 448740ed23 additionally convert the PNG result into a medium quality JPG
for quicker download
2017-07-16 10:11:12 +00:00
Hartmut Holzgraefe 763a81fe6f support for SMTP login and SSL/TLS encryption
e.g. allows to use Google Mail for sending email notifications
2017-07-16 10:09:59 +00:00
Hartmut Holzgraefe 67e5a434c7 Merge branch 'site-osm-baustelle' of https://github.com/hholzgra/maposmatic into site-osm-baustelle 2017-07-01 13:21:22 +02:00
Hartmut Holzgraefe afdcf40cca handle gpx bounding box mode in render daemon 2017-07-01 11:13:56 +00:00
Hartmut Holzgraefe 1120801932 pass track bounding box mode to rendering component 2017-07-01 07:01:21 +00:00
Hartmut Holzgraefe 108264ad58 pass uploaded gpx track file to ocitysmap render subsystem 2017-05-24 00:33:29 +02:00
Hartmut Holzgraefe a4e8e9b2a8 pass complete GPX file pass to ocitysmap render subsystem 2017-05-22 21:53:54 +02:00
Hartmut Holzgraefe 27873de66d pass optional GPX track to ocitysmap rendering subsystem 2017-05-22 18:54:38 +02:00
Hartmut Holzgraefe b579abd207 raised default render timeout from 20min to 1 hour 2017-04-05 18:53:34 +02:00
Hartmut Holzgraefe 01ac04153d not selecting an overlay at all broke things as split still returns
an item in that case
2016-12-04 23:27:54 +01:00
Hartmut Holzgraefe 3d6f63284c support selection of multiple overlays 2016-12-04 18:08:58 +01:00
Hartmut Holzgraefe d0dcac5d82 preserve ocitysmap render error log and expose it on maps detail page 2016-11-15 10:04:39 +01:00
Hartmut Holzgraefe 52278a58bb added support for selecting an additional overlay stylesheet
(requires OcitysMap version that also supports overlays)
2016-05-06 19:06:16 +02:00
Hartmut Holzgraefe 9e082631ed more modifications to support more recent versions of Django (up to 1.8.x) 2016-03-29 10:51:33 +00:00
Hakan Tandogan bc4f62414f Handle all languages 2013-06-20 13:31:48 +02:00
Hakan Tandogan 1148ee7f73 Reset my own git config after perl script run 2013-06-20 13:28:22 +02:00
timsk c19329c32b Seperate git commits into own perl script 2013-06-20 13:25:38 +02:00
Hakan Tandogan c7ddef7241 Updated message key extraction script 2013-05-16 13:44:00 +02:00
Hakan Tandogan 16bd6f3051 Updated message key extraction script 2013-05-16 12:44:38 +02:00
Maxime Petazzoni 7ce34f3c79 Also extract JS translations (and fix one) 2013-04-28 10:00:03 +02:00
Hakan Tandogan 552f30c091 Updated message key extraction script 2013-04-28 00:05:00 +02:00
Maxime Petazzoni 9336cf28f8 Also extract JS translations (and fix one)
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2013-04-27 14:51:41 -07:00
Hakan Tandogan bfd363d12c Forcibly pull translations to support freshly cloned repositories 2013-04-06 11:56:43 +02:00
Hakan Tandogan bba7271822 Updated message translation fetching script 2013-04-05 02:03:00 +02:00
Hakan Tandogan e4f83cc676 Updated message translation fetching script 2013-04-05 01:28:12 +02:00
Hakan Tandogan 39cd0bc71c Updated message key extraction script 2013-04-05 01:09:11 +02:00
Hakan Tandogan 8ffac86ea0 Updated message key extraction script 2013-04-05 00:17:50 +02:00
Hakan Tandogan 04557a6245 Updated extraction script 2013-04-04 23:36:01 +02:00
Hakan Tandogan 63d295ab13 Centralized .gitignore configuration 2013-01-13 16:02:33 +01:00
Maxime Petazzoni 776ca54af2 Improve error message when RENDERING_RESULT_PATH is not set
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-05-10 08:54:13 -07:00
Maxime Petazzoni e546057f02 OCitySMap python module renamed from ocitysmap2 to ocitysmap
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-05-08 19:54:13 +02:00
Maxime Petazzoni 978cd51d33 Improve error message when RENDERING_RESULT_PATH does not exist
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-05-08 19:54:10 +02:00
Maxime Petazzoni a6f61af513 Rework configuration templates
Use the more traditional '.dist' extension for configuration templates
that are part of the MapOSMatic distribution. Update the installation
instructions accordingly.

Includes some style fixes in the INSTALL and template files, as well as
a fix to the wrapper script to correctly allow for an undefined log
location (defaults to stderr).

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-05-08 19:54:08 +02:00
Maxime Petazzoni 4fc890c8d5 Catch and log daemon exceptions
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-04-17 18:21:03 +02:00
Maxime Petazzoni 78c924a556 Cleanup rendering files in the parent to avoid database connection errors
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-04-17 18:19:59 +02:00
Maxime Petazzoni 826d6e05f2 Correctly report rendering exceptions when the subprocess dies
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-04-17 13:56:01 +02:00
Maxime Petazzoni c38da2eaf9 Fix Python typo
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-04-17 13:40:08 +02:00
Maxime Petazzoni be5cd186e7 Implement a forking rendering daemon
Bring back the forking mode to the MapOSMatic rendering daemon, used by
default. We have to do this because Mapnik keeps a cache of the
shapefiles loaded during a rendering, which is not suitable for the
long-running execution of a single-process rendering daemon.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-04-17 13:27:17 +02:00
Maxime Petazzoni a3213d2614 Move up _email_exception to clean up code
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-04-17 11:46:37 +02:00
Maxime Petazzoni 212241c60d Set content type and encoding headers in exception emails
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-04-13 11:51:15 +02:00
Maxime Petazzoni b99ce6f09e Sort job details in exception emails
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-04-13 11:46:15 +02:00
Maxime Petazzoni a459dcc39b Add Reply-To support to exception emails
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-04-13 11:44:09 +02:00
Maxime Petazzoni 804b934bd1 Improve job exception email with job details
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-04-13 11:40:32 +02:00
MapOSMatic developers c60b084427 Fix exception email sending
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-04-13 09:27:28 +02:00
Maxime Petazzoni 6ddbe66478 Use check_call to correctly throw exceptions and make rendering fail
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-04-12 22:13:22 +02:00
Maxime Petazzoni cef0749ff9 Send emails on rendering exceptions
Automatically send an email to the configured admins with a traceback of
the rendering exception when a rendering fails.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2012-04-12 22:12:53 +02:00
Thomas Petazzoni e11ab18b9e render daemon: do not render in unsupported formats
The settings_local.py file defines the RENDERING_RESULT_FORMATS which
contains the formats (PNG, SVGZ, PDF, CSV) in which the maps should be
rendered. However, depending on the selected rendering layout, some
formats may not be supported: typically, PNG and SVGZ are not
supported by the multi-page rendering layout.

Therefore, the daemon automatically renders the map only in the
formats that are the intersection of the formats choosen in
RENDERING_RESULT_FORMATS and the formats compatible with the rendering
layout.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
2012-03-31 19:32:09 +02:00
Thomas Petazzoni 95b3577045 Generate nice thumbnails for multi-page renderings
For multi-page renderings, the thumbnail was useless: it was the last
page of the index. Instead, we create with ImageMagick a small
thumbnail thats displays the cover page and overview page of the
multi-page PDF. We take into account landscape/portrait renderings to
combine those two images into a single thumbnail with a good ratio.

We directly use subprocess to run the ImageMagick commands, because
the Python ImageMagick API is so poorly documented that after spending
several hours trying to figure out which method to use, switching to
subprocess with ImageMagick commands turned out to be a more
reasonable solution.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
2012-03-31 18:42:02 +02:00
David Decotigny c0218f27ce Use ocitysmap's get_geometry_from_osmid
This patch makes sure that we can work on the exact same city envelopes
in maposmatic and ocitysmap: we now share ocitysmap's
get_geometry_from_osmid(). Previously, get_bbox_from_osmid crashed if
the osm ID was present multiple times in the polygon table, and
ignored the line table. This patch fixes both, by basing itself on
ocitysmap's 093b95bcf6f54e855b781a9ccd60ce8117b35976.
2010-10-10 16:02:39 +02:00
David Decotigny 11a2a537c2 Changed step order in map creation wizard
In d2-ocitysmap2, the zoom factor can be defined in the
stylesheet. This patch makes sure that the stylesheet is chosen before
proposing a list of possible paper sizes. Then it determines the
possible paper sizes from this stylesheet.
2010-09-19 17:22:22 +02:00
David Decotigny 4f749aa4f1 Updated nl translations from master 2010-09-19 15:52:20 +02:00
David Decotigny 13090ad1c7 Updated INSTALL and templates
Added a few instructions in INSTALL to test. Also added instructions
in the config templates to help customize the python search path.
2010-09-19 15:23:39 +02:00
Gaël Utard 4dae790d67 Fix a bug with ocitysmap config path
In settings_local.py, OCITYSMAP_CFG_PATH is set to None by default
and render.py put this value in a list before passing it to OCitySMap
constructor that compares it with None, not a list with a None item.

Signed-off-by: Gaël Utard <gael.utard@laposte.net>
2010-08-16 12:42:26 +02:00
Maxime Petazzoni bec82316bd Better usage of the OCitySMap API
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-08 11:29:50 +02:00
Maxime Petazzoni 9290104a8c Revamp logging in MapOSMatic
Rework the MapOSMatic logging setup to initialize both the maposmatic
and ocitysmap logging targets, and do so only once to avoid duplicate
logging messages.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-07 13:16:58 +02:00
Maxime Petazzoni 67b3eaf377 Merge branch 'fixes-from-thomas' into ocitysmap2-integration 2010-08-07 12:00:17 +02:00
Thomas Petazzoni 23413f0ff3 Implement the paper orientation selection
* The MapRenderingJob model has been modified: the paper size is no
   longer stored as a string identifying a particular paper format,
   but rather two IntegerFields are used to store the width/height in
   millimeters of the paper. This allows to support "Best fit" paper
   size.

 * The MapRenderingJobForm is extended to offer a paper orientation
   selection form, with portrait/landscape selection.

 * The /apis/papersize/ service now returns all informations given by
   OCitySMap on allowed paper sizes, and not only the name of the
   allowed paper formats.

 * As the "paper size" panel is now used to also select the paper
   orientation, it is renamed to "step-paper" instead of
   "step-paper-size".

 * A bunch of Javascript code is used to update the orientation
   selector depending on the selected paper format.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-07 11:58:44 +02:00
Gaël Utard e3bf757a1b Add a .gitignore file in the scripts/ directory.
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-07 11:56:32 +02:00
Gaël Utard 8745da36d0 Add a .gitignore file in the scripts/ directory.
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-07 09:34:34 +02:00
Maxime Petazzoni 5b715f43af Re-generate the PNG thumbnail
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-06 12:14:30 +02:00
Maxime Petazzoni 1ac3c7d22c Use OCitySMap v0.2
Use the new OCitySMap rendering module in MapOSMatic.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-08-05 23:53:09 +02:00
Maxime Petazzoni 919373d351 Dump exception traceback when a rendering exception occurs
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-06-30 15:48:55 +02:00
Maxime Petazzoni 23f17a1c2f Small tweaks to the DBCK utility
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-03-20 14:01:15 +01:00
Maxime Petazzoni b7554583b4 Fix
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-03-16 17:09:35 +01:00
Maxime Petazzoni 67f5990324 Handle exception during data preparation
The renderer threads did not handle exceptions happening during the
data preparation phase. This commit fixes this, avoiding the daemon to
vanish when asking a rendering that fails (most common cause is GEOS
intersect errors).

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-03-16 16:45:58 +01:00
Maxime Petazzoni 87877adaaa Provide thread names
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-02-24 12:37:18 +01:00
Maxime Petazzoni 85d7afc55e Display the exception when a rendering fails
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-02-24 10:19:21 +01:00
Maxime Petazzoni b128d5a7f4 Really kill worker threads on timeout
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-02-14 16:02:31 +01:00
Maxime Petazzoni 90a5e6ba43 Database check/repair utility for MapOSMatic
This dbck utility, run through the environment wrapper, checks and
cleans the MapOSMatic job database. This first version provides the
following checks/repairs capabilities:

  * obsolete status
  * mutually exclusive admin/bbox data
  * missing map language

A --dry-run option is also available to only look at what operations
would be done.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-02-14 10:06:01 +01:00
Maxime Petazzoni a8c3ef934e Exclude thumbnails from the list of considered files for cleanup
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-02-14 10:06:01 +01:00
Maxime Petazzoni a05ba91777 Revamp the job renderer module with timeout support
The render module, originally a simple extract of the render_job
function from the old daemon, has been rewriten to expose a more
sensible API and to provide self-contained timeout support.

Two classes are now available, exposing the same public API for seamless
use of any of the two:

  * JobRenderer is a simple, blocking job renderer. It can be threaded
    if the caller decides to call start() instead of run().
  * TimingOutJobRenderer, as its name suggests, is a timing out job
    renderer that makes use of the threading capability of JobRenderer
    to handle a timeout on the rendering process and kill the rendering
    thread, whatever it is doing, if the given timeout is reached.

The render module also now exposes a few public RESULT_ constants that
can be used to identify the result of a job rendering. This is used in
the daemon to infer an appropriate resultmsg.

As a standalone process, the job renderer now takes an optional second
argument: the timeout, in seconds.

  .../scripts/wrapper.py scripts/render.py <jobid> [timeout]

As of now, the daemon is fully usable in production with the same level
of functionality as before.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-02-14 10:06:01 +01:00
Maxime Petazzoni 37ab334d9a Cornerstones for a new MapOSMatic daemon
This is the first step of the rewrite of the MapOSMatic rendering
daemon. The long-term objective is to get a more flexible rendering
daemon that would support the rendering of several jobs in parallel, and
with an overall more Python-y and maintainable code.

This first shot brings a completely new, simpler MapOSMatic daemon with
the same level of functionality as the previous daemon in terms of
serial rendering of the job queue. Three major changes happen here:

  1. the bash-based wrapper script has been removed, in favor of a more
     clever Python wrapper. Cleaner, and more importantly more portable.
     The wrapper still needs a bit of configuration, and after the
     config.py-template has been tweaked into a valid config.py file,
     the daemon can be started by:

       .../scripts/wrapper.py scripts/daemon.py

  2. the externalization of the rendering routine into a 'render'
     module. This module does not access the database - only the daemon
     does. The sole purpose of the render module is to encapsulate the
     rendering process and its errors+exceptions handling.

     It can also be used as a standalone, job-ID-based renderer:

       .../scripts/wrapper.py scripts/render.py <jobid>

  3. the cleanup mechanism now runs in a separate thread, in the
     background.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-02-14 10:05:54 +01:00
Maxime Petazzoni cf3ae043fe Improve the file cleanup mechanism
Previously, when the rendering directory was over the defined threshold,
files where removed progressively, oldest first, to make up some space.
No information was kept about jobs whose files were removed, making it
harder to keep track of valid jobs with files available.

This change introduces two new things:

  1. a new job status, 3, for jobs processed but now without files, or
     "obsolete" jobs.
  2. a new cleanup mechanism that considers jobs as the atomic unit of
     cleaning instead of files, as this would leave with jobs without
     all their renderings (which didn't make much sense).

The cleanup function underwent the following modifications:

  * files are now sorted by content modification time and not last
    metadata change (a simple chmod could mess up the order);
  * thumbnails are excluded from the list of considered files for
    removal (this is still is discussion, but for now let's keep them);
  * when a file needs to be removed, all files from its parent job are
    removed and the job's status is set to 3 (see
    MapRenderingJob#remove_all_files).
  * if no parent job can be found, it's an orphaned file and can be
    safely removed. Files starting with a '.' are of course preserved;
  * some logging improvements during the cleanup phase.

New 'job-done-obsolete' and 'job-error-obsolete' status icons are now
available, and the status icon filename is now inferred with a custom
template tag (this also led to some cleanup in extratags.py).

The file size of the renderings is also displayed next to each format in
the job information.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-02-10 21:27:37 +01:00
Maxime Petazzoni 0f34678056 Provide a map_areas_prefix to the OCitySMap constructors
Following the API change in OCitySMap to improve paralellization of
OCitySMap rendering processes, we now need to provide the prefix to the
map_areas table name. We use here 'maposmaticd_PID_'.

Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
2010-02-10 21:13:03 +01:00
David Decotigny dd1897701a Improved exception logging 2010-01-12 17:55:21 +01:00
David Decotigny efa0b33503 Better example maposmaticd.sh example script
This script shows how to configure the server so that the log messages
go to the same logging output for both ocitysmap and maposmaticd.
2010-01-12 17:54:55 +01:00
Thomas Petazzoni 0c6c5fa7bf OSM id based rendering support in maposmaticd
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2009-12-21 12:06:29 +01:00
David MENTRE bae1265335 First support to select map index language into maposmatic
* You need to drop maposmatic_maprenderingjob table and run a manage
  syncdb.

* The selection of Belgian languages will crash current ocitysmap.
2009-12-20 22:28:11 +01:00
David Decotigny 1574987b57 FIXED: file-descriptor leakage.
Each time the daemon serviced a request, it would forget to close the
writing endpoint of the child-father pipe, causing it to refuse to
service more than ca. 1024 requests. This patch fixes this bug.
2009-12-01 21:22:47 +01:00
David Decotigny a728972fc1 Cosmetics for debug messages.
Add a few debug messages as normal logging output instead of "print".
2009-12-01 21:22:37 +01:00
Thomas Petazzoni 9ab99e235a Take into account the configuration file correctly
The configuration file for OCitySMap wasn't taken into account for
renderings based on administrative boundaries.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2009-11-15 20:08:00 +01:00
David Decotigny 0990dc7cc2 Allows to specify non-default ocitysmap config file
By default, the maposmaticd daemon was reading the default ocitysmap
configuration (~/.ocitysmap.conf or /etc/...). This patch allows to
specify a path to another ocitysmap config file from within
settings_local.py.
2009-09-28 20:19:26 +02:00
David Decotigny d5ec6bfc10 Importing ocitysmap elements the right way.
The daemon needs to be updated in order to update ocitysmap the right way.
2009-09-11 23:55:12 +02:00
David Decotigny 517cc13369 Get rid of spurious log messages
Should allow ocitysmap to post its log messages from within
maposmaticd, and should get rid of the 'no handler for logger
ocitysmap' message.
2009-09-11 12:22:56 +02:00
David Decotigny 2d08fcd510 Redirect any rendering error messages from the child process to the logs.
This patch tries to store any crash info coming from the child
rendering processes into the log file.
2009-09-11 12:22:42 +02:00
Maxime Petazzoni 8e1013fba8 Create nicer thumbnails 2009-09-09 17:52:29 +02:00
Thomas Petazzoni 7e1865dd91 Implement thumbnail generation and beginning of maps page 2009-09-03 08:55:23 +02:00
David MENTRE 5b195c6178 Put maposmatic under AGPLv3 license 2009-08-31 19:36:21 +02:00
David Decotigny d26f763ff9 renamed render_into_files -> render_map 2009-08-30 01:12:49 +02:00
Thomas Petazzoni e356483c7c Fix generation using bounding box coordinates 2009-08-29 22:56:37 +02:00
David Decotigny be1bee4a8f fixed forgotten import 2009-08-29 21:17:50 +02:00
Thomas Petazzoni 764404012e Removing debugging 2009-08-29 19:44:27 +02:00
David Decotigny 738cd645ca fixed log typo 2009-08-29 19:35:12 +02:00
Thomas Petazzoni 1794bdd19d Merge branch 'master' of git://pollindd.local/maposmatic/ 2009-08-29 19:16:32 +02:00
David Decotigny 83b8aa0157 added template for daemon startup script 2009-08-29 19:15:42 +02:00
David Decotigny 37ccc94c60 changed log infrastructure : single LOG object confiugrable through settings 2009-08-29 19:13:17 +02:00
Thomas Petazzoni bf43a91081 Remove NOHANG in call to waitpid()
This allows to wait for the child process to tell us about its failure
(otherwise we consider it as a success).
2009-08-29 18:57:54 +02:00
Thomas Petazzoni 075676c16f Implement the file cleaning procedure 2009-08-29 18:30:35 +02:00
Thomas Petazzoni 2b13d8bc3f Support multiple rendering formats and display links to generated files 2009-08-29 17:23:11 +02:00
Thomas Petazzoni 331d738c89 Switch to a better logging facility
We now have separate logging for the web service (logwww) and the
daemon (logdaemon). They can be configured separately in the
settings_local.py file.
2009-08-29 16:40:31 +02:00