Skip to content

Commit

Permalink
Quick fix + update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien Jaussaud committed Jun 14, 2024
1 parent 0799a17 commit d026457
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ polygon = "POLYGON((...))"
today = dt.date.today()
year_ago = dt.date.today() + relativedelta(months=-12)

dataframe = client.get_time_series(polygon, year_ago, today, collection=SatelliteImageryCollection.MODIS, indicators=["NDVI"])
dataframe = client.get_time_series(start_date = year_ago, end_date = today, collection=SatelliteImageryCollection.MODIS, indicators=["NDVI"], polygon=polygon)
```

Use Geosyspy logger
Expand Down
4 changes: 2 additions & 2 deletions geosyspy/geosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def get_satellite_coverage_image_references(

return df, images_references

def download_image(self, field_id, polygon, image_id, indicator: str = "", path: str = ""):
def download_image(self, polygon, image_id, indicator: str = "", path: str = ""):
"""Downloads a satellite image locally
Args:
Expand All @@ -288,7 +288,7 @@ def download_image(self, field_id, polygon, image_id, indicator: str = "", path:
"""

response_zipped_tiff = self.__map_product_service.get_zipped_tiff(
field_id, polygon, image_id, indicator
None, polygon, image_id, indicator
)
if path == "":
file_name = image_id.replace("|", "_")
Expand Down
6 changes: 3 additions & 3 deletions geosyspy/services/map_product_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ def get_zipped_tiff(self, field_id: str,
parameters = f"/TOC/image.tiff.zip?resolution=Sensor"
download_tiff_url: str = urljoin(self.base_url, GeosysApiEndpoints.FLM_REFLECTANCE_MAP.value + parameters)

if not field_geometry or field_geometry == '':
if not field_id or field_id == '':
payload = {
"image": {
"id": image_id
},
"seasonField": {
"id": field_id
"geometry": field_geometry
}
}
else:
Expand All @@ -150,7 +150,7 @@ def get_zipped_tiff(self, field_id: str,
"id": image_id
},
"seasonField": {
"geometry": field_geometry
"id": field_id
}
}

Expand Down

0 comments on commit d026457

Please sign in to comment.