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):
|
def _import_clip_function(self):
|
||||||
"""Create function clean_tables()."""
|
"""Create function clean_tables()."""
|
||||||
|
self.info('Import clip function.')
|
||||||
command = ['psql']
|
command = ['psql']
|
||||||
command += ['-h', self.default['HOST']]
|
command += ['-h', self.default['HOST']]
|
||||||
command += ['-U', self.default['USER']]
|
command += ['-U', self.default['USER']]
|
||||||
command += ['-d', self.default['DATABASE']]
|
command += ['-d', self.default['DATABASE']]
|
||||||
command += ['-f', self.clip_sql_file]
|
command += ['-f', self.clip_sql_file]
|
||||||
call(command)
|
call(command)
|
||||||
|
self.info('!! Be sure to run \'make import_clip\' !!')
|
||||||
|
|
||||||
def clip(self):
|
def clip(self):
|
||||||
"""Perform clipping if the clip table is here."""
|
"""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
|
### 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
|
### QGIS Styles
|
||||||
|
|
||||||
|
|
||||||
|
'make import_styles'
|
||||||
|
'make remove_styles'
|
||||||
|
'make backup_styles'
|
||||||
|
|
||||||
### SQL Trigger
|
### SQL Trigger
|
||||||
|
|
||||||
### Build and run
|
### Build and run
|
||||||
|
@ -39,6 +50,11 @@ In production you should daemonize the services when bringing them up:
|
||||||
docker-compose up -d
|
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
|
## Docker OSM Update
|
||||||
|
|
||||||
This docker image when run will fetch on a regular interval any new diff file
|
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 src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var map = L.map('map').setView([0, 0], 3);
|
var map = L.map('map').setView([0, 0], 3);
|
||||||
var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?');
|
var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?').addTo(map);
|
||||||
var baseMaps = {
|
|
||||||
"OSM-Tiles": osm
|
|
||||||
};
|
|
||||||
var wms = L.tileLayer.wms("http://localhost:8198/cgi-bin/qgis_mapserv.fcgi?", {
|
var wms = L.tileLayer.wms("http://localhost:8198/cgi-bin/qgis_mapserv.fcgi?", {
|
||||||
map: '/web/project.qgs',
|
map: '/web/project.qgs',
|
||||||
layers: 'project',
|
layers: 'project',
|
||||||
format: 'image/png',
|
format: 'image/png',
|
||||||
transparent: true,
|
transparent: true,
|
||||||
attribution: "OpenStreetMap"
|
attribution: "OpenStreetMap"
|
||||||
});
|
}).addTo(map);
|
||||||
|
|
||||||
var overlays = {
|
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>
|
</script></body></html>
|
||||||
|
|
Ładowanie…
Reference in New Issue