gportal.search
¶
search(dataset_ids=[], bbox=None, start_time=None, end_time=None, count=100, params={}, timeout=120)
¶
Searches products on G-Portal with the given parameters.
Note that the return value is a Search instance.
See its documentation for details on how to get the number of matches and iterate over results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_ids |
Iterable[Union[str, int]]
|
List of dataset IDs. |
[]
|
bbox |
Optional[Sequence[float]]
|
Bounding box of coordinates. |
None
|
start_time |
Union[str, datetime, None]
|
Observation start time. |
None
|
end_time |
Union[str, datetime, None]
|
Observation end time. |
None
|
count |
int
|
Number of products per page. |
100
|
params |
dict[str, Any]
|
Additional search parameters. See G-Portal User's Manual. |
{}
|
timeout |
Optional[float]
|
Timeout in seconds. |
120
|
Returns:
| Type | Description |
|---|---|
Search
|
A Search instance that represents deferred query. |
Source code in gportal/search.py
Search
¶
Search query for G-Portal Catalogue Service API.
For API details, see G-Portal User's Manual Appendix 7: https://gportal.jaxa.jp/gpr/assets/mng_upload/COMMON/upload/GPortalUserManual_en.pdf
Attributes:
| Name | Type | Description |
|---|---|---|
params |
Mapping[str, Any]
|
Search parameters. |
timeout |
Optional[float]
|
Timeout in seconds. |
Source code in gportal/search.py
matched()
cached
¶
Gets the number of products matched the query.
This method is cached, so it is safe to call it multiple times.
Returns:
| Type | Description |
|---|---|
Optional[int]
|
The number of products matched the query. |
Source code in gportal/search.py
products(convert_types=True)
¶
Yields products matched the query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
convert_types |
bool
|
Whether to convert string values in properties into int, float, bool, or None. |
True
|
Yields:
| Type | Description |
|---|---|
Iterator[Product]
|
A Product instance. |
Source code in gportal/search.py
pages()
¶
Iterates a search request with pagination.
Yields:
| Type | Description |
|---|---|
Iterator[dict[str, Any]]
|
A dictionary of GeoJSON FeatureCollection. |