OBIS quickstart — marine occurrences over a bounding box¶
Fetch ocean-sunfish occurrences over a North-Atlantic bounding box through the EarthLens facade, then map the points.
OBIS is the marine twin of GBIF: the same vector output and the same return contract — a points FeatureCollection in EPSG:4326. Search is anonymous.
Install. OBIS search needs the
pyobisSDK:pip install earthlens[obis].
Setup¶
In [ ]:
Copied!
import matplotlib.pyplot as plt
from earthlens import EarthLens
import matplotlib.pyplot as plt
from earthlens import EarthLens
Request parameters¶
A North-Atlantic box and a decade window. variables=["ocean-sunfish"] resolves to "Mola mola"; you can also pass "species:<scientific name>" directly.
In [ ]:
Copied!
bbox_lat = [40.0, 55.0]
bbox_lon = [-20.0, 0.0]
start, end = "2010-01-01", "2020-12-31"
bbox_lat = [40.0, 55.0]
bbox_lon = [-20.0, 0.0]
start, end = "2010-01-01", "2020-12-31"
Download¶
In [ ]:
Copied!
fc = EarthLens(
data_source="obis",
variables=["ocean-sunfish"],
start=start,
end=end,
lat_lim=bbox_lat,
lon_lim=bbox_lon,
path="out/obis",
size=2000,
).download()
print(f"{len(fc)} occurrences")
fc[["scientificName", "eventDate", "depth"]].head()
fc = EarthLens(
data_source="obis",
variables=["ocean-sunfish"],
start=start,
end=end,
lat_lim=bbox_lat,
lon_lim=bbox_lon,
path="out/obis",
size=2000,
).download()
print(f"{len(fc)} occurrences")
fc[["scientificName", "eventDate", "depth"]].head()
Map the occurrences¶
In [ ]:
Copied!
ax = fc.plot(markersize=6, color="navy")
ax.set_title("OBIS Mola mola occurrences — NE Atlantic")
ax.set_xlabel("longitude")
ax.set_ylabel("latitude")
plt.show()
ax = fc.plot(markersize=6, color="navy")
ax.set_title("OBIS Mola mola occurrences — NE Atlantic")
ax.set_xlabel("longitude")
ax.set_ylabel("latitude")
plt.show()
Licensing¶
OBIS data is mostly CC-BY-4.0, with some CC0 and CC-BY-NC datasets. The backend raises a LicenseWarning if any record is non-commercial.