Skip to content
Snippets Groups Projects
Commit 874680c4 authored by Simon Dreutter's avatar Simon Dreutter
Browse files

Delete 1_process_add_backup1.py

parent a817fb17
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
"""
####################################################################
# #
# AWI Basemap #
# PROCESS ANTARCTIC DIGITAL DATANASE DATA #
# #
####################################################################
This script is processing the Antarctic Digital Database (ADD) input
for the AWI Basemap. Input layers are the ADD coastlines and the ADD
rock outcrops. Both layers are reprojected to a global CRS
(EPSG_WORLD), coastlines are separated by shelf ice and ice sheet,
and the rock outcrop geometries are fixed.
"""
#=============================================================================
# SCRIPT INFO
#=============================================================================
__author__ = 'Simon Dreutter'
__version__ = '0.1'
__date__ = '2020-12-17'
__email__ = 'simon.dreutter@awi.de'
__status__ = 'Developement'
#=============================================================================
# IMPORT
#=============================================================================
# import AWI Basemap configuration
from config import *
#=============================================================================
# PROCESS
#=============================================================================
EPSG_ADD = 'EPSG:3031'
msg = 'Reprojecting and extracting land mask from ADD coastlines...'
cmd = f'ogr2ogr -s_srs {EPSG_ADD} -t_srs {EPSG_WORLD} -nln "add_coastline_land" -where "\"surface\" = \'land\'" -wrapdateline -f GPKG {ADD_COASTLINE_LAND} {ADD_COASTLINE_IN}'
run(msg,cmd)
msg = 'Reprojecting and extracting ice mask from ADD coastlines...'
cmd = f'ogr2ogr -s_srs {EPSG_ADD} -t_srs {EPSG_WORLD} -nln "add_coastline_ice" -where "\"surface\" = \'ice shelf\' OR \"surface\" = \'rumple\' OR \"surface\" = \'ocean\' OR \"surface\" = \'ice tongue\'" -wrapdateline -f GPKG {ADD_SHELF_ICE} {ADD_COASTLINE_IN}'
run(msg,cmd)
msg = 'Reprojecting ADD rock outcrops...'
cmd = f'ogr2ogr -s_srs {EPSG_ADD} -t_srs {EPSG_WORLD} -nln "add_rock_outcrop" -wrapdateline -f GPKG {ADD_ROCK_OUTCROP} {ADD_ROCK_OUTCROP_IN}'
run(msg,cmd)
msg = 'Fixing ADD rock outcrops geometries...'
cmd = f'ogr2ogr -dialect sqlite -sql "SELECT ST_Buffer(geom, 0.0) AS geom,* FROM \"add_rock_outcrop\"" -nln "add_rock_outcrop_fixed" -f GPKG {ADD_ROCK_OUTCROP_FIXED} {ADD_ROCK_OUTCROP}'
run(msg,cmd)
print()
print('ADD done!')
print()
print('Now do not forget to manually cut the rock outcrops from the ADD land layer!')
print()
input('Press Enter to exit!')
print()
#=============================================================================
# TODO
#=============================================================================
"""
- find a scripted solution for 'Difference'
- once found, add cleanup
"""
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment