Skip to content

Using a custom region for the 4wings API #60

Description

@mattcarr03

Hi there,

Thank you for all the work done in making this package and documents freely available!

I am struggling to use the 4wings API with a custom region/geojson polygon. I have no problem using the public eez datasets (see example below):

ais_report_result = await gfw_client.fourwings.create_report(
spatial_resolution="LOW",
temporal_resolution="YEARLY",
group_by="VESSEL_ID",
datasets=["public-global-presence:latest"],
start_date=yr_start,
end_date=yr_end,
region={
"dataset": "public-eez-areas",
"id": "8396", # South Africa EEZ
}

)

However if I want to add a custom region the script fails, for example:

test_region = gpd.GeoDataFrame(
geometry=[box(16, -36, 19, -33)],
crs="EPSG:4326"
)

test_region = {
"geojson": test_region.geometry[0].geo_interface
}

ais_report_result = await gfw_client.fourwings.create_report(
spatial_resolution="LOW",
temporal_resolution="YEARLY",
group_by="VESSEL_ID",
datasets=["public-global-presence:latest"],
start_date=yr_start,
end_date=yr_end,
region=test_region
)

I have tried many different variations to create the geojson "test region" but have not yet managed to find the correct format. Could you please advise if it is possible to have a custom region using the python client package? If so, what is the correct format for using a custom geojson file?

Kind regards,
Matthew Carr

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is needed

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions