Giter Site home page Giter Site logo

kartoza / docker-osm Goto Github PK

View Code? Open in Web Editor NEW
274.0 33.0 105.0 2.64 MB

A docker compose project to setup an OSM PostGIS database with automatic updates from OSM periodically

License: GNU General Public License v2.0

Python 10.18% C 88.12% Makefile 1.17% Dockerfile 0.34% Shell 0.19%
postgis docker imposm osm-pbf osm-data diff osm-replication qgis osm openstreetmap

docker-osm's Introduction

Docker-OSM

A docker compose project to setup an OSM PostGIS database with automatic updates from OSM periodically. The only files you need is a PBF file, geojson (if you intend to restrict data download to a smaller extent than the one specified by the PBF) and run the docker compose project.

General architecture

Alt text

Quick setup

As a quick example, we are going to setup Docker-OSM with default values everywhere:

Alternatively you can execute the settings_downloader.sh script to download the pbf and the clip file

bash ./settings_downloader.sh GEOJSON_URL CONTINENT COUNTRY ie
bash ./settings_downloader.sh https://github.com/kartoza/docker-osm/raw/develop/settings/clip.geojson africa south-africa

For a full list of allowed file names read json file countries.json

Alternatively you can use the python script pbf_downloader.py

For local usage, the containers are set up using docker-compose configuration. The configuration files consists of two sets of config file. The first one is .env which contains lists of environment variables. Copy the .env file from the .example.env in this repo.

cp .example.env .env

For subsequent configuration, edit the .env files to tweak your options.

The second set of configuration is using a docker-compose.yml files, which is a compose files docker-compose is using.

For minimum set of production environment, the configuration file is described in docker-compose.yml file. The other YAML files with prefix docker-compose is a configuration file that you can merge with the basic docker-compose.yml file. To use more than one configuration file, you edit .env file and change the COMPOSE_FILE variable to include all the compose file you desired, separated by a colon : for each file.

For example, by default, the example file is using both docker-compose.yml and docker-compose.develop.yml because we expect you to provide the necessary settings in settings folder. Thus the COMPOSE_FILE variable looks like this:

COMPOSE_FILE=docker-compose.yml:docker-compose.develop.yml

In production environment, normally all the persistent data is stored in a volume, instead of bind mounted. In this case only the docker-compose.yml is enough, and you need to provide the settings inside the volume itself.

To build the image yourself, include the docker-compose.build.yml file.

To use helper services such as pgadmin, include docker-compose.pgadmin.yml, and docker-compose.web.yml for web demo.

If you are familiar with how docker-compose work, you can also use a standard convention by putting docker-compose.override.yml file and include it in the COMPOSE_FILE variable.

To store the configuration for long-term use (for archiving or diffing of different configuration). You can interpolate the current variables in .env and generate a full config files:

docker-compose config > docker-compose.production.yml

The above command will include and merged all your config files specified in COMPOSE_FILE variable and also fill out the variables parameterized in the docker-compose file.

  • If you want to connect from your local QGIS Desktop:
    • In the file docker-compose.yml, uncomment the block:
# Uncomment to use the postgis database from outside the docker network
ports:
 - "35432:5432"
  • Do make run in the build directory. This will download and execute the docker-osm project. It might be very long depending of your bandwidth and the PBF you are importing.
  • In QGIS, add a new PostGIS connection: localhost, database gis, port 35432, docker for both username and password.
  • That's it! You have an OSM database, up and running. The update is done every 2 minutes from the main OSM website.

For further reading and customizations, read below.

Docker cloud

Dockerfiles are executed on Docker Cloud kartoza/docker-osm

docker pull kartoza/docker-osm:imposm-latest
docker pull kartoza/docker-osm:osmupdate-latest

To run you can use the provided docker-compose project and use the images hosted on the internet. This is useful if you want to integrate Docker-OSM in your existing docker-compose project.

Usage

PBF File

In this example we will set up an OSM database for South Africa that will pull for updates every 2 minutes.

Specify a PBF file for your area in the environment variables for osm_downloader container. You can download some PBF files on these URLS for instance :

You must put only one PBF file in the settings folder. Only the last one will be read.

OSM Features

In settings, you can edit the mapping.yml to customize the PostGIS schema. You can find the documentation about the mapping configuration on the imposm website: https://imposm.org/docs/imposm3/latest/mapping.html The default file in Docker-OSM is coming from https://raw.githubusercontent.com/omniscale/imposm3/master/example-mapping.yml

Note Imposm is designed for spatial analysis, not for OSM contribution analysis. If you need such a feature, you need to use another database schema supporting OSM Metadata. You can check the OSM Wiki for "Lossless" schemas.

Updates

You can configure the time interval in the docker-compose file. By default, it's two minutes. If you set the TIME variable to 0, no diff files will be imported.

The default update stream is worldwide. So even if you imported a local PBF, if you don't set a clipping area, you will end with data from all over the world.

Clipping

During the initial import or post update imposm uses the flag -limito which allows you to define a smaller area that you can work with.
This is always desirable to limit the features being imported into the database rather than clipping them.

NB: Ensure you add a geojson covering the area you intend to clip into the settings folder. The geojson can be the same extent of the administrative area for your country, or it can be a smaller extent. The CRS of the geojson should always be EPSG:4326.

NB: It is encouraged to simplify the geometry for the clip.geojson as a simplified geometry is easier to process during the import. Rather use the minimum bounding box for the area you intend to clip your dataset with.

QGIS project

There is a default QGIS project provided in the web/ folder, named osm_mirror_qgis_project.qgz. To be able to load the layers in this project correctly in QGIS, first run make materialized_views and make elevation then set up your connection service file with the following parameters. The host parameter is where you have set up docker-osm:

[docker-osm]
dbname=gis
port=35432
user=docker
password=docker
host=<host>
sslmode=disable

QGIS Styles

The database is provided with some default styles. These styles will be loaded automatically when loaded in QGIS. It's following the default OSM mapping from ImpOSM.

make import_styles
make remove_styles
make backup_styles

SQL Trigger, functions, views...

You can add PostGIS functions, triggers, materialized views into an SQL file called post-pbf-import.sql. It will be imported automatically in the database.

Build and run

Now build the docker images needed to run the application:

docker-compose build
docker-compose up 

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

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

architecture

Docker OSM Update

This docker image, when run will regularly fetch any new diff file for all the changes that have happened in the world over the update interval.

You can also specify a custom url for fetching the diff if you wish to retrieve regional diffs rather than the global one.

You can specify a polygonal area for the diff so that it will only apply features from the diff that fall within that area. For example providing a polygon of the borders of Malawi will result in only Malawi features being extracted from the diff.

Note: the diff retrieved and options specified here are not related to the initial base map used - so for example if your initial base map is for Malawi and you specify a diff area in Botswana, updated features in Botswana will be applied to your base map which only includes features from Malawi. For this reason, take care to ensure that your diff area coincides with the region covered by your original base map.

Once the diff has been downloaded, it is placed into /home/import_queue where it will be picked up by the long running imposm3 container, which will apply the diff to the database.

You should have 3 folders : osm_pbf, import_queue, import_done

Put a state file in base-pbf like this one : http://download.openstreetmap.fr/extracts/africa/south_africa.state.txt

docker build -t osmupdate .
docker run -v $('pwd')import-queue/:/home/import-queue -v $('pwd')base-pbf/:/home/base-pbf -v $('pwd')import-done/:/home/import-done -d osmupdate

With -e, you can add some settings :

 - MAX_DAYS = 100, the maximum time range to assemble a cumulated changefile.
 - DIFF = sporadic, osmupdate uses a combination of minutely, hourly and daily changefiles. This value can be minute, hour, day or sporadic.
 - MAX_MERGE = 7, argument to determine the maximum number of parallely processed changefiles.
 - COMPRESSION_LEVEL = 1, define level for gzip compression. values between 1 (low compression but fast) and 9 (high compression but slow)
 - BASE_URL = http://planet.openstreetmap.org/replication/, change the URL to use a custom URL to fetch regional file updates.
 - IMPORT_QUEUE = import_queue
 - IMPORT_DONE = import_done
 - OSM_PBF = osm_pbf
 - TIME = 120, seconds between two executions of the script

If you are using docker-compose, you can use these settings within the docker-compose.yml file.

Docker ImpOSM3

This image will take care of doing the initial load for the selected region (e.g. planet, or a country such as Malawi) into your database. It will then apply, at a regular interval (default is 2 minutes), any diff that arrives in the /home/import_queue folder to the postgis OSM database. The diffs are fetched by a separate container (see osm_update container).

The container will look for an OSM file (.pbf) and its state file (.state.txt) in BASE_PBF.

With -e, you can add some settings :

 - TIME = 120, seconds between 2 executions of the script
 - POSTGRES_USER = docker, default user
 - POSTGRES_PASS = docker, default password
 - POSTGRES_HOST = db
 - POSTGRES_PORT = 5432
 - SETTINGS = settings, folder for settings (with *.json and *.sql)
 - CACHE = cache, folder for caching
 - BASE_PBF = base_pbf, folder the OSM file
 - IMPORT_DONE = import_done, folder for diff which has been imported
 - IMPORT_QUEUE = import_queue, folder for diff which hasn't been imported yet
 - SRID = 4326, it can be 3857
 - OPTIMIZE = false, check (Imposm)[http://imposm.org/docs/imposm3/latest/tutorial.html#optimize]
 - DBSCHEMA_PRODUCTION = public, check (Imposm)[http://imposm.org/docs/imposm3/latest/tutorial.html#deploy-production-tables]
 - DBSCHEMA_IMPORT = import, check (Imposm)[http://imposm.org/docs/imposm3/latest/tutorial.html#deploy-production-tables]
 - DBSCHEMA_BACKUP = backup, check (Imposm)[http://imposm.org/docs/imposm3/latest/tutorial.html#deploy-production-tables]

You can adjust these preferences in the docker-compose.yml file provided in this repository.

PostGIS

For environment variables associated with docker-postgis refer to docker postgis repository

Support

If you require more substantial assistance from kartoza (because our work and interaction on docker-osm is pro bono), please consider taking out a Support Level Agreeement

Credits

This application was designed and implemented by:

With some important design ideas provided by Ariel Nunez ([email protected]).

Parts of this project are built on the existing work of others.

July 2015

docker-osm's People

Contributors

bchartier avatar danielcaldwell avatar devfoo-one avatar dobriseb avatar fennovj avatar frafra avatar gjacquenot avatar gubuntu avatar gustry avatar imresamu avatar julien-noblet avatar lucernae avatar madsbertelsen avatar meomancer avatar nspaeth avatar timlinux avatar vikineema avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-osm's Issues

running make_import causes an error

when running make import_clip results in the following error

Importing clip shapefile

invalid command ":
ERROR: syntax error at or near "rpc"
LINE 1: rpc error: code = 2 desc = oci runtime error: exec failed: c...

I did also check in the dockerosm_db container using "whereis shp2pgsql" no such file

Any ideas what could be wrong?

Cusstom SQL ignored on startup

Problem

I have created a custom file that I need to initialize when I bring the stack up.

custom

But when I log into the container I can see the following files
custom_sql

imposm diff directly applied to public shema?

Hi guys,

we are giving a look to your great work here at GeoSolutions. We are evalutaing it to be adopted in some of our pipelines (in that case we hope to contribute back!).

Our initial test shows that, given the -deploytoproduction argument, the first import is directly moved to the public schema. The sunsequent imposm diff commands directly apply diffs to the public schema.
The latest is not very well documented on the imposm3 docs, and I quite do't understand how/why the diff command chooses the schema to apply diffs on.
My initial thought was that diffs were applied to import schema but, yes, in this case the import schema is empty because of the initial -deploytoproduction argument, so it couldn't apply diffs on that... My guess is that imposm diff only writes to public, by default?

A related question is: how do you deal with intermediate checks on imports or rollbacks in case of failures?

Failure to start containers

Problem

When running the docker-compose up -d --build I encounter the following error.

ERROR: for osmupdate  Cannot start service osmupdate: oci runtime error: container_linux.go:247: starting container process caused "exec: \"python\": executable file not found in $PATH"
ERROR: Encountered errors while bringing up the project.

Solution
Fix this please

osmupdate is killed

osmupdate_1 | osmupdate: Merging changefiles. osmupdate_1 | Killed osmupdate_1 | osmupdate Error: Merging of changefiles failed: osmupdate_1 | osmconvert --merge-versions "osmupdate_temp/temp.m001506704.osc.gz" "osmupdate_temp/temp.m001506705.osc.gz" "osmupdate_temp/temp.m001506706.osc.gz" "osmupdate_temp/temp.m001506707.osc.gz" "osmupdate_temp/temp.m001506708.osc.gz" "osmupdate_temp/temp.m001506709.osc.gz" --timestamp=2015-07-31T10:34:02Z --out-o5c >"osmupdate_temp/temp.9" osmupdate_1 | An error occured in osmupdate.

Something was updated, now it stopped to work at MacOS

Trying to run db

Add rule to pg_hba: 0.0.0.0/0
Add rule to pg_hba: replication replicator 
Setup master database
Initializing Postgres Database at /var/lib/postgresql/12/main
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locales
  COLLATE:  en_US.UTF-8
  CTYPE:    en_US.UTF-8
  MESSAGES: C
  MONETARY: C
  NUMERIC:  C
  TIME:     C
The default text search configuration will be set to "english".

Data page checksums are disabled.

initdb: error: could not create directory "/var/lib/postgresql/12/main": Permission denied
creating directory /var/lib/postgresql/12/main ... Setup master database
Initializing Postgres Database at /var/lib/postgresql/12/main
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

initdb: error: could not create directory "/var/lib/postgresql/12/main": Permission denied
The database cluster will be initialized with locales
  COLLATE:  en_US.UTF-8
  CTYPE:    en_US.UTF-8
  MESSAGES: C
  MONETARY: C
  NUMERIC:  C
  TIME:     C
The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory /var/lib/postgresql/12/main ... 

change mapping.yml

Hi there

I am trying to use docker-osm with the italian osm data.
But it seems i am unable to change the osm_buildings imported columns, even if i change the mapping.yml file, following the example in
https://github.com/kartoza/docker-osm-examples/blob/master/indonesia-buildings/docker-osm-settings/mapping.yml
But nothing seems to happen
the postgis schema of osm_buildings remains the same with the 5 columns: id, osm_id, name, type and geometry.

what am i doing wrong?

Thank you for your work
Steve

No space left on device durig initial import

Trying to import africa continent from geofabrik:

SQL Error: pq: could not extend file "base/18186/18416.2": No space left on device in query COPY "import"."osm_buildings"

imposm stops with an error. BUt apparently the updater continues to work with diffs.

Full logs:

Detect SRID: 4326,
Clip: no,
Qgis style: yes,
OSM PBF file: /home/settings/country.pbf,
Mapping: /home/settings/country.pbf,
No custom SQL files *.sql detected in /home/settings,
QGIS Style file: /home/settings/qgis_style.sql,
No *.shp detected in /home/settings, so no clipping.,
The checkup is OK.,
The database is empty. Let's import the PBF : /home/settings/country.pbf,
imposm import -diff -deployproduction -overwritecache -cachedir /home/cache -srid 4326 -dbschema-production public -dbschema-import import -dbschema-backup backup -diffdir /home/settings -mapping /home/settings/mapping.yml -read /home/settings/country.pbf -write -connection postgis://docker:docker@db/gis,
[Aug 23 10:28:09] Imposm
[Aug 23 10:28:09] Reading OSM data
[Aug 23 10:28:09] [INFO] [reader] reading /home/settings/country.pbf with data till 2018-08-22 20:15:02 +0000 UTC,
[Aug 23 10:28:09] Reading OSM data
[Aug 23 10:28:10] [ 0s] C: 0/s 0/s (896000) N: 0/s 0/s (4220) W: 0/s 0/s (0) R: 0/s 0/s (0)
[Aug 23 10:28:10] [ 1s] C: 2903000/s 944000/s (1368000) N: 10800/s 1800/s (5142) W: 0/s 0/s (0) R: 0/s 0/s (0)
[...]
100.0%)
[Aug 23 10:37:46] [ 6m10s] C: 0/s 0/s ( 0.0%) N: 0/s 0/s ( 0.0%) W: 70100/s 98000/s (42.6%) R: 2950/s 0/s (100.0%)
[Aug 23 10:37:47] [ 6m10s] C: 0/s 0/s ( 0.0%) N: 0/s 0/s ( 0.0%) W: 70100/s 53900/s (42.6%) R: 2950/s 0/s (100.0%)
[Aug 23 10:37:47] [ 6m11s] C: 0/s 0/s ( 0.0%) N: 0/s 0/s ( 0.0%) W: 70000/s 0/s (42.6%) R: 2950/s 0/s (100.0%)
[Aug 23 10:37:47] [PostGIS] SQL Error: pq: could not extend file "base/18186/18416.2": No space left on device in query COPY "import"."osm_buildings" ("osm_id", "geometry", "name", "type") FROM STDIN ([445246995 0103000020E61000000100000011000000548B96C7C13B4340A0EC74DDE1F21B40548BEACDC13B4340A0EC34DDE5F21B40548BAE09C23B4340A0ECD466E9F21B40548B0E5EC23B4340A0EC148EEBF21B40548B86C7C23B4340A0EC7496ECF21B40548B8234C33B4340A0ECD463ECF21B40548B5A98C33B4340A0EC34F6EAF21B40548B4AE4C33B4340A0ECD485E8F21B40548B2E0FC43B4340A0EC7461E5F21B40548B9610C43B4340A0EC94F9E1F21B40548B06ECC33B4340A0EC14B9DEF21B40548BE6A2C33B434080ECF426DCF21B40548BC23FC33B434080EC349DDAF21B40548B12D2C23B434080EC943DDAF21B40548BBA57C23B434080ECF472DBF21B40548BCEF8C13B434080ECD426DEF21B40548B96C7C13B4340A0EC74DDE1F21B40 yes])

[Aug 23 10:37:47] [ 6m11s] C: 0/s 0/s ( 0.0%) N: 0/s 0/s ( 0.0%) W: 70000/s 0/s (42.6%) R: 2950/s 0/s (100.0%)
50

An error occured in imposm with the original file.

Rename PBF file

Hi,

Thanks you for this work.

At first start, my DB was desperately empty.
I've seen that dockerosm_osmupdate was executing this command :
bash -c while [ ! -f /home/settings/country.pbf ] ; do sleep 1; done && python3 -u /home/download.py

So, I have to rename my .PBF file to country.pbf for it to start to import data.

Is that the normal way to do it ?
If yes, why isn't it documented in the Readme.md ?

Error while spinning up the project

imposm_1 | [Jul 30 20:43:29] [INFO] Imposm took: 56.593014789s
imposm_1 | Sleeping for 120 seconds.
imposm_1 | Traceback (most recent call last):
imposm_1 | File "/home/importer.py", line 166, in
imposm_1 | sleep(default['TIME'])
imposm_1 | TypeError: a float is required
dockerosm_imposm_1 exited with code 1
Gracefully stopping... (press Ctrl+C again to force)
Stopping dockerosm_osmupdate_1...
Stopping dockerosm_db_1...

cannot import name 'OrderedDict'

$ docker compose -f docker-compose.yml -f docker-compose.develop.yml up
[...]
dockerosm-osmenrich-1  | Traceback (most recent call last):
dockerosm-osmenrich-1  |   File "/home/enrich.py", line 34, in <module>
dockerosm-osmenrich-1  |     from xmltodict import OrderedDict
dockerosm-osmenrich-1  | ImportError: cannot import name 'OrderedDict' from 'xmltodict' (/usr/local/lib/python3.10/site-packages/xmltodict.py)

Create database management container

Problem

Actually, there are 3 running containers :

  • database
  • osmupdate
  • imposm

osmupdate and imposm are both checking files at the beginning of the container and then waiting 45 seconds for the database to be ready. We should avoid checking twice.

Moreover, imposm is doing more work than importing PBF and diff files. This container is also importing QGIS styling at the beginning and running scheduled clipping.

docker-osm

Proposed solution

We may implement a kind of DB manager docker container.
This container will take care of :

  • import the clipping shapefile in the DB (shp2pgsql)
  • import the QGIS styling in the DB (psql)
  • Import the SQL custom triggers (psql)
  • Run the clipping SQL function on a regular interval (psql)
  • Vacuum #20 on a regular interval (psql)

We may add some process too : checking files ...

Exception in importer.py with mknod

Hi,
When I tested docker-osm I encountered an error with importer.py, more precisely with mknod function here:
https://github.com/kartoza/docker-osm/blob/develop/docker-imposm3/importer.py#L239
At runtime I got an exception telling me that mknod was not available.

I don't understand why this exception occured. I saw mknod was specific to Unix systems. I didn't investigate much on this. I fixed this by replacing mknod by pathlib.Path.touch.

I don't know if I missed some obvious configuration of the project. I can share my fix with a pull request if you like.

set an time overlap

We should be able to set an time overlap for the diff (for the first import ?) and check that no data is missing.

DB only showing South Africa data

I have downloaded a country.pbf file and uploaded it in the settings folder, but still in database South Africa data is reflected. Please help.. Thanks in advance

Logs are confusing

osmupdate_1  | Old time     : (invalid timestamp)
osmupdate_1  | Current time : 2018-06-19T22:08:39Z
osmupdate_1  | osmupdate -v --max-days=100 sporadic --max-merge=7 --compression-level=1 --base-url=http://planet.openstreetmap.org/replication/ (invalid timestamp) /home/import_queue/(invalid timestamp)->-2018-06-19T22:08:39Z.osc.gz
osmupdate_1  | osmupdate Parameter: --max-days=100
osmupdate_1  | osmupdate Parameter: sporadic
osmupdate_1  | osmupdate Parameter: --max-merge=7
osmupdate_1  | osmupdate Parameter: --compression-level=1
osmupdate_1  | osmupdate Parameter: --base-url=http://planet.openstreetmap.org/replication/
osmupdate_1  | osmupdate Parameter: (invalid timestamp)
osmupdate_1  | osmupdate Parameter: /home/import_queue/(invalid timestamp)->-2018-06-19T22:08:39Z.osc.gz
osmupdate_1  | osmupdate Error: Old OSM file does not exist: sporadic
osmupdate_1  | An error occured in osmupdate. Let's try again.
osmupdate_1  | Sleeping for 2 seconds.

Especially the second and third last lines. Could we put something clearer there? It is hard to know if things are really broken of if that is a 'normal' error. Perhaps some message saying what to do about the error might be nice too?

Bitcoin miner in docker hub postgis 13 ?

Hi,

it seems that there is a bitcoin miner in this image:

https://hub.docker.com/layers/kartoza/postgis/13/images/sha256-0ebcf54aa52c3c433307273c3f69a07952bb7f794f8d1ee91faaf611b974ae88?context=explore

We installed it few days ago on a machine and 2 days after the process kdevtmpfsi show up consuming 100% CPU.
See here for an issue describing the pb: docker-library/postgres#798

I stoped the container, removed the image, rebooted and deployed the kartoza/posgis:11-2.5.
We already use this image elsewhere and it seems that the miner is not present.

Any idea why it appeared in this last image ?

allow using .poly file for clipping instead of .shp

The documentation says:

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'.

However, it is often easier to get a .poly file that to produce a .shp file (out of a .poly). For instance, for South Africa, this is enough:
wget https://download.geofabrik.de/africa/south-africa.poly
It would be great to be able to use such a poly file. Looking rapidly at the code, it seems that it might be called anyway (unsure), see

" ./osmupdate london_old.o5m london_new.o5m -B=london.poly\n"

remove warnings deprecated code

[INFO] [mapping] warn: exclude_tags filter is deprecated and will be removed. See require and reject filter.
and
/usr/local/lib/python2.7/dist-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8;

No polygon layer in the PG container

I just tried the latest develop branch.

I don't have any polygon layer anymore :
Screenshot from 2021-09-30 12-41-54

I don't think the issue in Docker-OSM, but we need to investigate why and where is the issue.

All polygons layer are recognised as invalid (tabular in the screenshot), like buildings, landscape

db healthcheck: role does not exist

This error appears periodically:

dockerosm-db-1         | 2022-09-20 18:06:51.338 UTC [1841] root@gis FATAL:  role "root" does not exist

This is due to a wrong health check.

SQL request are slow

Hi guys,
I'm currently making some test for a world OSM database deployed by docker-osm (great work btw!) but i have a big issue: any sql request on database are very slow (several hours for a simple SELECT COUNT(osm_id) on public.osm_buildings e.g.).

I created a DB on the same PostGIS instance running under Docker, and for a same request on a table where i imported 2.7 millions buildings, i takes around 7 seconds.

On each table, "osm_id" and "geometry" fields are indexed, so i don't understand why it takes so many times.

osmupdate: retreave timestamp form .pbf file

dowload.py tries to retrieve the latest timestamp from country.pbf using osmconvert country.pbf --out-timestamp.
If the country.pbf file does not have a timestamp and, osmconvert returns (invalid timestamp), download.py could recover the last-timestamp using osmconvert country.pbf --out-statistics, or is should throw an exception.

Minimal OL browser with search

We would like to have a small demo app on top of docker osm with these features:

  • Uses Postgrest on top of docker-osm
  • Adds a js static page displaying default OL tiles
  • add a button with will put the mouse in 'identify mode'
  • add a small search box widget. The widget will ask you to enter first one street name, then another.

Identify

  • Add a tool that enables clicking on the map
  • When clicking on the map, a Postgrest query should be run and a JSON structure returned containing:
  • town,
  • region,
    *country

For demo purposes, these should be displayed in a nice message overlay on the map

Street search

Two modes:

Mode 1: Single Street

  • Type a name (partial or complete) and receive a list of matches (first 10 perhaps)
  • Type ahead completion after entering the first three chars
  • Select a name
  • Zoom to the selected street
  • Highlight the selected road (draw an overlay as GeoJSON)

Mode 2: Street Intersection

  • Type a name (partial or complete) and receive a list of matches (first 10 perhaps)
  • Type ahead completion after entering the first three chars
  • Select a name
  • In a second box, type a name (partial or complete) and receive a list of matches filtered to roads that intersect the first road
  • Select the second name
  • Zoom to the intersection of the two streets
  • Highlight the two relevant streets (draw as an overlay from GeoJSON)

I propose to implement the above as:

  • New docker container 'docker-osm-viewer' contianing the static OL map page pointing at GeoServer
  • Postgrest for street and name API
  • mappings.yaml to include town, region, country admin boundaries from OSM

Please chat with me if yoo prefer another approach.

Note that we can't use public web services like nominatum for this since the whole deployment needs to be able to work in a LAN disconnected from the internet if needed.

[RFC] Changes needed for integration tests

We need a way to test the repo changes as proposed here:

I have no familiarity so far with the stack to determine if the images needs to have it's own unit test. So far we have 3 separate image under one repo. It may need a separate discussion.

At the moment, we can focus on an integration tests (tests that makes sure the stack works as one single services).

To do this, we need to have a clear goals on what needs to be tested:

  • we should have small/minimum test dataset with predictable result, as the input
  • what to test? connections? schema? final results of the data?
  • if possible let’s use test framework like python unittest, so it can be described and added easily
  • where to test? I guess we can only rely on GitHub action for now, since it uses docker-compose. hopefully it is under the github action test limit.

Requesting for comments from @timlinux @NyakudyaA @Gustry

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.