Skip to content

Commit

Permalink
Merge pull request #111 from kvos/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
kvos authored Jul 13, 2020
2 parents 510cbe7 + 47afa7f commit afd4613
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
*.txt
*.geojson
*checkpoint.ipynb
*.csv
*.csv
*.xml
16 changes: 10 additions & 6 deletions coastsat/SDS_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,16 @@ def retrieve_images(inputs):

# merge overlapping images (necessary only if the polygon is at the boundary of an image)
if 'S2' in metadata.keys():
try:
metadata = merge_overlapping_images(metadata,inputs)
except:
print('WARNING: there was an error while merging overlapping S2 images,'+
' please open an issue on Github at https://github.com/kvos/CoastSat/issues'+
' and include your script so we can find out what happened.')
if int(ee.__version__[-3:]) <= 201:
try:
metadata = merge_overlapping_images(metadata,inputs)
except:
print('WARNING: there was an error while merging overlapping S2 images,'+
' please open an issue on Github at https://github.com/kvos/CoastSat/issues'+
' and include your script so we can find out what happened.')
else:
print('Overlapping Sentinel-2 images cannot be merged with your version of the earthengine-api (%s)'%ee.__version__)
print('To be able to merge overlapping images, revert to version 0.1.201')

# save metadata dict
with open(os.path.join(im_folder, inputs['sitename'] + '_metadata' + '.pkl'), 'wb') as f:
Expand Down
2 changes: 1 addition & 1 deletion example.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
settings = {
# general parameters:
'cloud_thresh': 0.5, # threshold on maximum cloud cover
'output_epsg': 28356, # epsg code of spatial reference system desired for the output
'output_epsg': 3857, # epsg code of spatial reference system desired for the output
# quality control:
'check_detection': True, # if True, shows each shoreline detection to the user for validation
'save_figure': True, # if True, saves a figure showing the mapped shoreline for each image
Expand Down
6 changes: 3 additions & 3 deletions example_jupyter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"source": [
"## 2. Shoreline extraction\n",
"\n",
"This section maps the position of the shoreline on the satellite images. The user can define the cloud threhold (`cloud_thresh`) and select the spatial reference system in which to output the coordinates of the mapped shorelines (`output_epsg`). See http://spatialreference.org/ to find the EPSG number corresponding to your local coordinate system. Make sure that your are using cartesian coordinates and not spherical coordinates (lat,lon) like WGS84. \n",
"This section maps the position of the shoreline on the satellite images. The user can define the cloud threhold (`cloud_thresh`) and select the spatial reference system in which to output the coordinates of the mapped shorelines (`output_epsg`). See http://spatialreference.org/ to find the EPSG number corresponding to your local coordinate system. Make sure that your are using cartesian coordinates and not spherical coordinates (lat,lon) like WGS84. If unsure, use 3857 which is the web mercator projection (used by Google Maps).\n",
"\n",
"To quality control each shoreline detection and manually validate the mapped shorelines, the user has the option to set the parameter `check_detection` to **True**. To save a figure for each mapped shoreline set `save_figure` to **True**. \n",
"\n",
Expand All @@ -134,7 +134,7 @@
"settings = { \n",
" # general parameters:\n",
" 'cloud_thresh': 0.5, # threshold on maximum cloud cover\n",
" 'output_epsg': 28356, # epsg code of spatial reference system desired for the output \n",
" 'output_epsg': 3857, # epsg code of spatial reference system desired for the output \n",
" # quality control:\n",
" 'check_detection': True, # if True, shows each shoreline detection to the user for validation\n",
" 'save_figure': True, # if True, saves a figure showing the mapped shoreline for each image\n",
Expand Down Expand Up @@ -387,7 +387,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
"version": "3.7.7"
},
"toc": {
"base_numbering": 1,
Expand Down

0 comments on commit afd4613

Please sign in to comment.