[Top][All Lists]

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

Re: [Maposmatic-dev] PostGIS help for MapOSMatic

From: Maxime Petazzoni
Subject: Re: [Maposmatic-dev] PostGIS help for MapOSMatic
Date: Sun, 28 Feb 2010 15:09:24 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

Hi all,

* Thomas Petazzoni <address@hidden> [2010-02-27 12:36:40]:

> Inside of writing a long e-mail, I've written a detailed explanation of
> the request, the problem and the analysis we've done so far at

Although this is a "naive" solution, for the archives I'd like to write
down in this discussion thread a potential solution we discussed this
morning on IRC with Thomas.

From what I understand in the wiki page, we have good performance on the
request when using a full parametrized POLYGON(...) string and
GeomFromText. The solution would be to make a first, preliminary query
to get this POLYGON(...) from the database for the city we wish to

In all subsequent requests (street names by square, amenities, etc), we
then inject this string to build the query, and get a fast response from

The problem of cities having multiple, distinct and/or non-joined areas
can simply be solved by looping over the list of POLYGON(...) strings,
and execute the queries for each of them. But apparently, we won't have
this in the database since osm2pgsql does not support enclaves (is this
still the case?).

I know this results in a lot more queries: 1 + N * Q, where N is the
number of polygons returned by the first query, and Q the number of
child queries we execute based on this polygon information. But if each
of these queries only take 3-4s, the result is still better than

But I'm no PostgreSQL/PostGIS expert either. If there's a cleaner way of
doing this, I'm all for it!

- Maxime

Maxime Petazzoni <>
 ``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]