csparpa / pyowm

A Python wrapper around the OpenWeatherMap web API
https://pyowm.readthedocs.io
MIT License
789 stars 171 forks source link

Agrimonitor satellite images #379

Closed BartvanMarrewijk closed 2 years ago

BartvanMarrewijk commented 3 years ago

Hello,

I am trying to get the satellite images of a specific region, but somehow the download satellite image function raises an error:

    `acq_from=1500336000
    acq_to = 1508976000
    img_type = ImageTypeEnum.GEOTIFF 
    preset = PresetEnum.NDVI
    sat = SatelliteEnum.LANDSAT_8.symbol
    results = mgr.search_satellite_imagery(pol_id, acq_from, acq_to, img_type=img_type, preset=preset,min_resolution=None,max_resolution=None, acquired_by=sat)
    satellite_images = [mgr.download_satellite_image(result) for result in results]
    `
Exception has occurred: NotFoundError
Unable to find the resource

However results is a list of 2. What am I doing wrong?

csparpa commented 3 years ago

@studentWUR Hi, sorry for the late reply!

In order to debug this I need the precise definition of the geopolygon you run this image query upon - could you please provide it ?

Thanks

sabahatijaz commented 3 years ago

I am facing the same issue

sabahatijaz commented 3 years ago

coordinates":[[[-121.1958,37.6683],[-121.1779,37.6687],[-121.1773,37.6792],[-121.1958,37.6683]]]

csparpa commented 3 years ago

@studentWUR @sabahatijaz I've submitted a possible fix with commit https://github.com/csparpa/pyowm/commit/099ef432c7f2019cc39f66d54854ceaed8e4f55f

This needs extensive testing: I've done a bit, but please support me. You should ideally try to download TIFs, PNGs and tiles to check if everything is OK

WIll you please let me know? Thanks a lot!

PS: the issue here is that the OWM API changed the URLs they provide for the PNG and TIF images - they now return full URLs to the image resources (while they used to just return relative URL paths with respect to a fixed root URI)

ratdriftbot commented 2 years ago

https://github.com/csparpa/pyowm/issues/385#issue-1038968879

ratdriftbot commented 2 years ago

help me pls with code((