README.md 1.47 KB
Newer Older
Mohammed Zia's avatar
Mohammed Zia committed
1
# Docker Container - Source https://github.com/appropriate/docker-postgis
Mohammed Zia's avatar
Mohammed Zia committed
2

Mohammed Zia's avatar
Mohammed Zia committed
3 4
`docker build -t postgis-image .`

Mohammed Zia's avatar
Mohammed Zia committed
5
`docker run -e POSTGRES_PASSWORD=pass_osm --detach --name postgis-container -p 3011:5432 -d postgis-image`
Mohammed Zia's avatar
Mohammed Zia committed
6 7 8

# Wait for a while and then run 

9 10 11 12
`docker exec -it postgis-container python /scripts/update_db.py` 

# Populate db with scanned regions

Mohammed Zia's avatar
Mohammed Zia committed
13
`chmod +x scripts/post_scanned.sh`
Mohammed Zia's avatar
Mohammed Zia committed
14

Mohammed Zia's avatar
Mohammed Zia committed
15
`./scripts/post_scanned.sh`
Mohammed Zia's avatar
Mohammed Zia committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

# Populate one row in Luxumberg table - Test

insert into world.lu (id, scanned_bbox_id, deepvgi_count, deepvgi_probability, geom) 
values (1, 1, 10, 0.9, ST_Polygon(ST_GeomFromText('LINESTRING(19.4677734375 45.874712248904764, 18.577880859375 45.0502402697946, 20.698242187499996 45.120052841530544, 20.698242187499996 45.89000815866184, 19.4677734375 45.874712248904764)'), 4326));
UPDATE world.lu SET geom_json = CAST(ST_AsGeoJSON(geom) AS JSON)::JSON->'coordinates';

# Populate one row in Scanned table - Test

insert into reference.scanned_locations (weightage, geom) 
values (0.4, ST_Polygon(ST_GeomFromText('LINESTRING(26.2353515625 41.04621681452063,26.2353515625 36.77409249464195, 31.1572265625 37.26530995561875, 30.805664062500004 41.0130657870063, 26.2353515625 41.04621681452063)'), 4326))
UPDATE reference.scanned_locations SET geom_json = CAST(ST_AsGeoJSON(geom) AS JSON)::JSON->'coordinates';

# Get a Gateway to be used as an IP to connect from Geoserver. Find a line saying "Gateway": "172.17.0.1". Use this as an IP Address.

Mohammed Zia's avatar
Mohammed Zia committed
31
`docker inspect postgis-container`