[Top][All Lists]

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

Re: [Maposmatic-dev] Unselectable (largish) administrative boundaries in

From: Thomas Petazzoni
Subject: Re: [Maposmatic-dev] Unselectable (largish) administrative boundaries in Turkey
Date: Thu, 3 May 2012 08:50:02 +0200

Hello Hakan,

Le Thu, 03 May 2012 00:14:05 +0200,
Hakan Tandogan <address@hidden> a écrit :

> In the meantime, just like Jeroen mentioned, I have created a 
> postgis-enabled schema on my home server and loaded the turkey extract 
> from geofabrik on it.
> Nearly a full day of upgrading various software, half an hour of trying 
> to understand the instructions on the maposmatic git repo, and 7:30 
> minutes of actually loading data with osm2psql :-)

Yes, it is quite complicated to set up all the stuff needed to run
MapOSMatic. Actually, I would say it is almost as complicated to run
the public MapOSMatic server (making sure everything is stable, that
the database remains up to date, etc.) than to code the
MapOSMatic/OcitySMap Python code itself.

> But now, I'm quite lost again, this time lacking any good knowledge of 
> postgis. Could I please have some hints as to how the database is 
> queried for valid objects for the maposmatic dropdown?

Basically, when you type into the drop-down list, the Javascript makes
queries to the /apis/nominatim/ URL. According to the www/ file
in MapOSMatic, this brings you into the
maposmatic.views.query_nominatim view, implemented in
www/maposmatic/, which in turns uses the
www/maposmatic/ module. To summarize what
does: it queries the service for results
corresponding to the string entered by the user. This service returns
a XML list of matching entries. With this list of entries in hand, we
check our PostGIS database to see which entries match our requirements.
The entries than are too big in terms of geographic size are marked as
such in

> Also, if I have the extents of the boundary in degrees, can I use 
> postgis to calculate this into kilometers or would I have to create some 
> program for this?

Yes, you can ask PostGIS to do that, thought I don't remember right now
the exact syntax. You quite certainly need to look at something like
st_surface(). Everytime I do something with PostGIS, I have to go check
the documentation.

Hope this helps,

Thomas Petazzoni      
Logiciels Libres à Toulouse
Embedded Linux        

reply via email to

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