Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Requests #19

Open
3 tasks done
RobinCGN opened this issue May 15, 2020 · 6 comments
Open
3 tasks done

Feature Requests #19

RobinCGN opened this issue May 15, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@RobinCGN
Copy link
Member

RobinCGN commented May 15, 2020

@VicluUiB requested a couple of features:

  • Export of plots as images

  • Smoothing of Isolines similar to QGIS/MapInfo results ("Your Isolines look like LEGO!")

  • Export of semi-variogram statistics (range, sill, etc.)

@RobinCGN RobinCGN added the enhancement New feature or request label May 15, 2020
@RobinCGN
Copy link
Member Author

RobinCGN commented May 15, 2020

  1. I have added an experimental image export function (plot to *.svg, raster maps to *.tif) to 03_Visualisation_Export.R.

  2. Smoothing of isolines can be achieved using the smoothr package. Of course the smoothed isolines are just for visualization, not for counting sites or calculating areas!!!

install.packages("smoothr")
require(sp)
require(smoothr)

convert polygons to lines
isoline_merged_lines <- as(isoline_merged, 'SpatialLinesDataFrame')

smooth isolines or polygons (smoothness can be adjusted)
iso_merged_lines_smo <- smooth(isoline_merged_lines, method = "ksmooth", smoothness = 2) iso_merged_poly_smo <- smooth(isoline_merged, method = "ksmooth", smoothness = 2)

export

`rgdal::writeOGR(iso_merged_lines_smo,`
                dsn = "playground",
                layer = "iso_merged_lines_smo",
                driver = "ESRI Shapefile",
                check_exists = TRUE,
                overwrite_layer = TRUE)
rgdal::writeOGR(iso_merged_poly_smo,
                dsn = "playground",
                layer = "iso_merged_poly_smo",
                driver = "ESRI Shapefile",
                check_exists = TRUE,
                overwrite_layer = TRUE)

@Mono2
Copy link
Member

Mono2 commented May 15, 2020

I used smoothr in a previous version of my local script. In the end, however, I decided not to smooth the isolines, although it looks "nicer". The difference in the statistical values is considerable.
My suggestion would be that the calculation of the statistical values is always based on the non-smoothed isolines and that there is the option of having smoothed isolines on the images or in the export of the shape-filese.

@RobinCGN
Copy link
Member Author

You're absolutely right, smoothed isolines shouldn't be used for any kind of calculations. Now that you agree, will add this feature as option in the next days, but I don't know how the package dependencies stuff (deps.yaml) works.

@Mono2
Copy link
Member

Mono2 commented May 16, 2020

No Problem. I will update it when you are finished.

@VicluUiB
Copy link

VicluUiB commented May 18, 2020

Thank you both for keeping me updated with all the fantastic work that you're doing! Sorry that I cannot contribute much more at the moment other than by running it with my own sets of data.

As far as smoothing of the isolines go, I agree. However, it would be a great function to have as it would make more sense to illustrate the outputs in this way when making figures for e.g. publication or other types of dissemination.

@RobinCGN
Copy link
Member Author

I have added the smoothing of isolines to the regular script. I made it optional or rather dependent on "merge polygons". If the "merge-polygons"-option is "TRUE", a .shp with smoothed isolines is produced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants