Answered step by step
Verified Expert Solution
Question
1 Approved Answer
c++ assignment, any and all help is greatly appreciated! Project Overview: Geographic Information Systems (GIS) are a useful application of technology to the field of
c++ assignment, any and all help is greatly appreciated!
Project Overview: Geographic Information Systems (GIS) are a useful application of technology to the field of Geography. GIS tools are used in systems such as GCCS, often used by the military for mission planning and high-level navigation. They are also used by municipalities for managing resources such as monitoring watersheds for testing purposes. County tax assessors likewise use such tools for assessing taxes on property owners. All of these applications involve efficient and accurate querying of points (for example a mouse click) to determine whether a query is inside a particular polygon. The purpose of such queries is often to report which polygon contains the query point. For this project, we'll only slightly worry about the efficiency of such a search. Checking whether a point is inside a polygon depends on how the polygon is stored. For this project, we'll work with convex polygons only, this enables us to simplify the inclusion check a bit. In our case, polygons will be stored as a list of Points given in clockwise order. Thus, checking if a point is inside a polygon involves checking whether the point lies to the right of the directed line from p; to Pit1 for all i vertices. Sometimes, the "right" of the directed line is above the line and other times, it is below. Determining which is the appropriate check is difficult if comparing x and y values with the line equation. There is a better way, math to the rescue! Determining which side of a directed line from a to b a Point p lies on can be found by calculating the determinant of the following matrix: | 1 | 1 | 1 ay by ay | by | Py PX Project Requirements: Your application must function as described below: 1 1. Your program shall adhere to the test suites distributed with this repository. This means that all tests must pass in their current configuration. 2. Since one goal of this project is to learn how to build and run complex projects, no out-of-the-box Makefile is given. i. You must edit the Makefile given to properly compile and run your code. ii. The following rules must be created and should run the appropriate test suite file from the test directory: test-1-point test-2-polygon test-3-matrix test-4-polygon-advanced test-5-gis 3. Additionally, you must create a user-facing application that allows a user to specify an input file which conforms to the Sample data format given below. This application must be compiled by running make main and shall create an executable file called main. o Data will be given as alternating x and y values. Each line of the input file will contain a single polygon. o All coordinate values are integer values. The sample data below is a 2x2 square with the bottom left vertex at (0,0) and a rectangle that is two units high and six units wide with a bottom left vertex at (0,2). Not all inputs will be axis-aligned rectangles, they are just good exemplars due to their simplicity. 4. The program must then allow queries to be submitted in the form of x and y coordinates and should report the title of the polygon which contains the query point. o The user should be prompted for the x coordinate, then prompted for the y coordinate as seen in Sample run of application below. Sample polygonal data This sample data is found in simple-polygons.txt. A more complicated input file is in polygons.txt, for when you are ready to test your program against something more complicated. squareParcel @ @ @ 2 2 2 2 wideRectangleParcel 0 2 0 4 6 4 6 2 Sample run of application Please enter the file with the polygon data: bad-file-name.zz Invalid file name! Please enter the file with the polygon data: simple-polygons.txt Coordinates of query point (non-integer quits) X: 1 y: 1 Query point is inside: squareParcel Coordinates of query point (non-integer quits) X: 3 y: 3 Query point is inside: wideRectangleParcel Coordinates of query point (non-integer quits) X: 7 y: 7 Query point is inside: Query point not present in any known parcel Coordinates of query point (non-integer quits) X: quit Have a great day! Project Overview: Geographic Information Systems (GIS) are a useful application of technology to the field of Geography. GIS tools are used in systems such as GCCS, often used by the military for mission planning and high-level navigation. They are also used by municipalities for managing resources such as monitoring watersheds for testing purposes. County tax assessors likewise use such tools for assessing taxes on property owners. All of these applications involve efficient and accurate querying of points (for example a mouse click) to determine whether a query is inside a particular polygon. The purpose of such queries is often to report which polygon contains the query point. For this project, we'll only slightly worry about the efficiency of such a search. Checking whether a point is inside a polygon depends on how the polygon is stored. For this project, we'll work with convex polygons only, this enables us to simplify the inclusion check a bit. In our case, polygons will be stored as a list of Points given in clockwise order. Thus, checking if a point is inside a polygon involves checking whether the point lies to the right of the directed line from p; to Pit1 for all i vertices. Sometimes, the "right" of the directed line is above the line and other times, it is below. Determining which is the appropriate check is difficult if comparing x and y values with the line equation. There is a better way, math to the rescue! Determining which side of a directed line from a to b a Point p lies on can be found by calculating the determinant of the following matrix: | 1 | 1 | 1 ay by ay | by | Py PX Project Requirements: Your application must function as described below: 1 1. Your program shall adhere to the test suites distributed with this repository. This means that all tests must pass in their current configuration. 2. Since one goal of this project is to learn how to build and run complex projects, no out-of-the-box Makefile is given. i. You must edit the Makefile given to properly compile and run your code. ii. The following rules must be created and should run the appropriate test suite file from the test directory: test-1-point test-2-polygon test-3-matrix test-4-polygon-advanced test-5-gis 3. Additionally, you must create a user-facing application that allows a user to specify an input file which conforms to the Sample data format given below. This application must be compiled by running make main and shall create an executable file called main. o Data will be given as alternating x and y values. Each line of the input file will contain a single polygon. o All coordinate values are integer values. The sample data below is a 2x2 square with the bottom left vertex at (0,0) and a rectangle that is two units high and six units wide with a bottom left vertex at (0,2). Not all inputs will be axis-aligned rectangles, they are just good exemplars due to their simplicity. 4. The program must then allow queries to be submitted in the form of x and y coordinates and should report the title of the polygon which contains the query point. o The user should be prompted for the x coordinate, then prompted for the y coordinate as seen in Sample run of application below. Sample polygonal data This sample data is found in simple-polygons.txt. A more complicated input file is in polygons.txt, for when you are ready to test your program against something more complicated. squareParcel @ @ @ 2 2 2 2 wideRectangleParcel 0 2 0 4 6 4 6 2 Sample run of application Please enter the file with the polygon data: bad-file-name.zz Invalid file name! Please enter the file with the polygon data: simple-polygons.txt Coordinates of query point (non-integer quits) X: 1 y: 1 Query point is inside: squareParcel Coordinates of query point (non-integer quits) X: 3 y: 3 Query point is inside: wideRectangleParcel Coordinates of query point (non-integer quits) X: 7 y: 7 Query point is inside: Query point not present in any known parcel Coordinates of query point (non-integer quits) X: quit Have a great dayStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started