Własny serwer kafelków

Dokładnie taki plik configuration.txt zapisałem. Dodatkowo rórwnież należało stworzyć plik state.txt, który wygląda następująco

#original-source: http://planet.openstreetmap.org/replication/day/000/001/612.state.txt
#generated-by: https://osm.mazdermind.de/replicate-sequences/?Y=2017&m=02&d=10&H=15&i=22&s=08&stream=day
#Fri Feb 10 00:06:19 UTC 2017
sequenceNumber=1612
timestamp=2017-02-10T00\:00\:00Z

Pytanie natomiast czy mój plik update.sh wygląda prawidłowo

time osmosis --read-replication-interval workingDirectory=/opt/osm/update \
  --simplify-change --write-xml-change - | \
osm2pgsql --append -d gis -U psql --cache 7200 --number-processes 4 --slim \
  --flat-nodes --bbox 19.2,48.9,24,50.9 europe_nodes.bin -

gdyż dla tej komendy otrzymuje błąd przy uruchomieniu

/opt/osm/osm-scripts/update.sh
osm2pgsql version 0.93.0-dev (64 bit id space)

Using built-in tag processing pipeline
Using projection SRS 3857 (Spherical Mercator)
Setting up table: planet_osm_point
Setting up table: planet_osm_line
Setting up table: planet_osm_polygon
Setting up table: planet_osm_roads
Allocating memory for dense node cache
Allocating dense node cache in one big chunk
Allocating memory for sparse node cache
Sharing dense sparse
Node-cache: cache=7200MB, maxblocks=115200*65536, allocation method=11
Mid: loading persistent node cache from --bbox
Mid: pgsql, cache=7200
Setting up table: planet_osm_nodes
Setting up table: planet_osm_ways
Setting up table: planet_osm_rels

Reading in file: 19.2,48.9,24,50.9
node cache: stored: 0(-nan%), storage efficiency: -nan% (dense blocks: 0, sparse nodes: 0), hit rate: -nan%
Osm2pgsql failed due to ERROR: Cannot detect file format. Try using -r.
lut 10, 2017 3:26:39 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.45
lut 10, 2017 3:26:39 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
lut 10, 2017 3:26:39 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
lut 10, 2017 3:26:39 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
lut 10, 2017 3:26:40 PM org.openstreetmap.osmosis.core.pipeline.common.ActiveTaskManager waitForCompletion
SEVERE: Thread for task 1-read-replication-interval failed
java.lang.NumberFormatException: null
        at java.lang.Integer.parseInt(Integer.java:542)
        at java.lang.Integer.parseInt(Integer.java:615)
        at org.openstreetmap.osmosis.replication.v0_6.impl.ReplicationDownloaderConfiguration.getMaxInterval(ReplicationDownloaderConfiguration.java:66)
        at org.openstreetmap.osmosis.replication.v0_6.BaseReplicationDownloader.calculateMaximumTimestamp(BaseReplicationDownloader.java:197)
        at org.openstreetmap.osmosis.replication.v0_6.BaseReplicationDownloader.download(BaseReplicationDownloader.java:222)
        at org.openstreetmap.osmosis.replication.v0_6.BaseReplicationDownloader.runImpl(BaseReplicationDownloader.java:304)
        at org.openstreetmap.osmosis.replication.v0_6.BaseReplicationDownloader.run(BaseReplicationDownloader.java:383)
        at java.lang.Thread.run(Thread.java:745)

lut 10, 2017 3:26:40 PM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed.
        at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForCompletion(Pipeline.java:146)
        at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)
        at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

Dla testów staram się ograniczyć obszar dla jedynie dwóch województw stąd dopisana zmienna bbox

Chciałem sprawdzić na ile aktualna jest moja skrócona instrukcja instalacji serwera dla Gentoo http://bigvo.hopto.org/osm-extra/INSTALL.md i przeinstalowałem na nowo bazę po czym wywaliło mnie błędem którego dotychczas nie widziałem.

serw-zfs conf.d # /etc/init.d/postgresql-9.6 start
 * /run/postgresql: creating directory
 * /run/postgresql: correcting owner
 * Starting PostgreSQL 9.6 ...
DZIENNIK:  pominięto brakujący plik konfiguracyjny "/mnt/4tb/nagrania/osm/postgres/postgresql.auto.conf"                                                                                                     [ ok ]
serw-zfs conf.d # su - postgres
postgres@serw-zfs ~ $ createuser96 psql
postgres@serw-zfs ~ $ createdb96 -E UTF8 -O psql gis
postgres@serw-zfs ~ $ psql96 -d gis -c "CREATE EXTENSION hstore;"
CREATE EXTENSION
postgres@serw-zfs ~ $ psql96 -d gis -c "CREATE EXTENSION postgis;"
BŁĄD:  kolumna "srtExt" relacji "spatial_ref_sys" nie istnieje

Wiele w systemie od tego czasu nie zmieniłem co by miało znaczenie poza wersją postgresql. Wiecie z czego to może wynikać? Nie bardzo cokolwiek znajduję.

 Wed Apr 19 23:32:23 2017 >>> dev-db/postgresql-9.6.2-r1
   merge time: 2 minutes and 23 seconds.

 Thu Jun  1 13:57:17 2017 >>> dev-db/postgresql-9.6.3-r1
   merge time: 2 minutes and 20 seconds.

A zainstalowałeś pakiet PostGIS? A może chodzi o uprawnienia? Zobacz tu:

https://gis.stackexchange.com/a/41704

Okazało się, że przy okazji reinstalacji postgresql w Gentoo trochę zmieniono tryb instalacji tak by można mieć kilka wersji postgresql jednocześnie, ale instalacja nie ustawiła ponownie prawidłowo aktualnie wykorzystywanej wersji. Po poprawieniu tego błędu komenda przeszła bez problemu.
Można by rzec dzień jak co dzień z tym systemem :wink:

podziwiam cię. Raz zainstalowałem bez GUI. Zajęło mi to kilka dni. Czysty masochism.

no nie jest łatwo, gdyż trzeba w miarę na bieżąco śledzić co znowu wymyślili, ale system skryptów portage jak się opanuje to dość prosto można dopisać kolejne skrypty dla softu którego standardowo nie ma w dystrybucji. Mam już ich tyle, że nie wiem jak bym miał się przesiąść na coś innego by je ponownie musieć sobie przygotowywać. Niemniej faktycznie wygląda to trochę tak, że dzielnie walczy się z problemami nieznanymi w innych systemach :wink:

Natomiast co może być przyczyną, błędu

Osm2pgsql failed due to ERROR: failed to uncompress data: data error

Jak tworzę bazę dla Podkarpacia to wszystko jest ok. Przygotowanie bazy dla Europy przerywa mnie tym samym błędem i to dla dla kilku wersji pliku dla kontynentu nie tylko najnowszego ale i sprzed kilku dni.

Podkarpackie

osm2pgsql version 0.92.1 (64 bit id space)

Using built-in tag processing pipeline
Using projection SRS 3857 (Spherical Mercator)
Setting up table: planet_osm_point
Setting up table: planet_osm_line
Setting up table: planet_osm_polygon
Setting up table: planet_osm_roads
Allocating memory for dense node cache
Allocating dense node cache in one big chunk
Allocating memory for sparse node cache
Sharing dense sparse
Node-cache: cache=16000MB, maxblocks=256000*65536, allocation method=11
Mid: loading persistent node cache from /mnt/3tb/flatnodes
Allocated space for persistent node cache file
Maximum node in persistent node cache: 0
Mid: pgsql, scale=100 cache=16000
Setting up table: planet_osm_nodes
Setting up table: planet_osm_ways
Setting up table: planet_osm_rels

Reading in file: /mnt/3tb/podkarpackie-latest.osm.pbf
Using PBF parser.
Processing: Node(9921k 20.8k/s) Way(1236k 137.44k/s) Relation(8080 621.54/s)  parse time: 500s
Node stats: total(9921902), max(4942954186) in 476s
Way stats: total(1236985), max(504086971) in 9s
Relation stats: total(8083), max(7363460) in 13s
Maximum node in persistent node cache: 4942987263
Committing transaction for planet_osm_point
Committing transaction for planet_osm_line
Committing transaction for planet_osm_polygon
Committing transaction for planet_osm_roads
Mid: loading persistent node cache from /mnt/3tb/flatnodes
Maximum node in persistent node cache: 4942987263
Setting up table: planet_osm_nodes
Setting up table: planet_osm_ways
Setting up table: planet_osm_rels
Using built-in tag processing pipeline
Mid: loading persistent node cache from /mnt/3tb/flatnodes
Maximum node in persistent node cache: 4942987263
Setting up table: planet_osm_nodes
Setting up table: planet_osm_ways
Setting up table: planet_osm_rels
Using built-in tag processing pipeline
Mid: loading persistent node cache from /mnt/3tb/flatnodes
Maximum node in persistent node cache: 4942987263
Setting up table: planet_osm_nodes
Setting up table: planet_osm_ways
Setting up table: planet_osm_rels
Using built-in tag processing pipeline
Mid: loading persistent node cache from /mnt/3tb/flatnodes
Maximum node in persistent node cache: 4942987263
Setting up table: planet_osm_nodes
Setting up table: planet_osm_ways
Setting up table: planet_osm_rels
Using built-in tag processing pipeline

Going over pending ways...
        1035921 ways are pending

Using 4 helper-processes
Finished processing 1035921 ways in 48 s

1035921 Pending ways took 48s at a rate of 21581.69/s
Committing transaction for planet_osm_point
Committing transaction for planet_osm_line
Committing transaction for planet_osm_polygon
Committing transaction for planet_osm_roads
Committing transaction for planet_osm_point
Committing transaction for planet_osm_line
Committing transaction for planet_osm_polygon
Committing transaction for planet_osm_roads
Committing transaction for planet_osm_point
Committing transaction for planet_osm_line
Committing transaction for planet_osm_polygon
Committing transaction for planet_osm_roads
Committing transaction for planet_osm_point
Committing transaction for planet_osm_line
Committing transaction for planet_osm_polygon
Committing transaction for planet_osm_roads

Going over pending relations...
        0 relations are pending

Using 4 helper-processes
Finished processing 0 relations in 0 s

Committing transaction for planet_osm_point
OSTRZEŻENIE:  brak aktywnej transakcji
Committing transaction for planet_osm_line
OSTRZEŻENIE:  brak aktywnej transakcji
Committing transaction for planet_osm_polygon
OSTRZEŻENIE:  brak aktywnej transakcji
Committing transaction for planet_osm_roads
OSTRZEŻENIE:  brak aktywnej transakcji
Committing transaction for planet_osm_point
OSTRZEŻENIE:  brak aktywnej transakcji
Committing transaction for planet_osm_line
OSTRZEŻENIE:  brak aktywnej transakcji
Committing transaction for planet_osm_polygon
OSTRZEŻENIE:  brak aktywnej transakcji
Committing transaction for planet_osm_roads
OSTRZEŻENIE:  brak aktywnej transakcji
Committing transaction for planet_osm_point
OSTRZEŻENIE:  brak aktywnej transakcji
Committing transaction for planet_osm_line
OSTRZEŻENIE:  brak aktywnej transakcji
Committing transaction for planet_osm_polygon
OSTRZEŻENIE:  brak aktywnej transakcji
Committing transaction for planet_osm_roads
OSTRZEŻENIE:  brak aktywnej transakcji
Committing transaction for planet_osm_point
OSTRZEŻENIE:  brak aktywnej transakcji
Committing transaction for planet_osm_line
OSTRZEŻENIE:  brak aktywnej transakcji
Committing transaction for planet_osm_polygon
OSTRZEŻENIE:  brak aktywnej transakcji
Committing transaction for planet_osm_roads
OSTRZEŻENIE:  brak aktywnej transakcji
Stopping table: planet_osm_nodes
Sorting data and creating indexes for planet_osm_roads
Sorting data and creating indexes for planet_osm_line
Stopping table: planet_osm_ways
Building index on table: planet_osm_ways
Stopping table: planet_osm_rels
Building index on table: planet_osm_rels
Sorting data and creating indexes for planet_osm_polygon
Sorting data and creating indexes for planet_osm_point
Stopped table: planet_osm_nodes in 0s
Stopped table: planet_osm_rels in 0s
Copying planet_osm_roads to cluster by geometry finished
Creating geometry index on planet_osm_roads
Creating osm_id index on planet_osm_roads
Creating indexes on planet_osm_roads finished
All indexes on planet_osm_roads created in 1s
Completed planet_osm_roads
Copying planet_osm_point to cluster by geometry finished
Creating geometry index on planet_osm_point
Copying planet_osm_line to cluster by geometry finished
Creating geometry index on planet_osm_line
Creating osm_id index on planet_osm_point
Creating indexes on planet_osm_point finished
All indexes on planet_osm_point created in 4s
Completed planet_osm_point
Creating osm_id index on planet_osm_line
Creating indexes on planet_osm_line finished
All indexes on planet_osm_line created in 5s
Completed planet_osm_line
Copying planet_osm_polygon to cluster by geometry finished
Creating geometry index on planet_osm_polygon
Creating osm_id index on planet_osm_polygon
Creating indexes on planet_osm_polygon finished
All indexes on planet_osm_polygon created in 19s
Completed planet_osm_polygon
Stopped table: planet_osm_ways in 22s
Maximum node in persistent node cache: 4942987263
Maximum node in persistent node cache: 4942987263
Maximum node in persistent node cache: 4942987263
Maximum node in persistent node cache: 4942987263
node cache: stored: 9921902(100.00%), storage efficiency: 50.58% (dense blocks: 154, sparse nodes: 9178004), hit rate: 100.42%

Osm2pgsql took 570s overall

real    9m30,090s
user    2m19,789s
sys     0m23,298s

Europa

time osm2pgsql --create --slim \
        -C 16000 --number-processes 4 -k -m \
        --style /opt/osm/local_style/openstreetmap-carto.style --multi-geometry \
        -U psql -c -d gis \
        --flat-nodes /mnt/3tb/flatnodes \
        /mnt/3tb/europe-latest.osm.pbf

osm2pgsql version 0.92.1 (64 bit id space)

Using built-in tag processing pipeline
Using projection SRS 3857 (Spherical Mercator)
Setting up table: planet_osm_point
Setting up table: planet_osm_line
Setting up table: planet_osm_polygon
Setting up table: planet_osm_roads
Allocating memory for dense node cache
Allocating dense node cache in one big chunk
Allocating memory for sparse node cache
Sharing dense sparse
Node-cache: cache=16000MB, maxblocks=256000*65536, allocation method=11
Mid: loading persistent node cache from /mnt/3tb/flatnodes
Allocated space for persistent node cache file
Maximum node in persistent node cache: 0
Mid: pgsql, scale=100 cache=16000
Setting up table: planet_osm_nodes
Setting up table: planet_osm_ways
Setting up table: planet_osm_rels

Reading in file: /mnt/3tb/europe-latest.osm.pbf
Using PBF parser.
Processing: Node(737290k 2355.6k/s) Way(0k 0.00k/s) Relation(0 0.00/s)Maximum node in persistent node cache: 1984954367
node cache: stored: 737296000(100.00%), storage efficiency: 60.93% (dense blocks: 86734, sparse nodes: 249737386), hit rate: -nan%
Osm2pgsql failed due to ERROR: failed to uncompress data: data error

real    5m13,909s
user    7m47,838s
sys     0m14,349s