On the Nominatim proxy side:
* Instead of doing complex filtering/sorting on Nominatim results, we
do a simple filtering on "places", in a fixed list. Results are
kept sorted in Nominatim order.
* Nominatim results are enriched with a validity field, and reason
fields for non-validity (like "no admin boundary" or "area too
large").
* Nominatim results are also enriched with fields that allows to know
whether previous/next entries are available through Nominatim (when
the search returns more than 10 entries)
* Simplify the query_nominatim() view arguments. It now takes all
arguments through GET. 'q' for the query, 'exclude' for the set of
places to exclude.
The Nominatim proxy code has also been split in several subfunctions
for easier readability.
The JavaScript code is updated accordingly:
* Display the Nominatim icon as the list bullet. The bullet is not
visible yet due to CSS issue.
* Use the new valid/reason/reason_text fields of result entries to
determine whether an entry is valid or not, and show why it isn't
valid.
* Show prev/next buttons that trigger another Ajax query to get the
next/prev results.
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
Remove the overhead of parsing blog entries when generating the rss
feed. This saves a lot of CPU.
Signed-off-by: Gaël Utard <gael.utard@laposte.net>
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
The service added aims to query (lat/lon) Nominatim, fetch the resulting
XML, parse it, then returns it into JSON.
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
This service receives by post either a (osmid, layout) or a (bbox,
layout) and is responsible for asking OCitySMap what are the possible
paper size for the given geographic area. As OCitySMap doesn't
implement this feature yet, it is only a skeleton that returns a fixed
set of paper sizes.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
This change introduces the job cancel feature as requested in bug #28488
(https://savannah.nongnu.org/bugs/?28488).
To do so, a new field called 'nonce' is added to the MapRenderingJob
model object (which results in a new column in the database, see below
how to recreate/update a current database). A random string, called the
nonce, is generated when the job is created and stored alongside the
other information on this job. The user is then redirected to the
/jobs/ID/NONCE page, instead of simply /jobs/ID.
As long as the user provides the correct nonce at the end of the URL, he
will have the ability, if the job is still in the queue, to cancel the
job request. The button to cancel the request is shown if and only if
the user provides the matching nonce string in the URL, which is only
displayed when the job is created.
A new job state is also created (4, Cancelled) to match this new
cancelled state.
As far as the database change goes, the easiest if you are only doing
development is to drop your database and recreate it with syncdb. If you
need to keep your data, you can simply add the column to the
maposmatic_maprenderingjob table using the following statement:
ALTER TABLE maposmatic_maprenderingjob ADD COLUMN
nonce varchar(16) NOT NULL;
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
Acked-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
As discussed with the previous patch, the pagination by
letter is removed. It was too difficult to maintain with
non latin alphabet and it is now useless with the search being paginated.
Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@enix.org>
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
Each completed job now features a "Recreate map" button that reschedules
a similar map on the queue. The button only appears for completed maps
(status >= 2), and triggers a rendering_already_exists() check before
creating a new MapRenderingJob.
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
This change introduces a RSS feeds for the successfully rendered maps
that still have their files available (status=2) from the last 24 hours
(or more to get at least 10 items when possible), using the Django
syndication framework.
It uses a custom map-feed.html template instead of the map.html in order
to include styling information directly in the HTML an accomodate for
the variable naming from the syndication framework.
This new MapOSMatic maps feed is now available from a traditional RSS
icon link on the maps page.
Signed-off-by: Maxime Petazzoni <maxime.petazzoni@bulix.org>
Adds a by-letter browsing mechanism for maps, with local by-letter
paginators, accessible by /maps/[A-Z].
Some URL mapping cleanup and Django-isation, too.
Add a new Language menu on the left to allow the selection of any of
the supported languages. The list of supported languages is in the
settings.py file and is related to the .po files available in locales/.