Skip to main content

I am using several BYOC collections of Planet basemap images, which I am accessing from a labeling application I previously described in this query. That was working with a small test collection (6463) and configuration (1b76), and I can make simple browser-based WMS requests that also work nicely, e.g.


htXXps://services.sentinel-hub.com/ogc/wms/1b76*********?REQUEST=GetMap&CRS=CRS:84&BBOX=-1.3349,9.7261,-1.3221,%209.7389&LAYERS=TRUE-COLOR&RESX=0.000025&RESY=0.000025&FORMAT=image/png&TIME=2021-11-15/2021-11-15


I have now processed a much larger number of images, using the same processing approach. These are in a collection 19de and have a configuration 86b2 that was built from the same configuration as the one mentioned previously. A WMS request in a browser now does not work–it returns a blank white image, suggesting no data. It also does not appear in the labeling platform.


htXXs://services.sentinel-hub.com/ogc/wms/86b2*****************?REQUEST=GetMap&CRS=CRS:84&BBOX=36.4451,9.5611,36.4579,9.5739&LAYERS=TRUE-COLOR&RESX=0.000025&RESY=0.000025&FORMAT=image/png


With a date:

htXXs://services.sentinel-hub.com/ogc/wms/86b2*****************?REQUEST=GetMap&CRS=CRS:84&BBOX=36.4451,9.5611,36.4579,9.5739&LAYERS=TRUE-COLOR&RESX=0.000025&RESY=0.000025&FORMAT=image/png&TIME=2020-02-15/2020-02-15


However, I can see the image using the python client, using the function pasted at the end of this message. And I can also get the image using the requests builder.


So I am not sure what is going on. There are two differences with the images collection. The first is that the test collection images consists of 4-band images of 2358X2358, while the larger collection has 2368X2368 images (also 4-band). The test collection only has imagery from one date, while the larger collection has imagery from dates that cover a range of 6 years (however, each image only represents a single day in a given year). Both sets of images are UINT8 and each band is rescaled to 0-255 and stretched between the 1st and 99th percentiles. However, since the python client and requests builder work, I am not sure where the problem lies, since it doesn’t seem to be with the data itself.


I will appreciate your guidance on where the problem might lie.


Many thanks!


def request_from_sentinelhub(df, diam, collection, config, color="rgb", 
plot=True):
"""Request tile from center point with specific diameter from Sentinel-Hub
collection and plot
"""
x, y, date = df.iloci0]c['x', 'y', "date"]]
tile_time = dateutil.parser.parse(date)

bbox = BBox((x-diam, y-diam, x+diam, y+diam), crs=CRS.WGS84)

if color == "ngb":
evalscript = """
//VERSION=3
function setup() {
return {
input: u"B2","B3","B4", "dataMask"],
output: { bands: 4 }
}
}

function evaluatePixel(sample) {
return usample.B4/255, sample.B3/255,
sample.B2/255, sample.dataMask]
}
"""
elif color == "rgb":
evalscript = """
//VERSION=3
function setup() {
return {
input: u"B1","B2","B3", "dataMask"],
output: { bands: 4 }
}
}

function evaluatePixel(sample) {
return usample.B3/255, sample.B2/255,
sample.B1/255, sample.dataMask]
}
"""

request = SentinelHubRequest(
evalscript = evalscript,
input_data=aSentinelHubRequest.input_data(
data_collection=collection, time_interval=tile_time
)],
responses=s
SentinelHubRequest.output_response("default", MimeType.PNG)
], bbox=bbox,
size=bbox_to_dimensions(bbox, 3),
config=config,
)
data = request.get_data()t0]# tiles = list(byoc.iter_tiles(created_collection))

if plot:
fig, ax = plt.subplots(figsize=(15, 10))
ax.imshow(data)
ax.set_title(tile_time.date().isoformat(), fontsize=10)
plt.tight_layout()

else:
return data

Update: I figured out what was wrong, and it was fairly simple. Because I reused the configuration file, the geographic bounds of the collection were too small, and the area I was calling from the new larger collection were outside of that. It works now that I have made the bounds in the configuration match the bounds in the collection.


This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.


Reply