Skip to content

Geometry and date filters don't work in pyrasterframes STAC API #590

@ngulyaev

Description

@ngulyaev

Result of the same query using pystac-client:

stac = "https://earth-search.aws.element84.com/v0" 
collection = "sentinel-s2-l2a-cogs"
shape = geopandas.read_file("zip:///shape.zip")
polygon = shapely.geometry.box(*shape.to_crs(epsg=4326).total_bounds)
SentinelSTAC = Client.open("https://earth-search.aws.element84.com/v0")
result = SentinelSTAC.search(
    intersects=polygon,
    collections=["sentinel-s2-l2a-cogs"],
    datetime="2020-04-01/2020-04-10"
).matched()
print(result)
16

Using the pyrasterframes STAC API:

spark = create_rf_spark_session()
scenes = spark.read.stacapi(stac, {
    'collections': [collection],
    'intersects': polygon.__geo_interface__,
    'datetime': '2020-04-01/2020-04-10'
}).limit(100)
print(scenes.count())
100

I set the limit to 100 on purpose because it takes a long time to complete the request. Also I noticed that pystac-client is much faster than pyrasterframes STAC API

Metadata

Metadata

Assignees

Labels

bugWhen it really isn't a "feature".

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions