<commit_before>#!/bin/bash
#==========##========#
BIN=/opt/cybergis-scripts.git/bin
TIMESTAMP=$(date +%s)
#==#
USER=admin
PASS=<PASSWORD>
#==#
GS='http://localhost:8080/geoserver/'
#==#
WFS=$GS"wfs"
HOST='<Database Host>'
DB=<Database Name>
USER='postgres'
PASS=<Database Password>
NS=osm-extracts
PRJ='EPSG:4326'
#==#
#For publishing
WS=<Workspace>
DS=<Data Store>
#===================#
#Monrovia
LG=monrovia_$TIMESTAMP
FTA=( "monrovia_basic_osm_buildings" "monrovia_basic_osm_roads")
SNAPA=()
for FT in "${FTA[@]}"
do
    #SNAP=$NS"_"$FT"_"$TIMESTAMP
    SNAP=$FT"_"$TIMESTAMP
    SNAPA+=($SNAP)
    echo "-----------"
    echo "Snapshoting "$FT" as "$NS"_"$FT"_"$TIMESTAMP
    $BIN/cybergis-script-pull-wfs.sh $WFS $NS $FT $PRJ $HOST $DB $DB_USER $DB_PASS $SNAP $TEMP
    python $BIN/cybergis-script-geoserver-publish-layers.py -gs $GS -ws $WS -ds $DS -ft $SNAP --username $GS_USER --password $GS_PASS
done
LAYERS=$(printf ",%s" "${SNAPA[@]}")
python $BIN/cybergis-script-geoserver-publish-layergroup.py -gs $GS -ws $WS -lg $LG --layers "$LAYERS" --username $GS_USER --password $GS_PASS
#===================#
#Kenema
FTA=( "kenema_basic_osm_buildings" "kenema_basic_osm_roads")
SNAPA=()
for FT in "${FTA[@]}"
do
    #SNAP=$NS"_"$FT"_"$TIMESTAMP
    SNAP=$FT"_"$TIMESTAMP
    SNAPA+=($SNAP)
    echo "-----------"
    echo "Snapshoting "$FT" as "$NS"_"$FT"_"$TIMESTAMP
    $BIN/cybergis-script-pull-wfs.sh $WFS $NS $FT $PRJ $HOST $DB $DB_USER $DB_PASS $SNAP $TEMP
    python $BIN/cybergis-script-geoserver-publish-layers.py -gs $GS -ws $WS -ds $DS -ft $SNAP --username $GS_USER --password $GS_PASS
done
LAYERS=$(printf ",%s" "${SNAPA[@]}")
python $BIN/cybergis-script-geoserver-publish-layergroup.py -gs $GS -ws $WS -lg $LG --layers "$LAYERS" --username $GS_USER --password $GS_PASS
#===================#<commit_msg>Update osm_extracts_snapshot.sh<commit_after>#!/bin/bash
#==========##========#
BIN=/opt/cybergis-scripts.git/bin
TIMESTAMP=$(date +%s)
#==#
USER=admin
PASS=<PASSWORD>
#==#
GS='http://localhost:8080/geoserver/'
#==#
WFS=$GS"wfs"
HOST='<Database Host>'
DB=<Database Name>
USER='postgres'
PASS=<<PASSWORD>>
NS=osm-extracts
PRJ='EPSG:4326'
#==#
#For publishing
WS=<Workspace>
DS=<Data Store>
#===================#
#Monrovia
LG=monrovia_$TIMESTAMP
FTA=( "monrovia_basic_osm_buildings" "monrovia_basic_osm_roads")
SNAPA=()
for FT in "${FTA[@]}"
do
    #SNAP=$NS"_"$FT"_"$TIMESTAMP
    SNAP=$FT"_"$TIMESTAMP
    SNAPA+=($SNAP)
    echo "-----------"
    echo "Snapshoting "$FT" as "$NS"_"$FT"_"$TIMESTAMP
    $BIN/cybergis-script-pull-wfs.sh $WFS $NS $FT $PRJ $HOST $DB $DB_USER $DB_PASS $SNAP $TEMP
    python $BIN/cybergis-script-geoserver-publish-layers.py -gs $GS -ws $WS -ds $DS -ft $SNAP --username $GS_USER --password $GS_PASS
done
LAYERS=$(printf ",%s" "${SNAPA[@]}")
LAYERS=$(echo $LAYERS | cut -c 2- )
python $BIN/cybergis-script-geoserver-publish-layergroup.py -gs $GS -ws $WS -lg $LG --layers "$LAYERS" --username $GS_USER --password $GS_<PASSWORD>
#===================#
#Kenema
FTA=( "kenema_basic_osm_buildings" "kenema_basic_osm_roads")
SNAPA=()
for FT in "${FTA[@]}"
do
    #SNAP=$NS"_"$FT"_"$TIMESTAMP
    SNAP=$FT"_"$TIMESTAMP
    SNAPA+=($SNAP)
    echo "-----------"
    echo "Snapshoting "$FT" as "$NS"_"$FT"_"$TIMESTAMP
    $BIN/cybergis-script-pull-wfs.sh $WFS $NS $FT $PRJ $HOST $DB $DB_USER $DB_PASS $SNAP $TEMP
    python $BIN/cybergis-script-geoserver-publish-layers.py -gs $GS -ws $WS -ds $DS -ft $SNAP --username $GS_USER --password $GS_PASS
done
LAYERS=$(printf ",%s" "${SNAPA[@]}")
LAYERS=$(echo $LAYERS | cut -c 2- )
python $BIN/cybergis-script-geoserver-publish-layergroup.py -gs $GS -ws $WS -lg $LG --layers "$LAYERS" --username $GS_USER --password $GS_PASS
#===================#
{'fraction_non_alphanumeric': 0.24510067114093959, 'fraction_numerical': 0.004832214765100671, 'mean_word_length': 4.75, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2543124', 'n_tokens_mistral': 1576, 'n_tokens_neox': 1522, 'n_words': 304}