Skip to content

Commit a75a775

Browse files
committed
Update tests and proj use
1 parent 3b77a1a commit a75a775

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

label_maker/utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from urllib.parse import urlparse, parse_qs
55

66
from mercantile import bounds
7-
from pyproj import Proj, Transformer
7+
from pyproj import Transformer
88
from PIL import Image
99
import numpy as np
1010
import requests
@@ -49,8 +49,8 @@ def get_tile_tif(tile, imagery, folder, kwargs):
4949
imagery_offset = kwargs.get('imagery_offset') or [0, 0]
5050
with rasterio.open(imagery) as src:
5151
x_res, y_res = src.transform[0], src.transform[4]
52-
p1 = Proj('epsg:4326')
53-
p2 = Proj(str(src.crs))
52+
p1 = 'epsg:4326'
53+
p2 = str(src.crs)
5454
transformer = Transformer.from_crs(p1, p2)
5555

5656
# offset our imagery in the "destination pixel" space
@@ -107,8 +107,8 @@ def get_tile_wms(tile, imagery, folder, kwargs):
107107

108108
# find our tile bounding box
109109
bound = bounds(*[int(t) for t in tile.split('-')])
110-
p1 = Proj('epsg:4326')
111-
p2 = Proj(wms_srs)
110+
p1 = 'epsg:4326'
111+
p2 = wms_srs
112112
transformer = Transformer.from_crs(p1, p2)
113113

114114
# project the tile bounding box from lat/lng to WMS SRS

test/integration/test_segmentation_labels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_cli(self):
3333
'62093-50164-17': 2400,
3434
'62094-50162-17': 21234,
3535
'62094-50164-17': 19146,
36-
'62094-50163-17': 21613,
36+
'62094-50163-17': 21611,
3737
'62093-50163-17': 31568
3838
}
3939

test/integration/test_segmentation_labels_sparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_cli(self):
3232
'62093-50164-17': 2400,
3333
'62094-50162-17': 21234,
3434
'62094-50164-17': 19146,
35-
'62094-50163-17': 21613,
35+
'62094-50163-17': 21611,
3636
'62093-50163-17': 31568
3737
}
3838

0 commit comments

Comments
 (0)