From 3bf8dbfb79dc234d32aebcb8b153090682b7ef69 Mon Sep 17 00:00:00 2001 From: Trygve Date: Tue, 7 May 2024 22:26:11 +0200 Subject: [PATCH] Update report --- documentation/ER_diagram.gaphor | 193 +++++++++++++++++------------- documentation/ER_diagram.svg | 203 ++++++++++++++++++-------------- documentation/report.md | 34 +++--- 3 files changed, 245 insertions(+), 185 deletions(-) diff --git a/documentation/ER_diagram.gaphor b/documentation/ER_diagram.gaphor index 9e18c9d..e9bded3 100644 --- a/documentation/ER_diagram.gaphor +++ b/documentation/ER_diagram.gaphor @@ -1,5 +1,5 @@ - + @@ -13,7 +13,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -47,6 +47,8 @@ + + @@ -69,7 +71,7 @@ 311.0 -151.0 +185.0 @@ -111,80 +113,6 @@ - - -Cell - - - - - - - - - - - - - - - - - - - - -(1.0, 0.0, 0.0, 1.0, 567.9247472572557, 154.04296875) - - -(0.0, 0.0) - - -311.0 - - -117.0 - - - - - -0 - - - - - - - - - - -width - - -int - - - - - - - -height - - -int - - - - - - - -+ cells: int* - - @@ -223,15 +151,116 @@ reference_system - + + +cls + + +New Diagram + + + + +Point + + + + + + + + + + + + + + + + + + + + +(1.0, 0.0, 0.0, 1.0, 584.7889709472656, 160.69140625) + + +(0.0, 0.0) + + +130.0 + + +125.0 + + + + + +0 + + + + + + - + -OGRSpatialReference +x -reference_system +int + + + + + +y + + +int + + + + + + + +mscase + + +int + + + + + + + +allocated + + +bool + + + + + + + +geotransform: double* + + + + + + + +filepath: char* + + \ No newline at end of file diff --git a/documentation/ER_diagram.svg b/documentation/ER_diagram.svg index 33b14ed..433ae29 100644 --- a/documentation/ER_diagram.svg +++ b/documentation/ER_diagram.svg @@ -1,5 +1,5 @@ - + @@ -30,10 +30,13 @@ - + - + + + + @@ -121,9 +124,18 @@ + + + + + + + + + - + @@ -246,97 +258,110 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/documentation/report.md b/documentation/report.md index 3cdc274..1f1b146 100644 --- a/documentation/report.md +++ b/documentation/report.md @@ -1,17 +1,23 @@ +% INF205 Project report +% Esther and Trygve +% 7. May 2024 ## Group: Trygve and Esther # Functionality -Our program usees the marching squares algorithm to create a vector contour map from a raster heightmap. -The cli interface is `gdal_contour [OPTIONS] ` with these options: -``` --i Interval between contours --f Fileformat to output -``` -# data structure and input/output -![](ER_diagram.svg) -# Responsibilities: -Esther will create the algorithm itself with multitreading. This will essentially be a function that takes a grid of pixels as input and returns a similar grid of cells. -Trygve will take care of reading in the tiff file into our own datastructure and creating a vector image from the output of the algorithm. +Our program usees the marching squares algorithm to create a vector contour map from a raster heightmap (DTM). +It outputs a geojson file that can be read by gis software. [https://mapshaper.org/](https://mapshaper.org/) is a simple website where you can view geojson files. -# How do you plan to make it easily verifiable that your objectives are reached? -We can compare against the `gdal_contour` cli program which is a implementation widely used in other software. We can compare speed, memory usage and the result itself. -Each step in our program also produces a output which we can be worked on and evaluated independently. \ No newline at end of file +# data structures and input/output + +![ER diagram](ER_diagram.svg) + +The HeightMap class stores the heightmap as a array on the heap. It was not nececarry to copy or move this class, so we did not implement copy or move constructors/assignment operators. + +The Point class represents a point in a line. The points are stored in vectors, wich are again stored in a big vector containing all the lines. +The `produce_cellmap` function finds the points for a contour at a given elevation. The `create_lines` uses `produce_cellmap` the get the points and then sorts them into contiguous lines before returning a `std::vector>`{.cpp} thats used by the function `write_output_file` to write them to a geojson file. + +# Performance + +# Functionality of special interest +## Trygve +I can created a blur method that performs a simple box blur on the whole heigtmap. This is usefull to smooth out noise and create a more readable output. +I wanted to implement a gaussion blur, and the code is ready for that, but in the end we became short on time. \ No newline at end of file