kopia lustrzana https://github.com/kartoza/docker-osm
resurrect the display in webbrowser
rodzic
72bc59e3e9
commit
4cb08e2666
10
Makefile
10
Makefile
|
@ -1,6 +1,7 @@
|
|||
PROJECT_ID := dockerosm
|
||||
# COMPOSE_FILE := docker-compose-web.yml
|
||||
COMPOSE_FILE := docker-compose.yml
|
||||
# Uncomment the next line if you want to display data with Leaflet.
|
||||
# COMPOSE_FILE := docker-compose-web.yml
|
||||
|
||||
.PHONY: logs
|
||||
|
||||
|
@ -8,6 +9,13 @@ COMPOSE_FILE := docker-compose.yml
|
|||
# DOCKER MANAGEMENT
|
||||
###
|
||||
|
||||
status:
|
||||
@echo
|
||||
@echo "------------------------------------------------------------------"
|
||||
@echo "Status in production mode"
|
||||
@echo "------------------------------------------------------------------"
|
||||
@docker-compose -f $(COMPOSE_FILE) -p $(PROJECT_ID) ps
|
||||
|
||||
|
||||
build:
|
||||
@echo
|
||||
|
|
|
@ -93,14 +93,14 @@ osmupdate:
|
|||
- TIME=120
|
||||
|
||||
qgisserver:
|
||||
image: kartoza/qgis-server:2.14
|
||||
image: kartoza/qgis-server:2.18
|
||||
hostname: dockerosm_qgisserver
|
||||
container_name: dockerosm_qgisserver
|
||||
#volumes_from:
|
||||
# - btsync
|
||||
volumes:
|
||||
- ./logs:/var/log/apache2
|
||||
- ./web:/web
|
||||
- ./web:/project
|
||||
- ./settings:/web/settings
|
||||
links:
|
||||
- db:db
|
||||
|
|
|
@ -19,14 +19,13 @@
|
|||
***************************************************************************/
|
||||
"""
|
||||
|
||||
from sys import exit
|
||||
from sys import exit, stderr
|
||||
from os import environ, listdir
|
||||
from shutil import move
|
||||
from os.path import join, exists, abspath, isabs
|
||||
from psycopg2 import connect, OperationalError
|
||||
from subprocess import call
|
||||
from time import sleep
|
||||
from sys import stderr
|
||||
|
||||
|
||||
class Importer(object):
|
||||
|
@ -64,7 +63,7 @@ class Importer(object):
|
|||
|
||||
@staticmethod
|
||||
def info(message):
|
||||
print message
|
||||
print(message)
|
||||
|
||||
@staticmethod
|
||||
def error(message):
|
||||
|
|
|
@ -21,11 +21,10 @@
|
|||
|
||||
from os.path import exists, join, isabs, abspath
|
||||
from os import listdir, environ
|
||||
from sys import exit
|
||||
from sys import exit, stderr
|
||||
from subprocess import call, Popen, PIPE
|
||||
from datetime import datetime
|
||||
from time import sleep
|
||||
from sys import stderr
|
||||
|
||||
|
||||
class Downloader(object):
|
||||
|
@ -47,7 +46,7 @@ class Downloader(object):
|
|||
|
||||
@staticmethod
|
||||
def info(message):
|
||||
print message
|
||||
print(message)
|
||||
|
||||
@staticmethod
|
||||
def error(message):
|
||||
|
|
13
readme.md
13
readme.md
|
@ -80,6 +80,19 @@ You can check the timestamp of your database by reading the file :
|
|||
or you can use :
|
||||
'make timestamp'
|
||||
|
||||
### Display
|
||||
|
||||
In the makefile, you can switch to another docker compose project.
|
||||
The other one includes QGIS Server. When it's running, you should be able to
|
||||
open, on the host(not in docker), the `index.html` file and see OSM and QGIS
|
||||
Server showing PostGIS tables. The webpage is using Leaflet.
|
||||
|
||||
If you want to tweak the QGIS Project, you need to add a host in your in `/etc/hosts`:
|
||||
```
|
||||
127.0.0.1 db
|
||||
```
|
||||
Because in the docker-compose file, the link is made with the PostGIS database using the alias `db`.
|
||||
|
||||
## In the background
|
||||
|
||||

|
||||
|
|
|
@ -35,16 +35,15 @@ xmlhttp.onreadystatechange=function() {
|
|||
timestamp = xmlhttp.responseText;
|
||||
}
|
||||
}
|
||||
xmlhttp.open("GET", "/settings/timestamp.txt", false );
|
||||
xmlhttp.open("GET", "settings/timestamp.txt", false );
|
||||
xmlhttp.send();
|
||||
document.getElementById('overlay').innerHTML = timestamp;
|
||||
|
||||
var map = L.map('map').setView([0, 0], 3);
|
||||
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',
|
||||
var wms = L.tileLayer.wms("http://localhost:8198/", {
|
||||
layers: 'osm_buildings20160720014515980',
|
||||
format: 'image/png',
|
||||
transparent: true,
|
||||
attribution: "OpenStreetMap"
|
||||
|
|
1928
web/project.qgs
1928
web/project.qgs
Plik diff jest za duży
Load Diff
Ładowanie…
Reference in New Issue