8
8
echo JAVACMD_OPTIONS=\" -server -Xmx$memory \" > ~/.osmosis
9
9
fi
10
10
11
- # Fixing name for file
11
+ # Fixing name for historical file
12
12
date=$( date ' +%y%m%d_%H%M' )
13
- fullHistoryFile=history-${date} .osm.bz2
13
+ fullHistoryFile=history-${date} .osh.pbf
14
14
# In case overwrite the file
15
15
if [ " $OVERWRITE_FHISTORY_FILE " == " true" ]; then
16
- fullHistoryFile=history-latest.osm.bz2
16
+ fullHistoryFile=history-latest.osh.pbf
17
17
fi
18
- # State file
18
+
19
+ # State file nname
19
20
stateFile=" state.txt"
21
+ osm_tmp_file=" osm_tmp.osm"
20
22
21
23
# Creating full history
22
24
osmosis --read-apidb-change \
@@ -26,21 +28,25 @@ osmosis --read-apidb-change \
26
28
password=$POSTGRES_PASSWORD \
27
29
validateSchemaVersion=no \
28
30
readFullHistory=yes \
29
- --write-xml-change \
30
- compressionMethod=bzip2 \
31
- $fullHistoryFile
31
+ --write-xml-change \
32
+ compressionMethod=auto \
33
+ $osm_tmp_file
34
+
35
+ # Convert file to PBF file
36
+ osmium cat $osm_tmp_file -o $fullHistoryFile
37
+ osmium fileinfo $fullHistoryFile
32
38
33
39
# AWS
34
40
if [ $CLOUDPROVIDER == " aws" ]; then
35
- echo " https://$AWS_S3_BUCKET .s3.amazonaws.com/planet/full-history/$fullHistoryFile " > $stateFile
41
+ echo " https://$AWS_S3_BUCKET .s3.amazonaws.com/planet/full-history/$fullHistoryFile " > $stateFile
36
42
# Upload to S3
37
- aws s3 cp $fullHistoryFile $AWS_S3_BUCKET /planet/full-history/$fullHistoryFile --acl public-read
38
- aws s3 cp $stateFile $AWS_S3_BUCKET /planet/full-history/$stateFile --acl public-read
43
+ aws s3 cp $fullHistoryFile $AWS_S3_BUCKET /planet/full-history/$fullHistoryFile --acl public-read
44
+ aws s3 cp $stateFile $AWS_S3_BUCKET /planet/full-history/$stateFile --acl public-read
39
45
fi
40
46
41
47
# Google Storage
42
48
if [ $CLOUDPROVIDER == " gcp" ]; then
43
- echo " https://storage.cloud.google.com/$GCP_STORAGE_BUCKET /planet/full-history/$fullHistoryFile " > $stateFile
49
+ echo " https://storage.cloud.google.com/$GCP_STORAGE_BUCKET /planet/full-history/$fullHistoryFile " > $stateFile
44
50
# Upload to GS
45
51
gsutil cp -a public-read $fullHistoryFile $GCP_STORAGE_BUCKET /planet/full-history/$fullHistoryFile
46
52
gsutil cp -a public-read $stateFile $GCP_STORAGE_BUCKET /planet/full-history/$stateFile
0 commit comments