geopyspark
geopyspark copied to clipboard
Example in tms.rst not runnable
Got another documentation bug for you! This time on tms.rst: https://github.com/locationtech-labs/geopyspark/blob/master/docs/guides/tms.rst
# Reads in the first 3 levels of the layer
for zoom in range(0, 4):
layers.append(gps.query(uri="s3://azavea-datahub/catalog",
layer_name="nlcd-tms-epsg3857",
layer_zoom=zoom))
fails with an 403 error for access to the S3 resource.
Hey, @markwestcott34! Thanks for letting us know about this one too! What's happening here is that you're getting a permission error when you're trying to read the layer. Unfortunately, I don't know if we'll be able to change the permissions of that layer (I'll have to ask). Everything else in that example is correct, though; so it can still be used as a reference.
If you've been following the other guides, you can still run this example using the cropped.tif
:
layer = gps.geotiff.get(gps.LayerType.SPATIAL, "/tmp/cropped.tif")
tiled_layer = layer.tile_to_layout(gps.GlobalLayout(), 3857)
pyramid = tiled_layer.pyramid()
cm = gps.ColorMap.build(pyramid.get_histogram(), 'magma')
tms = gps.TMS.build(pyramid, cm)
While not the exact same, it'll still allow you to run through at least a portion of the guide. Though, you won't be able to run the examples that come later.
Thanks @jbouffard !
You're welcome, @markwestcott34!