geopyspark icon indicating copy to clipboard operation
geopyspark copied to clipboard

Example in tms.rst not runnable

Open markwestcott34 opened this issue 7 years ago • 3 comments

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.

markwestcott34 avatar Feb 15 '18 17:02 markwestcott34

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.

jbouffard avatar Feb 15 '18 17:02 jbouffard

Thanks @jbouffard !

markwestcott34 avatar Feb 15 '18 18:02 markwestcott34

You're welcome, @markwestcott34!

jbouffard avatar Feb 15 '18 18:02 jbouffard