Comments (3)
I suspect the issue might be due to pixel bleeding a little outside the initial input data bounds.
Potential solution:
- Equal padding the input on all side in tile generating step, so that the
width or height = (tile_size * stride_x or stride_y)
- After merging remove the extra padding.
from geotile.
k=-1
for j in range(y_gen):
for i in range(x_gen):
k=k+1
z[i*stride_x:(i+1)*stride_x, j*stride_y:(j+1)*stride_y]=tile_dta[k]
// WRITE CODE TO UPDATE **height**, and **width** in **self.meta:**
// **width=new_width, height=new_height**, before using in block below:
with rasterio.open('output.tif', "w", **self.meta) as outds:
outds.write(z.astype('uint8'))
pyplot.imshow(z)
As suspected the issue is due to width and height not updated in the **self.meta before writing. I was able to regenerate the image with above modification. Also the performance was greatly improved by first reconstructing the numpy array from tile (since both doesn't have coordinate, it makes sense as well), then writing it on the file, instead of for
loop in reading and writing operation, which is more resource intensive.
Disc: notice slight padding at the bottom and right after the operation.
from geotile.
For now, I am simply saving all the generated tiles into a new folder and mosaicing it by using gt.mosaic()
function. Yes, you are right, we have some issues in merge_tile
method and I feel like we need to rewrite the function. So, were you able to solve the issue? if yes, please send a PR.
from geotile.
Related Issues (20)
- Mask function generating RGB image instead of single band image. HOT 1
- Need to implement data augmentation technique HOT 1
- Data normalization HOT 1
- Need to write function to create the numpy array
- Need function to construct the single prediction raster from tiles HOT 1
- Need function to get the info about tiles
- Auto API document is not working! HOT 1
- naming the tiles based on custom format
- Rasterization issue: ValueError: Given nodata value, nan, is beyond the valid range of its data type, uint8.
- MemoryError: Unable to allocate ... GiB for an array with shape (num_features, 256, 256, 4) and data type `float64` HOT 1
- Fiona is not defined error in vectorize
- Need to optimize the generate_tiles function.
- gt.save_tile have issue
- mosaic raster issue: Bounds and transform are inconsistent HOT 4
- Filter the vectorize values based on the filter conditon
- `gt.save_tiles` issue: TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
- Data normalization based on z-score HOT 1
- Given nodata value, -32768.0, is beyond the valid range of its data type, uint8.
- Need function to Convert no data value to zero values
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geotile.