maposmatic-dev
[Top][All Lists]
Advanced

[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/urls.py file
in MapOSMatic, this brings you into the
maposmatic.views.query_nominatim view, implemented in
www/maposmatic/views.py:query_nominatim(), which in turns uses the
www/maposmatic/nominatim.py module. To summarize what nominatim.py
does: it queries the nominatim.openstreetmap.org 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 nominatim.py:_get_admin_boundary_info_from_GIS().

> 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
-- 
Thomas Petazzoni                http://thomas.enix.org
MapOSMatic                      http://www.maposmatic.org
Logiciels Libres à Toulouse     http://www.toulibre.org
Embedded Linux                  http://www.free-electrons.com



reply via email to

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