TileStache.Goodies.Providers.MirrorOSM | index |
Populate an OSM rendering database using tiled data requests.
This provider is unusual in that requests for tiles have the side effect of
running osm2pgsql to populate a PostGIS database of OSM data from a remote API
source. Returned tiles are just text confirmations that the process has been
successful, while the stored data is expected to be used in other providers
to render OSM data. It would be normal to use this provider outside the regular
confines of a web server, perhaps with a call to tilestache-seed.py governed
by a cron job or some other out-of-band process.
MirrorOSM is made tenable by MapQuest's hosting of the XAPI service:
http://open.mapquestapi.com/xapi/
Osm2pgsql is an external utility:
http://wiki.openstreetmap.org/wiki/Osm2pgsql
Example configuration:
"mirror-osm":
{
"provider":
{
"class": "TileStache.Goodies.Providers.MirrorOSM:Provider",
"kwargs":
{
"username": "osm",
"database": "planet",
"api_base": "http://open.mapquestapi.com/xapi/"
}
}
}
Provider parameters:
database:
Required Postgres database name.
username:
Required Postgres user name.
password:
Optional Postgres password.
hostname:
Optional Postgres host name.
table_prefix:
Optional table prefix for osm2pgsql. Defaults to "mirrorosm" if omitted.
Four tables will be created with this prefix: <prefix>_point, <prefix>_line,
<prefix>_polygon, and <prefix>_roads. Must result in valid table names!
api_base:
Optional OSM API base URL. Because we don't want to overtax the main OSM
API, this defaults to MapQuest's XAPI, "http://open.mapquestapi.com/xapi/".
The trailing slash must be included, up to but not including the "api/0.6"
portion of a URL. If you're careful to limit your usage, the primary
OSM API can be specified with "http://api.openstreetmap.org/".
osm2pgsql:
Optional filesystem path to osm2pgsql, just in case it's someplace outside
/usr/bin or /usr/local/bin. Defaults to "osm2pgsql --utf8-sanitize".
Additional arguments such as "--keep-coastlines" can be added to this string,
e.g. "/home/user/bin/osm2pgsql --keep-coastlines --utf8-sanitize".
Modules | ||||||
|
Classes | ||||||||||||||||
|
Functions | ||
|
Data | ||
PIPE = -1 stderr = <open file '<stderr>', mode 'w'> |