Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geosphere-mapserver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cspp_geo
geosphere
geosphere-mapserver
Commits
5a20999a
Commit
5a20999a
authored
5 years ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Add tile gen readme, fix typos, and added multithreading to gdalwarp
parent
2038d8d6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tile_gen/Dockerfile
+6
-2
6 additions, 2 deletions
tile_gen/Dockerfile
tile_gen/README.md
+18
-0
18 additions, 0 deletions
tile_gen/README.md
tile_gen/generate_tiles.py
+4
-4
4 additions, 4 deletions
tile_gen/generate_tiles.py
with
28 additions
and
6 deletions
tile_gen/Dockerfile
+
6
−
2
View file @
5a20999a
FROM
tiledb/tiledb-geospatial:latest
# TODO may need the unzip command to be installed if not already
RUN
wget http://ssec.wisc.edu/~rayg/pub/amqpfind.zip
&&
\
RUN
apt-get update
&&
apt-get
install
-y
unzip
&&
\
wget http://ssec.wisc.edu/~rayg/pub/amqpfind.zip
&&
\
unzip amqpfind.zip
&&
\
rm
amqpfind.zip
rm
amqpfind.zip
&&
\
rm
-rf
/var/lib/apt/lists/
*
# FIXME: Remove once added to parent image
RUN
pip3
install
shapely
COPY
tile_index.py .
COPY
generate_tiles.py .
COPY
run.sh .
This diff is collapsed.
Click to expand it.
tile_gen/README.md
0 → 100644
+
18
−
0
View file @
5a20999a
# Tile Generation
## Build
```
bash
docker build
-t
gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-web-viewer/tile_gen:latest tile_gen/
docker push gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-web-viewer/tile_gen:latest
```
## Usage
```
bash
docker run
-p
8888:80
-d
gitlab.ssec.wisc.edu:5555/cspp_geo/cspp-geo-web-viewer/mapserver:latest
```
Then the main mapserv CGI script can be accessed with:
http://localhost:8888/cgi-bin/mapserv
This diff is collapsed.
Click to expand it.
tile_gen/generate_tiles.py
+
4
−
4
View file @
5a20999a
...
...
@@ -26,7 +26,7 @@ def group_files(products, input_files):
def
remap_to_lonlat
(
itif
,
otif
):
"""
Remap a single geotiff by calling gdalwarp.
"""
try
:
subprocess
.
run
([
'
gdalwarp
'
,
'
-t_srs
'
,
'
EPSG:4326
'
,
itif
,
otif
],
check
=
True
)
subprocess
.
run
([
'
gdalwarp
'
,
'
-multi
'
,
'
-wo
'
,
'
NUM_THREADS=ALL_CPUS
'
,
'
-t_srs
'
,
'
EPSG:4326
'
,
itif
,
otif
],
check
=
True
)
except
subprocess
.
CalledProcessError
:
LOG
.
error
(
"
Could not remap geotiff %s -> %s
"
%
(
itif
,
otif
))
return
None
...
...
@@ -57,15 +57,15 @@ def main():
help
=
"
Shapefile filename pattern to use and placed in the output directory. (default:
'
{product}.shp
'
)
"
)
parser
.
add_argument
(
'
out_dir
'
,
help
=
"
Output path to save tile information to (ex.
'
/data/tiles/{product}
'
)
"
)
parser
.
add_argument
(
'
input_files
'
,
parser
.
add_argument
(
'
input_files
'
,
nargs
=
"
+
"
,
help
=
"
Input geotiffs to generate tiles for (separate from product lists with
'
--
'
)
"
)
args
=
parser
.
parse_args
()
groups
=
group_files
(
args
.
products
,
args
.
input_files
)
for
prod
,
prod_files
in
groups
.
items
():
out_dir
=
args
.
out_dir
.
format
(
prod
)
out_dir
=
args
.
out_dir
.
format
(
product
=
prod
)
os
.
makedirs
(
out_dir
,
exist_ok
=
True
)
shp_fn
=
args
.
shape_file
.
format
(
prod
)
shp_fn
=
args
.
shape_file
.
format
(
product
=
prod
)
shp_pathname
=
os
.
path
.
join
(
out_dir
,
shp_fn
)
# remap if needed
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment