bathyreq.sources.ncei
Module for composing NCEI Source
.
bathyreq.sources.ncei.NCEIBase
dataclass
Base class for NCEI requests.
Attributes:
-
host
(str
) –Host URL.
-
context
(str
) –Context.
-
endpoint
(str
) –Endpoint.
-
folder
(str
) –Folder.
-
serviceName
(str
) –Service name.
-
serviceType
(str
) –Service type.
-
operation
(str
) –Operation.
-
url
(str
) –URL for the request (set with
self.build_base_url()
).
Examples:
>>> from bathyreq.sources import ncei
>>> inst = ncei.NCEIBase()
>>> inst.build_base_url()
>>> inst.url
build_base_url()
Build the base URL for the request.
For further documentation, see https://gis.ngdc.noaa.gov/arcgis/sdk/rest/.
Returns:
-
None
–The base URL is stored in the
url
attribute.
bathyreq.sources.ncei.NCEIRequest
dataclass
Request class for NCEI requests.
Additional documentation available at https://gis.ngdc.noaa.gov/arcgis/sdk/rest/#/Image_Service/02ss00000021000000/
Attributes:
-
bbox
(list[str]
) –Bounding box in the form [lon_min, lat_min, lon_max, lat_max].
-
size
(list[int]
) –Size of the image in the form [width, height].
-
forma
–Image format.
-
pixelType
(str
) –Pixel type.
-
bboxSR
(Optional[int]
) –Bounding box spatial reference, by default None.
-
imageSR
(Optional[int]
) –Image spatial reference, by default None.
-
nodata
(float
) –No data value, by default 0.0.
-
interpolation
(str
) –Interpolation method, by default "RSP_NearestNeighbor".
-
compression
(str
) –Compression method, by default "LZ77".
-
renderingRule
(Optional[str]
) –Rendering rule, by default None.
-
f
(str
) –Format, by default "image".
-
request
(str
) –Request string (set with
self.build_request()
).
Examples:
>>> from bathyreq.sources import ncei
>>> inst = ncei.NCEIRequest(
... bbox=[-117.43000, 32.55000, -117.43000, 32.55000],
... size=[400, 400],
... )
>>> inst.build_request()
>>> inst.request
build_request()
Build the request string.
Returns:
-
None
–The request string is stored in the
request
attribute.
format_attributes()
Format the attributes for proper parsing of the request string.
Returns:
-
None
–The attributes are formatted in place.
bathyreq.sources.ncei.NCEISource
dataclass
Source class for NCEI requests.
Additional documentation available at https://gis.ngdc.noaa.gov/arcgis/sdk/rest/.
Attributes:
-
base
(NCEIBase
) –Base class for NCEI requests, by default NCEIBase().
-
request
(Optional[NCEIRequest]
) –Request class for NCEI requests, by default None.
-
url
(Optional[NCEIRequest]
) –URL for the request.
Examples:
>>> from bathyreq.sources import ncei
>>> inst = ncei.NCEISource(
... base=ncei.NCEIBase(),
... request=ncei.NCEIRequest(
... bbox=[-117.43000, 32.55000, -117.43000, 32.55000],
... size=[400, 400],
... ),
... )
>>> inst.build_url()
>>> inst.url
build_url()
Build the URL for the request.
Returns:
-
None
–The URL is stored in the
url
attribute.