Skip to content
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

Merged
merged 3 commits into from
Jan 6, 2025

Conversation

danscales
Copy link
Collaborator

GTC-3101 Add documentation for a bunch of operations and creation options

I put in doc lines for the most common options/operations that I use that are missing documentation.

Suggestions/corrections welcome!

If anyone can comment on the exact semantics of band_count and union_bands (and when they apply), I'd be happy to add documentation for those options as well.

Copy link
Member

@jterry64 jterry64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small comments but otherwise looks good, thanks for doing this!

@@ -122,24 +122,60 @@ class RasterTileSetAssetCreationOptions(StrictBaseModel):
"when input files are in different projections from each other."
)
)
pixel_meaning: str
pixel_meaning: str = Field(
Copy link
Member

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

data_type: DataType
nbits: Optional[int]
calc: Optional[str]
nbits: Optional[int] = Field(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to link to the documentation from GDAL in these?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

"any valid NumPy expression.\n\nFor vector default assets, an SQL "
"expression specifying a calculation that yields the desired raster "
"value based on the fields of your vector dataset."
)
Copy link
Member

Choose a reason for hiding this comment

The 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 are two modes for this field, one for rasterizing vector sources and one for transforming 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 (presumably) based on the fields of your vector dataset. For raster sources, this should be a raster algebra expression, similar to that provided to gdal_calc, 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). NumPy is in scope, as np.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, took your suggested reorganization, with just slight modifications. Thanks!

@dmannarino
Copy link
Member

This is wonderful, thanks for doing it, Dan!

Also added documentation for the 'indices' option of
VectorSourceCreationOptions.
@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.07%. Comparing base (c11e2da) to head (214c711).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #617   +/-   ##
========================================
  Coverage    81.07%   81.07%           
========================================
  Files          130      130           
  Lines         5876     5876           
========================================
  Hits          4764     4764           
  Misses        1112     1112           
Flag Coverage Δ
unittests 81.07% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danscales danscales merged commit 8fa3487 into develop Jan 6, 2025
2 checks passed
@danscales danscales deleted the gtc-3101-better-doc branch January 6, 2025 06:32
danscales added a commit that referenced this pull request Jan 6, 2025
Merge develop into master (PR #617 - improve documentation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants