-
Notifications
You must be signed in to change notification settings - Fork 56
Conversation
Tests pass locally for me |
self._name = "image-{}".format(str(uuid.uuid4())) | ||
self._url_template = url + "?access_token={token}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're no longer doing templating let's get rid of ._url_template
and just make it ._url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me. I wanted to edit as little as possible, but that change makes sense to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also update the section in docs/imagery_access.rst
?
gbdxtools/images/tms_image.py
Outdated
|
||
Instead of an ID the zoom level to use can be specified (default is 22). Changing the zoom level will change the resolution of the image. Note that different image sources are used at different zoom levels. | ||
Instead of an ID the zoom level to use can be specified (default is 18). Changing the zoom level will change the resolution of the image. Note that different image sources are used at different zoom levels. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can drop the part about "Different image sources are used at different zoom levels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I was using a DG test that does this, but depending on the service this isn't applicable.
gbdxtools/images/tms_image.py
Outdated
bbox (list): (optional) Bounding box of AOI, if aoi() method is not used. | ||
|
||
Example: | ||
>>> img = TmsImage(zoom=13, bbox=[-109.84, 43.19, -109.59, 43.34])''' | ||
>>> img = TmsImage(url=r"https://earthwatch.digitalglobe.com/earthservice/tmsaccess/tms/1.0.0/DigitalGlobe:ImageryTileService@EPSG:3857@jpg/{z}/{x}/{y}.jpg?connectId=", zoom=13, bbox=[-109.84, 43.19, -109.59, 43.34])''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use url=
here since it's positional and required
@@ -66,7 +68,8 @@ def test_tms_image_aoi(self): | |||
# a 1 x 4 chunk of tiles, so 256 x 1024 pixels | |||
# then offset by 1/2 tile in x and y | |||
bbox = [-74.71046447753906, 40.53624234037728, -74.70909118652344, 40.54041698756514] | |||
img = self.gbdx.tms_image(zoom=18) | |||
url = r"https://a.tile.openstreetmap.org/{z}/{x}/{y}.png" | |||
img = TmsImage(url=url, zoom=18) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same in here with url=
Looks good, thanks for the fix |
I updated the functionality of the class. It now requires you to pass a url to the class. I have removed all reference to mapbox and access_tokens. This should now work for any tms service passed to it.