Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Background In this assignment you will be implementing a portion of a Geographic Information System (GIS). A GIS is a computer system used to organize,

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Background In this assignment you will be implementing a portion of a Geographic Information System (GIS). A GIS is a computer system used to organize, categorize, and analyze geographical data in order to produce accurate depiction of the real world. The system uses multiple layers of information to achieve this task. The data layers are split into a grid and represented as a matrix with mrows and n columns where each entry in the matrix contains the type of land at that point on the map. An entry Ay is the throw and th column in our map matrix. We assume that Ao is the first element in our matrix. The graphic below will assist in visualizing the process Transportation Agrow Hesia Commercial Www Rew WMA View Undeveloped and Figure 1 As seen in the previous example, our GIS utilizes 6 different data layers. We call these layers the map types as they classily regions of different and on our map. Thus, each entry in our map matrix can be one of the map types . C Markdown As seen in the previous example, our GIS utilizes 6 different data layers. We call these layers the map types as they classify regions of different land on our map. Thus, each entry in our map matrix can be one of the 6 map types. Transportation (T) Agricultural (A) . Residential (R) . Commercial (C) Water (W) Undeveloped land (U) Our GIS will store the map Information as a list of lists. If we have a list named map, then mapp will store the map type at row.column. Each entry wil contain a string that corresponds to 1 of the possible map types listed above. The list representation of the map in Figure 1 is shown below: N.N.A.','U','U' U'). D'A'.'N'.' RRR I'.'.'.' T'.T.T. ..'.' R''R','R'. c.'c','U','U'. 'T','R','U',''), E'T'.'T. T','U', U'). UU, U.U.','R','U','U' One usage of the system is to be able to easily identity whether or not a plece of land (entry in the map matrix) is deemed commercially buildable. A plece of land at Af is deemed commercially buildable if the following conditions hold: . The entry at Al has map type U . The entry All is not on the edges of the map (the first and last rown and columns) The entry Afis not adjacent with an entry of map type R or map type A Note that adjacent entries are entiles to the top, bottom left and right of the Current cell Based on the criteria and the map representation of Figure 1, it can be seen that is commercially buildable and Aux not commercially buildable Please read the requirements below to implement the GIS system! Additional Information When using a 20 list, we can access elements around a specific index. Given the element at location ij we can find the adjacent element within the same row by changing the row index. If we want to access the element to the left of our selected element, we can subtract 1 from the Index To access the element to the right, we can add 1 to the index. To access the element in the previous row (above the element), we can subtract 1 from the Index. To access the element in the next row (below the element), we can add 1 to the Index t]: x = {(1,2,3) (4,5,6), [7.8,931 J=1 print) print (1-11051) #above print (1) right Be careful when accessing adjacent elements. If you try to access an element that doesn't exist, you might receive unexpected output or an error In to print (-20) # 2 abowe - actually wrap around and gives us the element in row (which is the last row) print (] [32]) = 2 risht - tries to access value in column 3 which don't exist) NOTE THAT YOU WILL BE MARKED ON MULTIPLE ITEMS IN THIS LAB IN ADDITION TO THE FUNCTIONALITY OF YOUR CODE Variable Names Commenting . General Legibility Reflective Questions Down General Legibility Reflective Questions Program Requirements (12 Marks) Your GIS system will be comprised of a set of functions used to analyze the information of any given map. In addition, you will be creating a function used to determine whether or not a piece of land is commercially buildable. The requirements of the system are given below. Please ensure that your functions have the EXACT naming as specified! Failure to do so will result in lost marks, 1. Define a function countType(map_data, map_type) map_data: A Nst of iists representing the data for a given map, map_type: A string representing a map type (TAR.CW, or 'U) Return: An Integer representing the number of times map_type occurs in map_data. 2. Define a function classify Map/map_data): map data: A ist of its representing the data for a given map. Return: A map classification according to the following rules: The string Suburban if the number of 'R' cells is greater than 50% of all cells The string Farmland if the number of 'W cells is greater than 50% of all colls The string Conservation if the number of 'U' cells plus the number of 'W cells is greater than 50% of all cells. . The string City i the number of " cells is greater than 50% of all colls and the number of 'U' cells plus the number of 'Acils between 10% and 20% of all cells (inclusive) . The string Mixed if none of the above criteria are met Hint, use your count Type function coupled with the fact that the total colta in mop_cata is given by 'n 3. Define a function isolateType(map_data, map_type) map_data: A list of Mats representing the data for a given map map_type A string representing a map type ('TARCW, or 'U') Return. Anwilt ontharent meg dafn mati butention that are not count II CAR within.containing 3. Define a function isolateType(map_data, map_type): map_data. A list of Nists representing the data for a given map. map_type: A string representing a map type (T. 'A', 'R', 'C', 'W.or 'U') Return: A new Nist of lists that represent map_data as a matrix but all entries that are not equal to map_type are replaced with a string containing only a space (*) 4. Define a function commercialty Buildable(map_data, 8: map_data A list of lists representing the data for a given map An integer representing a given row in map_data An integer representing a given column in map_data. Return: True if map_data(10] is commercially buildable, otherwise False (Refer to the background section to determine what is deemed commercial buildable) Implementation Please define all functions in the cell below 1: 2 NOUN CODA MEX Sample Output Unlike the other computing labs that required you to run main) to validate your code, these functions can act as stand-alone functions. You have been provided with some test cases, but you are encouraged to create more to thoroughly test your code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions