-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GTC-3101 Add documentation for a bunch of operations and creation options #617
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,24 +122,69 @@ class RasterTileSetAssetCreationOptions(StrictBaseModel): | |
"when input files are in different projections from each other." | ||
) | ||
) | ||
pixel_meaning: str | ||
pixel_meaning: str = Field( | ||
..., description="Description of what the pixel value in the " | ||
"raster represents. This is used to clarify the meaning of the raster " | ||
"and distinguish multiple raster tile sets based on the same dataset " | ||
"version. The pixel_meaning string should be fairly short, use all " | ||
"lower-case letters, and use underscores instead of spaces." | ||
) | ||
data_type: DataType | ||
nbits: Optional[int] | ||
calc: Optional[str] | ||
nbits: Optional[int] = Field( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to link to the documentation from GDAL in these? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
None, | ||
description="Advanced option that lets GDAL compress the data even " | ||
"more based on the number of bits you need." | ||
) | ||
calc: Optional[str] = Field( | ||
None, | ||
description="There are two modes for this field, one for rasterizing vector " | ||
"sources and one for transforming and/or combining one or more " | ||
"sources that are already raster. For rasterizing vector sources, " | ||
"this field should be an SQL expression that yields the desired " | ||
"raster value based on the fields of your vector dataset.\n\nFor raster " | ||
"sources, this should be a raster algebra expression, similar to that " | ||
"provided to gdal_calc (see " | ||
"https://gdal.org/en/stable/programs/gdal_calc.html), " | ||
"that transforms one or more input bands into one or more output " | ||
"bands. For use in this expression, each band in " | ||
"the sources is assigned an alphabetic variable (A-Z, then AA-AZ, " | ||
"etc.) in the order it exists in those sources, with those of the " | ||
"first source first, continuing with those of the second, and so on. " | ||
"So with two input sources of two bands each, they would be assigned " | ||
"to variables A and B (for the first source) and C and D (for the " | ||
"second source). The NumPy module is in scope, accessible as np" | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think about this reorganization of the text? I tried to make the two different modes more explicit and clarify the part about band variable assignment: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done, took your suggested reorganization, with just slight modifications. Thanks! |
||
band_count: int = 1 | ||
union_bands: bool = False | ||
no_data: Optional[Union[List[NoDataType], NoDataType]] | ||
rasterize_method: Optional[RasterizeMethod] | ||
rasterize_method: Optional[RasterizeMethod] = Field( | ||
RasterizeMethod.value, | ||
description="For raster sources or default assets, 'value' (the " | ||
"default) means use the value from the last or only band processed, " | ||
"and 'count' means count the number of bands with data values." | ||
) | ||
resampling: ResamplingMethod = PIXETL_DEFAULT_RESAMPLING | ||
order: Optional[Order] | ||
order: Optional[Order] = Field( | ||
None, | ||
description="For vector default assets, order the features by the " | ||
"calculated raster value. For 'asc', the features are ordered by " | ||
"ascending calculated value so that the largest calculated value is " | ||
"used in the raster when there are overlapping features. For 'desc', " | ||
"the ordering is descending, so that the smallest calculated value " | ||
"is used when there are overlaps." | ||
) | ||
overwrite: bool = False | ||
subset: Optional[str] | ||
grid: Grid | ||
symbology: Optional[Symbology] = None | ||
compute_stats: bool = True | ||
compute_histogram: bool = False | ||
process_locally: bool = True | ||
auxiliary_assets: Optional[List[UUID]] = None | ||
auxiliary_assets: Optional[List[UUID]] = Field( | ||
None, | ||
description="Asset IDs of additional rasters you might want to include " | ||
"in your calc expression." | ||
) | ||
photometric: Optional[PhotometricType] = None | ||
num_processes: Optional[StrictInt] = None | ||
timeout_sec: Optional[StrictInt] = Field( | ||
|
@@ -209,7 +254,15 @@ class VectorSourceCreationOptions(StrictBaseModel): | |
Index(index_type=IndexType.gist.value, column_names=["geom_wm"]), | ||
Index(index_type=IndexType.hash.value, column_names=["gfw_geostore_id"]), | ||
], | ||
description="List of indices to add to table", | ||
description="List of indices to add to the database table representing " | ||
"the vector dataset. Each element of the indices field contains an " | ||
"index_type field (which is a string) and a column_names field (which " | ||
"is a list of field names included in this index). The possibilities " | ||
"for the index_type field are hash, btree, or gist. hash is efficient " | ||
"for standard exact-value lookups, while btree is efficient for range " | ||
"lookups. gist is used for geometry fields and can do " | ||
"intersection-type lookups. See " | ||
"https://www.postgresql.org/docs/current/indexes-types.html" | ||
) | ||
cluster: Optional[Index] = Field(None, description="Index to use for clustering.") | ||
table_schema: Optional[List[FieldType]] = Field( | ||
|
@@ -331,7 +384,7 @@ class RasterTileCacheCreationOptions(TileCacheBaseModel): | |
"default", | ||
description="Name space to use for raster tile cache. " | ||
"This will be part of the URI and will " | ||
"allow to create multiple raster tile caches per version,", | ||
"allow creation of multiple raster tile caches per version,", | ||
) | ||
symbology: Symbology = Field(..., description="Symbology to use for output tiles") | ||
source_asset_id: str = Field( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you specify it has to lowercase, spaces instead of underscores, not too long, etc.? Right now you'll just get some regex error response, might be useful to state it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!