-
Notifications
You must be signed in to change notification settings - Fork 362
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
Update celltype docs #1722
Update celltype docs #1722
Conversation
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.
Extremely clear content, I learned a lot.
Since the text itself isn't too long, this might benefit from being moved right into core-concepts.md
itself, to keep the ToC small.
|
||
The above table lists `CellType` `DataType`s in the leftmost column | ||
and `NoData` policies along the top row. A couple of points are worth | ||
making 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.
Adding a space here will fix the rendering.
/** A custom, 'user defined' NoData CellType for comparison; we will | ||
treat 42 as `NoData` for this one */ | ||
val customCellType = IntUserDefinedNoDataValue(42) | ||
val customTile = IntArrayTile(myData, 2, 2, myNormalCellType) |
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.
myNormalCellType -> customCellType
?
(no matter your underlying type, `get` on a tile will return an `Int` | ||
and `getDouble` will return a `Double` */ | ||
assert(customTile.get(0, 0) == Int.MinValue) | ||
assert(customTile.getDouble(0, 0) == Double.NaN) |
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.
Relevant to reference https://github.com/geotrellis/geotrellis/blob/master/raster/src/main/scala/geotrellis/raster/NoData.scala here?
|
||
In addition to keeping track of the memory used by each cell in a tile, | ||
the cell type is where decisions about which values count as data (and | ||
which, if any, are treated |
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.
WIP?
/** While the value in (0, 0) is NoData, it is now 1 instead of 42 | ||
(which matches our new CellType's expectations) */ | ||
val converted = tileBefore.convert(IntUserDefinedNoData(1)) | ||
assert(converted.getRaw.get(0, 0) !== converted.get(0, 0)) |
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.
!=
?
|
||
/** Here, the first value is still 42. But because the NoData value is | ||
now 1, the first value is no longer treated as NoData */ | ||
(which matches our new CellType's expectations) */ |
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.
Some weirdness with */
here.
ffe14bf
to
9573b25
Compare
|
||
/** Here, the first value is still 42. But because the NoData value is | ||
* now 1, the first value is no longer treated as NoData | ||
*/ |
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.
The */
here is causing weirdness with the next line.
This PR should include all CellType documentation. Still being worked on: the piece concerning code still in flight from #1702. I'm going to go ahead and write that part up, as I don't think the API is likely to change a great deal prior to 1.0
Closes #1580 and #1508