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
1536f6fe
Commit
1536f6fe
authored
5 years ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Fix tile generation not re-using existing geotiffs
parent
fbd92068
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tile_gen/Dockerfile
+2
-0
2 additions, 0 deletions
tile_gen/Dockerfile
tile_gen/generate_tiles.py
+10
-2
10 additions, 2 deletions
tile_gen/generate_tiles.py
tile_gen/run.sh
+2
-0
2 additions, 0 deletions
tile_gen/run.sh
with
14 additions
and
2 deletions
tile_gen/Dockerfile
+
2
−
0
View file @
1536f6fe
FROM
tiledb/tiledb-geospatial:latest
FROM
tiledb/tiledb-geospatial:latest
WORKDIR
/work
# TODO may need the unzip command to be installed if not already
# TODO may need the unzip command to be installed if not already
RUN
apt-get update
&&
apt-get
install
-y
unzip
&&
\
RUN
apt-get update
&&
apt-get
install
-y
unzip
&&
\
wget http://ssec.wisc.edu/~rayg/pub/amqpfind.zip
&&
\
wget http://ssec.wisc.edu/~rayg/pub/amqpfind.zip
&&
\
...
...
This diff is collapsed.
Click to expand it.
tile_gen/generate_tiles.py
+
10
−
2
View file @
1536f6fe
...
@@ -6,6 +6,7 @@ import warnings
...
@@ -6,6 +6,7 @@ import warnings
import
logging
import
logging
import
subprocess
import
subprocess
import
shutil
import
shutil
from
glob
import
glob
import
tile_index
import
tile_index
...
@@ -67,7 +68,9 @@ def main():
...
@@ -67,7 +68,9 @@ def main():
help
=
"
Product names to group together in each
"
help
=
"
Product names to group together in each
"
"'
layer
'
. Product name must be in the filename.
"
)
"'
layer
'
. Product name must be in the filename.
"
)
parser
.
add_argument
(
'
--shape-file
'
,
default
=
'
{product}.shp
'
,
parser
.
add_argument
(
'
--shape-file
'
,
default
=
'
{product}.shp
'
,
help
=
"
Shapefile filename pattern to use and placed in the output directory. (default:
'
{product}.shp
'
)
"
)
help
=
"
Shapefile filename pattern to use and placed
"
"
in the output directory.
"
"
(default:
'
{product}.shp
'
)
"
)
parser
.
add_argument
(
'
out_dir
'
,
parser
.
add_argument
(
'
out_dir
'
,
help
=
"
Output path to save tile information to (ex.
'
/data/tiles/{product}
'
)
"
)
help
=
"
Output path to save tile information to (ex.
'
/data/tiles/{product}
'
)
"
)
parser
.
add_argument
(
'
input_files
'
,
nargs
=
"
+
"
,
parser
.
add_argument
(
'
input_files
'
,
nargs
=
"
+
"
,
...
@@ -88,8 +91,13 @@ def main():
...
@@ -88,8 +91,13 @@ def main():
# hardlink if needed
# hardlink if needed
prod_files
=
list
(
link_or_copy
(
prod_files
,
out_dir
))
prod_files
=
list
(
link_or_copy
(
prod_files
,
out_dir
))
# get all products in the current directory
ext
=
os
.
path
.
splitext
(
prod_files
[
-
1
])[
-
1
]
all_prod_files
=
sorted
(
glob
(
os
.
path
.
join
(
out_dir
,
'
*
'
+
prod
+
'
*
'
+
ext
)))
# create shape file
# create shape file
tile_index
.
index
(
prod_files
,
shp_pathname
)
LOG
.
info
(
"
Rebuilding shapefile index with:
\n\t
{}
"
.
format
(
"
,
"
.
join
(
all_prod_files
)))
tile_index
.
index
(
all_prod_files
,
shp_pathname
)
...
...
This diff is collapsed.
Click to expand it.
tile_gen/run.sh
+
2
−
0
View file @
1536f6fe
...
@@ -50,6 +50,8 @@ run_tile_gen() {
...
@@ -50,6 +50,8 @@ run_tile_gen() {
# generate_tiles.py will make a temporary directory
# generate_tiles.py will make a temporary directory
out_dir
=
"
${
dst_dir
}
/tiles/
${
satellite_family
}
/
${
satellite_id
}
/
${
instrument
}
"
out_dir
=
"
${
dst_dir
}
/tiles/
${
satellite_family
}
/
${
satellite_id
}
/
${
instrument
}
"
mkdir
-p
${
out_dir
}
mkdir
-p
${
out_dir
}
# add string formatting portion to separate add 'product' sub-directory
out_dir
=
"
${
out_dir
}
/{product}"
python3 generate_tiles.py
${
TILE_ARGS
}
-p
${
G2G_PRODUCTS
}
--
${
out_dir
}
${
path
}
python3 generate_tiles.py
${
TILE_ARGS
}
-p
${
G2G_PRODUCTS
}
--
${
out_dir
}
${
path
}
# OUT/<product>/<product>.shp
# OUT/<product>/<product>.shp
glob_pattern
=
"
${
out_dir
}
/*/*.shp"
glob_pattern
=
"
${
out_dir
}
/*/*.shp"
...
...
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