the file mycode_hw01.py gives you hint about what to use.You can do this by using any functions/packages from the Python libraries scipy and numpy (the only ones allowed besides the Python standard library) speeding things up is however a good idea.the time it takes for your program to terminate has no influence on the marks.You do not need to compute it yourself, you can use the SciPy convex hull function if the centre of a given cell is outside the convex hull of the input dataset, then no_data should be assigned to this cell.the coordinates of the input files will always be in meters.you can ignore all CRS, you just read the points and output a.Observe also that the output raster need not be a square grid, it can be a rectangle (ie the number of columns in the raster does not need to be the same as the number of rows). The lower-left corner of the bbox of an input dataset must always be respected, and you have to start “adding” the cells from that point. In the middle case in the figure, 3x3 cells “covers” all the input points (since x=10 and y=10 are exactly on the boundary).įor the case on the right in the figure, 4x4 cells would not be sufficient, and thus the output raster is larger than the other one (and that for the same input sample points), and has 5x5 cells (of size 2). You need to create a raster that covers at least the bounding box (bbox it must be axis-aligned).Īs shown in the figure above, you need to calculate the bbox, and then you need to start at the lower-left corner and add cells (based on the cellsize parameters given as input) and fill the raster with the appropriate number of cells so that all input sample points are inside (or directly on the boundary) of the output raster. In the given code/files, there is an example of a valid file ( example_output.asc). To ensure that your output is valid, test it with at least QGIS. It’s a simple ASCII/text file that can be easily created with Python, and QGIS reads it natively. Your output file has to be an Esri ASCII raster format (.asc), see its full specifications. In other words, one can’t put an output file at /home/elvis/temp/myoutput.asc if that folder doesn’t exists, or give a negative value for the search circle of IDW. Notice that the file params.json doesn’t need to be validated, and the input/output and parameters are also valid. tif file we took somewhere, and we generated randomly samples from it in samples.xyz
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |