Bound and resolution of a raster in Julia - julia

I am looking if Julia could be a good alternative to Python for my work. I use raster data so I plan to use ArchGDAL. However after searching on the web, I do not find how to find bound and compute resolution of a raster. Do I miss something ?
Thank you.

For completeness, you can find the ArchGDAL docs here: https://yeesian.com/ArchGDAL.jl/stable/ and the specific function that will allow you to find the bound and complete the resolution of a raster: https://yeesian.com/ArchGDAL.jl/stable/search/?q=geotransform

Related

raster::gridDistance() fails on medium to large raster files

I have some moderate sized raster files (max size ~190 MB) that I would like to calculate grid distances for using raster::gridDistance()
I'm finding that the operation is slow and/or R crashes for the largest of my files. Please note: I'm not seeking memory management advice (e.g. maxing out memory.limit(), breaking into smaller rasters or pursuing parallel processing methods) as these are sidestepping my issue. If grid distances should not be attempted for 190+ MB size files, then I will just break the job into more manageable pieces.
The raster::gridDistance() documentation mentions that I can try to solve "errors in the case of complex objects spread over different chunks... by varying the chunk size, see function setOptions()" and that "Additional distance measures and options (directions, cost-distance) are available in the {gdistance} package", but I have been hesitant to pursue these without better understanding the limitations/considerations.
Thanks to this question R - terra::distance() equivalent of raster::gridDistance(..., origin = x, omit = y) I understand that there is an alternative method using terra::gridDistance(), but I am not able to discern if the operation is any more efficient or suitable for my needs than raster::gridDistance()
I haven't posted a reprex or session info as my question is really as follows:
Is terra::gridDistance() (or some other alternative like those offered by {gdistance}) really a more efficient (faster) or customizable way for calculating a grid distance using moderate-large raster files?
If not, what are considerations for changing how the grid distance is calculated (varying chunk size or other means) using raster::gridDistance() and setOptions()?
If there is interest, I can reformat my question so that it better fits guidelines with a reprex etc. Also, I am posting the question here rather than Geographic Information Systems because the original linked question was posted here.
I understand that there is an alternative method using terra::gridDistance(), but I am not able to discern if the operation is any more efficient or suitable for my needs
Well, did you try it? That could have been more efficient than writing a long question.
The help file does not mention the limitations that raster::gridDistance has, so you should be good to go. But note that the method was renamed to terra::gridDist()
The "terra" package is the replacement for "raster" package; so "terra" is the best starting point more generally, I think.

How to compute distances along a network in shapefile? in R

I have a river network in a shapefile (class: "SpatialLinesDataFrame"), with some points on it (see picture below).
I would like to compute the distances between points, but along the rivers. I have been searching a lot and I am not able to find any function that allows directly that.
The closest thing I have found is the function "networkdistance" in the package "secrlinear", however I don't manage to transform my shapefile into the format required to use the function (a "linearmask" object).
Any help with this would be extremely appreciated.
Thanks in advance,
Tina.
I know this is an old thread, but just in case someone runs across this in the future: I just released an R package (riverdist) that deals with this issue, and also provides some tools for network editing and data summaries & visualization. It was written with fisheries work in mind, but could probably be applied to what you're working on, or at least that's the hope!
https://cran.r-project.org/web/packages/riverdist/vignettes/riverdist_vignette.html
Sorry this wasn't more timely -
I think we resolved this problem offline: the geographic coordinates (lat/long) of the shapefile needed to be projected before they could be used in secrlinear. That package approximates the linear network and uses igraph functions for distances.

How can I find a implementation of a data-structure corresponding to a mathematical Set in R?

I am new to R and I would like to know where I can find a standard implementation of a data-structure corresponding to a mathematical Set in R. Something similar to pythons built-in Type set for example.
I think you need to learn how to search CRAN, the R archive. I found this:
http://ftp.heanet.ie/mirrors/cran.r-project.org/web/packages/sets/index.html
Note the URL there is my local mirror. Start at www.r-project.org and carry on.

Binning NMR data in R

I've imported NMR spectra on R as .csv file ( first column represent the ppm values the others, signal intensity for various spectra) and I would like to bin the data, let's say, make every 5 points one. Any suggestions?
Cheers,
Marcelo
Marcelo, you can look at ChemoSpec on GitHub here: https://github.com/bryanhanson/ChemoSpec
The function binBuck will do what you ask. There is a fairly complete vignette available once you have the package installed.
To use ChemoSpec, you may have to import your data set differently than you apparently currently have it, or if you have the skills you can modify what you have now. Again, the vignette explains how ChemoSpec stores the data.
Let me know if you need further assistance. Bryan
I know it's an old question, but it can be useful for other users.
You can use "prospectr" package in R through function "binning". You can set "bin" as your final spectral size or "bin.size" for as ratio.

Counting objects in image

I want to count no of objects in an image using open cv. I have a soybean image and now I want to count the soybean numbers. If possible please help me and let me know the counting algorithms.
Thanks and I look forward to hear from you.
Regards,
Sumon
Sumon,
There is no one algorithm for counting objects. It greatly depends on the image itself. Depending on the contrast of the beans to the background it may be possible to use a simple threshold then a labeling algorithm, or even just finding contours.
The threshold function in opencv is cvThreshold. The contour finding algorithm is cvFindContours using this you could count the number of contours found.
Also the blob library has many facilities for this type of machine vision applications including connected component labeling which is basically what you need here. The library's description I believe is already included in opencv. The description of it can be found here.
I could provide some more assistance if I knew a little more about the image.

Resources