kopia lustrzana https://github.com/kartoza/docker-osm
web, readme
rodzic
5ee47588ad
commit
e1fc4981c9
|
@ -215,12 +215,14 @@ class Importer(object):
|
|||
|
||||
def _import_clip_function(self):
|
||||
"""Create function clean_tables()."""
|
||||
self.info('Import clip function.')
|
||||
command = ['psql']
|
||||
command += ['-h', self.default['HOST']]
|
||||
command += ['-U', self.default['USER']]
|
||||
command += ['-d', self.default['DATABASE']]
|
||||
command += ['-f', self.clip_sql_file]
|
||||
call(command)
|
||||
self.info('!! Be sure to run \'make import_clip\' !!')
|
||||
|
||||
def clip(self):
|
||||
"""Perform clipping if the clip table is here."""
|
||||
|
|
18
readme.md
18
readme.md
|
@ -18,10 +18,21 @@ wget -c -O country.pbf http://download.openstreetmap.fr/extracts/africa/south_af
|
|||
|
||||
### Clipping
|
||||
|
||||
You can put a shapefile in the clip folder. This shapefile will be used for clipping every features after the import.
|
||||
You can put a shapefile in the clip folder. This shapefile will be
|
||||
used for clipping every features after the import.
|
||||
This file has to be named 'clip.shp'. When the database container is
|
||||
running, import the shapefile in the database using the command :
|
||||
'make import_clip'.
|
||||
|
||||
You can remove the clip file : 'make remove_clip'.
|
||||
|
||||
### QGIS Styles
|
||||
|
||||
|
||||
'make import_styles'
|
||||
'make remove_styles'
|
||||
'make backup_styles'
|
||||
|
||||
### SQL Trigger
|
||||
|
||||
### Build and run
|
||||
|
@ -39,6 +50,11 @@ In production you should daemonize the services when bringing them up:
|
|||
docker-compose up -d
|
||||
```
|
||||
|
||||
You can check the timestamp of your database by reading the file :
|
||||
'settings/timestamp.txt'
|
||||
or you can use :
|
||||
'make timestamp'
|
||||
|
||||
## Docker OSM Update
|
||||
|
||||
This docker image when run will fetch on a regular interval any new diff file
|
||||
|
|
|
@ -9,19 +9,19 @@ html, body, #map { height: 100%; width: 100%; background-color: #2b6adb;}
|
|||
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
|
||||
<script>
|
||||
var map = L.map('map').setView([0, 0], 3);
|
||||
var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?');
|
||||
var baseMaps = {
|
||||
"OSM-Tiles": osm
|
||||
};
|
||||
var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?').addTo(map);
|
||||
|
||||
var wms = L.tileLayer.wms("http://localhost:8198/cgi-bin/qgis_mapserv.fcgi?", {
|
||||
map: '/web/project.qgs',
|
||||
layers: 'project',
|
||||
format: 'image/png',
|
||||
transparent: true,
|
||||
attribution: "OpenStreetMap"
|
||||
});
|
||||
}).addTo(map);
|
||||
|
||||
var overlays = {
|
||||
"OSM-Docker": wms
|
||||
"OSM-Docker": wms,
|
||||
"OSM-Tiles": osm
|
||||
};
|
||||
L.control.layers(baseMaps, overlays).addTo(map);
|
||||
L.control.layers({}, overlays).addTo(map);
|
||||
</script></body></html>
|
||||
|
|
Ładowanie…
Reference in New Issue