Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
I fetch the changes from remote and then merge them into the master branch
  • Loading branch information
miladmoradi89 committed Sep 16, 2021
2 parents b1c964a + 592edb4 commit 15d62fe
Show file tree
Hide file tree
Showing 8 changed files with 1,052 additions and 10 deletions.
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,5 +241,47 @@ python3 pgrastertime.py -t soundings_4m -m time_start='2017-12-31' -m time_end='
* Include xml.sh process through SQLAlchemy


# Gdal version command line
```
python3 pgrastertime.py -s ./sql/basePostProcess.sql -t testtable -f -r ./data/ -p xml -m gdal_path=gdal-2.4.0
```
# Docker
We built a dockerfile with the latest version of gdal osgeo / gdal: ubuntu-full-latest. Since we use
Docker, we can remove the python environment part and run commands directly as root.
We are also referring to another container for the postgis part which could be stacked in a stack.
First, create an image. The Dockerfile in the directory where file is locate.
The content of the dockerfile
```
FROM osgeo/gdal:ubuntu-full-latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y tzdata git postgresql postgis build-essential nano python3-pip
RUN git clone https://github.com/mapgears/pgrastertime && \
pip3 install sqlalchemy && \
pip3 install geoalchemy2 && \
pip3 install psycopg2-binary
```
```
docker build -t name_of_image .
```
Run the container with this images. https://docs.docker.com/engine/reference/run/
in a shell console do the next command

```
cd pgrastertime
cp development.ini local.ini
nano local.ini
```
replace local.ini parameters


put the coordinates of the db.
```
postgresql://user:password@localhost:5432/pgrastertime
by
postgresql://loader:loader@ipaddress_of_posgis_db:5432/pgrastertime
```
Try some example and when this container work well, you can save the container to the new configurated image.
https://docs.docker.com/engine/reference/commandline/commit/
15 changes: 15 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM osgeo/gdal:ubuntu-full-latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y tzdata git postgresql postgis build-essential nano python3-pip

RUN git clone https://github.com/mapgears/pgrastertime && \
pip3 install sqlalchemy && \
pip3 install geoalchemy2 && \
pip3 install psycopg2-binary

# dont forget attach to container run the folowing command
# cd pgrastertime
# cp development.ini local.ini
# nano local.ini
#
49 changes: 49 additions & 0 deletions mapfile/wis-conformance.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
CLASS
EXPRESSION ([pixel] >= 1)
NAME "More than 1.0m shallower than reference depth"
STYLE
COLOR "#FC8327"
END
END
CLASS
EXPRESSION ([pixel] <1 AND [pixel] >=0.5)
NAME "0.5 to 1.0m shallower than reference depth"
STYLE
COLOR "#FEBE26"
END
END
CLASS
EXPRESSION ([pixel] < 0.5 AND [pixel] >=0)
NAME "Less than 0.5m shallower than reference depth"
STYLE
COLOR "#FEF65B"
END
END
CLASS
EXPRESSION ([pixel] <0 AND [pixel] >=-0.5)
NAME "Less than 0.5m deeper than reference depth"
STYLE
COLOR "#73E0FF"
END
END
CLASS
EXPRESSION ([pixel] <-0.5 AND [pixel] >=-1)
NAME "0.5 to 1.0m deeper than reference depth"
STYLE
COLOR "#4CBCF8"
END
END
CLASS
EXPRESSION ([pixel] <-1 AND [pixel] >=-1.5)
NAME "1.0 to 1.5m deeper than reference depth"
STYLE
COLOR "#2B9DFE"
END
END
CLASS
EXPRESSION ([pixel] <=-1.5)
NAME "More than 1.5m deeper than reference"
STYLE
COLOR "#A5A5A5"
END
END
49 changes: 49 additions & 0 deletions mapfile/wis-sivn-rainbow.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
CLASS
EXPRESSION ([pixel] <0 AND [pixel] >=-8)
NAME "0 to 8 m"
STYLE
COLORRANGE 152 0 86 254 0 0
DATARANGE 0 -8
END
END
CLASS
EXPRESSION ([pixel] <-8 AND [pixel] >=-10)
NAME "8 to 10 m"
STYLE
COLORRANGE 254 0 0 255 255 0
DATARANGE -8 -10
END
END
CLASS
EXPRESSION ([pixel] <-10 AND [pixel] >=-12)
NAME "10 to 12 m"
STYLE
COLORRANGE 255 255 0 0 255 0
DATARANGE -10 -12
END
END
CLASS
EXPRESSION ([pixel] <-12 AND [pixel] >=-14)
NAME "12 to 14 m"
STYLE
COLORRANGE 0 255 0 0 255 255
DATARANGE -12 -14
END
END
CLASS
EXPRESSION ([pixel] <-14 AND [pixel] >=-20)
NAME "14 to 20 m"
STYLE
COLORRANGE 0 255 255 0 0 255
DATARANGE -14 -20
END
END
CLASS
EXPRESSION ([pixel] <-20 AND [pixel] >=-105)
NAME "20 to 105 m"
STYLE
COLORRANGE 0 0 255 116 0 122
DATARANGE -20 -105
END
END

Loading

0 comments on commit 15d62fe

Please sign in to comment.