Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3bc0eb2

Browse files
committed
Now raising NoHeightMapDataException if data is missing, rather than Exception
1 parent 4193346 commit 3bc0eb2

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

.envrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export SRTM1_DIR=/Users/adam/Projects/gardunha-monorepo/src/python/gn/website/hgt
2+
export SRTM3_DIR=/Volumes/General/srtm/version2_1/SRTM3/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
.env
77
/dist
88
*.cprof
9+
.envrc

srtm/exceptions.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
3+
class NoHeightMapDataException(Exception):
4+
pass
5+
6+

srtm/height_map_collection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from typing import Dict, Type, List, Generator, Tuple
33

44
from srtm.base_coordinates import RasterBaseCoordinates
5+
from srtm.exceptions import NoHeightMapDataException
56
from srtm.utilities import (
67
points_on_line,
78
SRTM3_DIR,
@@ -60,7 +61,7 @@ def get_height_map_for_latitude_and_longitude(
6061
try:
6162
return self.height_maps[base]
6263
except KeyError:
63-
raise Exception(
64+
raise NoHeightMapDataException(
6465
f"Height map for {base} not found. Have you called "
6566
f"build_file_index() on your heightmap collection?"
6667
)

0 commit comments

Comments
 (0)