One per-line, sorted alphabetically. We keep imports of standard
Python modules separated from imports of OCitySMap specific modules.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
We introduce a isrtl() method in the i18n classes. By default, this
method returns False (for non-RTL languages), but RTL languages can
return True to enable the RTL rendering mode for the map and the
index.
For now, the RTL mode :
* Changes the rendering of the index columns: the first column is on
the right.
* Changes on index entries are rendered: the street name is on the
right while the location on the map squares is on the left.
We must ask Arabic person to know whether the square on the map should
also be rendered from right to left (i.e column A on the right).
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
This allows Arabic or Korean characters to be rendered properly.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
Previously, the map_areas table name was taken from the ocitysmap.conf
configuration file (from the wrong section when compared to the provided
configuration file example...), falling back to a sensible default. This
didn't really help make things easier to run several ocitysmap rendering
processes in parallel, as they would need separate, pre-existing
configuration files.
A table name prefix can now be provided to the OCitySMap initalization
function instead of through the configuration file. The map_areas table
name is then constructed from this prefix with '<prefix>map_areas'.
Example prefixes are: 'RENDERERNAME_PID_', 'myjob_', 'another_'.
The temporary table is also now automatically cleaned up after
processing (failing or not).
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
This patch adds support for some of the caveats in maps of Poland
generated from ocitysmap. Probably more will be needed.
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
The set of languages is deduced from locale/ directory content.
Usage: i18n.py [options]
WARNING: This program should be called from ocitysmap/ directory!
Options:
-h, --help show this help message and exit
-P, --make-pot make locale/ocitysmap.pot
-p, --make-po merge locale/ocitysmap.pot with
locale/*/LC_MESSAGES/ocitysmap.po
-m, --compile-mo compile locale/*/LC_MESSAGES/ocitysmap.mo files
-n LANGUAGE_CODE, --new-language=LANGUAGE_CODE
create .pot file for a new language. LANGUAGE_CODE is
like "fr_FR".
Django relies on psycopg2 for its postgres backend, whereas ocitysmap
was using another (pgdb). This patch addresses task #9666: it removes
the pygresql dependency and changes it for psycopg2.
The major part of the patch deals with unicode issues, because
psycopg2 can handle unicode strings directly. Actual;ly, that's what
it does when it is being used along django. So we force this same
behavior as well when we run ocitysmap in plain "command line" mode.
Added comments as to what the Dutch class is actually doing.
Added more titles to capture as prefixes.
Added handling of counting words, e.g. "1e Walstraat" => "Walstraat (1e)"
Signed-off-by: Jeroen van Rijn <jvrnix@gmail.com>
This is a first attempt at building an index for Arabic language.
Prefixes have been provided by Bassem JARKAS. The regexp might need some
tweaking.
Do not forget to do "sudo locale-gen --lang ar" on Ubuntu machines.
The patch sets the statement_timeout parameter for the ocitysmap
sessions to 18mn. This should be enough. I checked that an exception
is raised when the timeout appears (=> ocitysmap crashes
immediatly). The other sessions (eg. osm2pgsql) should not be
affected. Issue "show statement_timeout" on a new DB connection to
make sure (should reply '0').
This is a "quick and dirty fix": the timeout should be configurable
from a config file or from the cmdline. For now it's hard-coded in
street_index.py.
Patch by David Decotigny <d2@maposmatic.org>