-
Notifications
You must be signed in to change notification settings - Fork 363
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
Fixed the issue that vrt.xml is empty when written out #3544
Conversation
Fixed the issue that the generated vrt.xml is empty when writing out COG
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.
LGTM! Thanks for the fix! There is a minor comment to address tho around formatting, rather than that LGTM.
@@ -172,6 +172,7 @@ object VRT { | |||
doctype = null | |||
) | |||
|
|||
writer.flush() |
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.
Thanks! I wonder how did it work before (:
case class VRT( | ||
gridBounds: GridBounds[Int], | ||
layout: LayoutDefinition, | ||
extent: Extent, | ||
cellType: CellType, | ||
crs: CRS, | ||
bands: List[Elem] | ||
) { | ||
gridBounds: GridBounds[Int], | ||
layout: LayoutDefinition, | ||
extent: Extent, | ||
cellType: CellType, | ||
crs: CRS, | ||
bands: List[Elem] | ||
) { | ||
lazy val (layoutCols, layoutRows) = gridBounds.width * layout.tileCols -> gridBounds.height * layout.tileRows | ||
|
||
lazy val re: RasterExtent = RasterExtent(extent, layoutCols, layoutRows) | ||
|
||
/** | ||
* Calculates GeoTransform attributes | ||
* | ||
* TODO: refactor, code style kept to follow GDAL: https://github.com/OSGeo/gdal/blob/9a21e8dcaf36a7e046ee87cd57c8c03812dd20ed/gdal/frmts/sde/sdedataset.cpp | ||
*/ | ||
* Calculates GeoTransform attributes | ||
* | ||
* TODO: refactor, code style kept to follow GDAL: https://github.com/OSGeo/gdal/blob/9a21e8dcaf36a7e046ee87cd57c8c03812dd20ed/gdal/frmts/sde/sdedataset.cpp | ||
*/ |
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.
Could u revert these changes and preserve the original fmt?
Add
writer.flush()
when writing xml to vrt, fix the problem of writing empty vrt.xml when writing out COG.