maposmatic-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Maposmatic-dev] Implementing bbox limitation


From: Maxime Petazzoni
Subject: Re: [Maposmatic-dev] Implementing bbox limitation
Date: Wed, 9 Sep 2009 07:51:37 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hi,

* Thomas Petazzoni <address@hidden> [2009-09-09 00:09:00]:

> Here is a patch that uses the spheric_sizes() method of
> ocitysmap.coords.BoundingBox to limit the size of the bounding box.
> Simple and efficient, for sure. The only drawback is that now,
> ocitysmap is required for the Web front-end (previously, only the
> maposmaticd daemon was using it).

Hum, too bad we introduce this extra dependency, but it's probably even
worse just duplicating the code of BoundingBox.

>  www/locale/fr/LC_MESSAGES/django.po |  260 
> +++++++++++++----------------------

It looks like I'm not the only one with a django-admin doing things
differently than the Davids'.

> +            bbox = BoundingBox(cleaned_data.get("lat_upper_left"),
> +                               cleaned_data.get("lon_upper_left"),
> +                               cleaned_data.get("lat_bottom_right"),
> +                               cleaned_data.get("lon_bottom_right"))
> +            (metric_size_lat, metric_size_long) = bbox.spheric_sizes()
> +            if metric_size_lat > 20000 or metric_size_long > 20000:

You could use constants here, defined in settings.py, like
MAX_BBOX_WIDTH and MAX_BBOX_HEIGHT ?

- Maxime
-- 
Maxime Petazzoni <http://www.bulix.org>
 ``One by one, the penguins took away my sanity.''
Linux kernel and software developer at MontaVista Software

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]