Terrain grading key ------------------------------- Functionality: total 70 ------------------------------- 1. Grid constructor: total 10 the constructor should take open the file, read it, and initialize correctly the grid with nrows, ncols, NODATA value and data values. 5 points. the file name should be argument to the constructor, not hardcoded. 3 points the lab also asked for a toString method that prints all info about a grid, including the data values. You will use this function to test their flow. 2 points. If they included it, but under a different name (maybe print()), -1 2. Grid render: total 20 There should be a separate function to render (if not, take out points for lack of style, see below). a. the window size should be set so that it has the same aspect ratio as the grid. the image should not look distorted when rendered. 2 points aa. test kaweah.asc, and check whether the window is larger than the screen. it should not be, that is, the window shoudl be set so that it is at most withing screen coordinates (~ 1000 by 1000) 2 points. b. the grid should scale down to the image size, in case that the grid is larger than the image. test this with set1.asc, brunsdem.asc, kaweah.asc. 3 points. c. the grid should scale up to the image size, in case the grid is smaller than the image. test this by loading and rendering test1.asc and/or test2.asc. you should see the points clearly spread out overt the window. 3 points. d. the rendering should not be inverted. that is (i,j) should be rendered as (x=j, y=i) and not the other way around. 2 points. e. color map. 8 points. give full points for a bucketed color map, and subtract 3-4 points for a grayscale map. give extra credit for a smooth bucketed color map. the hard part is giving credit to people whose code does not fully work, and gives an error. check the code and see how much they accomplished. 3. compute flow: total 20 check that flow is initialized to NODATA for points whose elevation is NODATA. 2 points. check that computeFlow returns a Grid object, as required by the lab. 2 points. check that the flow on test2.asc is the one given on the lab website. 10 points. check that the flow finishes on set1.asc and brunsdem.asc. check that it looks reasonable (using the render below). 4 points. check whether it finishes in a few seconds on kaweah. if it does not, they have an efficiency problem. 2 points. 4. render flow: total 10 check that the flow rendered looks reasonable, i.e. you should see a very fragmented river network. 10 points. 5. GridGIS: total 10 At the very least, there should be a text interface as specified in the lab, where you can do something like: Grid elev = new Grid("set1.asc"); elev.render(); Grid flow = elev.computeFlow(); flow.render(); //or, flow.renderFlow() if you have a specialized method that renders flow Give extra points of people have done a GUI (like selecting the name of a file, and so on). ---------------------------------- Style: total 30 ---------------------------------- rendering the grid should be a separate function, as stated in the lab. if they wrote the rendering code as part of the constructor, not good. it may be called from the constructor, but it should still be a separate function. 2-3-4 points. i would like to see that the render code is clean. that is, there shoudl be a loop like this: for i for j x = map j to window coordinates y = map i to window coordinates Color = computeColor(grid[i][j]); setColor(Color). drawLine(x, y, x,y); in otehr words, the computation of teh color shoudl be separate, and outside the render function, encapsulated in a separate function. 2-3 points. there should be a separate method flowsInto(i,j,k,l) as required by the lab that tests whether a cell (i,j) flows into another cell (k,l). 2-3-4 points. there should be a function computeFlow() that computes flow for every cell in the grid. and a separate function computeFolw(i,j), that compute flow for specific cell (i,j). 2-3 points. GridGIS should provide easy support to testing. 2-3-4 points. comments for what each function does, headers, etc, n general easy readability of the code.