QGIS 3.10.3 generating lines between point overlapping a line network - vector

I am using QGIS 3.10.3. A customer sent me some points coordinates (start and end). My job is to compare their data to mine. So I need to create some lines between these points than match my line network. I tried to do it manually (creating a line shapefile and digitizing between the two point following the line network). There are numerous record in the database. It will take me ages to complete the work. Moreover, some points are not touching the line network. Is it a quicker way to generate some lines between those points that will follow my line network?
I try to manually digitize each line between those point. Using the snapping tool to overlap my line network. I also tried the points to lines tool, unfortunately the line were straight and not following my line network.

Related

How to avoid interpolation between sporadic metrics in Application Insights?

I have a job runner app that runs jobs sporadically throughout the day, and I'm reporting metrics for them. They don't run continuously, so AI interpolates between the gaps and the graph looks weird. I would like the graph to either not interpolate or just start/end at zero, so for now I am going to try reporting non-pre-aggregated zero values before and after the jobs, so at least this interpolation will be at the bottom of the graph and be easier to read.
Is there a correct way to indicate the end of a segment of values and the start of another, to avoid this?
Here is a good example of what I'm talking about:
This is a single job runner from our staging env. which ran four jobs in this timeframe, and you can see where the dotted lines are between jobs. This is what I'm trying to avoid. This is exacerbated in a real environment with multiple runners or if you need to compare, e.g.:
What I would like to do is somehow avoid the dotted lines and just go to/from zero (have all the dotted lines at the bottom so they don't interfere with other series). Maybe it's not possible.
I tried sending zero values (both direct and pre-aggregated) at the beginning and end of the jobs and using Operations hoping they would "bookend" the jobs, but neither seemed to do anything.
Metrics Troubleshooting Guide explains the dashes on the line chart type. Generally, the line chart is a great option for showing the continuity and trends. It is a poor option for showing sparse data points. It is so because this type of the chart is rendered by drawing the line segments between known values but without visualizing each value. For better illustration, think about how the line would look when there is only one known value on the entire chart. The two options could be: 1 - show a horizontal line (that’s what we do, but in addition, we add the dashed visualization so that you know the other values are missing) or 2 - not show the line and switch visualization to display just a dot (we let you do it manually by picking scattered plot chart option).

How to create irregular raster with gdal using csv points

I am trying to create a irregular shaped .tiff from a csv list of points (xyz data). I am doing this using gdal_grid.
I can seem to generate the .tiff file no problem but I cannot preserve the outline / shape of the original csv points.
Everytime I generate the .tiff file it creates a raster with the size of (xmax-xmin) x (ymax-ymin) and assigns interpolated values to pixels that fall far away from my initial points.
Is it possible to generate a .tiff file of ONLY the points I provide?
For context, I am trying to generate a raster of xyz data for a river, and only want the raster in the river (not the entire bounding box of the river). I am only providing xyz data in the river.
I tried playing with the -nodata flag, and limiting -max_points to the number of points I've provided.
My final code (once everything is imported and declared):
gdal_grid -a invdist:power=2.0:smoothing=1.0:nodata=-999:max_points=2128164 -txe 582387.4 591069.4 -tye 4505028.08 4515344.079999999 -outsize 50 50 -zfield "z" -of GTiff -ot Float64 -l Book2 Book2.vrt Book2.tiff
Welcome to Stack Overflow, Derek!
Maybe there is a creation option inside gdal_grid that would do it, but I think that you will have to achieve desired result with additional calculation:
Run the gdal_grid as you have it.
Create a concave hull from the given points. If this is a one time job, I suggest using QGIS (with grass tools), because there is some tweaking of concave hull parameters required.
Cut the raster with the created shapefile by using gdalwarp.
Let me know if this got you through!

How can you watch gnuplot realtime data plots as a live graph, with automatic updates?

I plot a lot of graphs in gnuplot. These graphs are based onn sensor readings from around the solar power system.
Each graph has needed to be updated by typing something like
load "solar
where solar is a gnuplot program that performs the plot showing the condition of the 24 V (500Ah) battery bank and leaves it on the screen so I can do a regional screen capture for storage.
In this particular case, the numbers come in at 2-minute intervals. Unless the inverter is turned on, in which case they come in at 20 second intervals. So I end up typing that command a lot just to see how clean the signal is.
So the question came up as to whether I need to continue to tell it to load the program every time I want to see updates.
How can I actually make it automatically live?
Turns out it is as simple as can be to have it run live.
This article: Running Gnuplot as a live graph, with automatic updates
explains the process nicely.
Turns out that all you need to do is add two lines of code after the plot command. In my case, I want it to update the graph every 15 seconds, so the last two lines of the program are simply
pause 15
reread
Here is an excerpt from the article:
Gnuplot has some useful commands we can use:
pause
reread
These are fairly self-explanatory, so let’s make a Gnuplot file, liveplot.gnu, that refreshes itself once every second.
set xrange [0:20]
set yrange [0:400]
plot "plot.dat" using 1:2 with lines
pause 1
reread
We set the bounds of our graph, then plot the data from the file. using 1:2 means plot columns 1 and 2 as x and y, respectively. with lines means that the points are joined together rather than plotted separately. We pause for 1 second and then reread, meaning that the command file is re-executed.
It turned out to be so simple that I am going to add those two lines to all my graphs that I monitor on the xterminals of the individual Rpi3s that monitor the sensors.
Collected together on the big screen it gives me a great overview of the entire system, including temperatures and voltages and such.
The best part is that there is no need to specify the X range to be fixed. It is much better to let it recalculate every time it rereads.
Results: A true live graph, monitoring conditions of the sensors from which it is receiving near-real-time data.
(You can see how hot the panels get even on a relatively cool day, and how the MPPT charge controller works to maintain the voltage)
https://www.SDsolarBlog.com/montage

How to add line not connected in a sequence using leaflet

It seems polyline will connect all the start end points in sequence together like an unfilled polygon. Is there a way to add each line separately on an interactive map in R?
This earlier thread proposed a different package, but could I do this with the leaflet package?

Force starting point of lines()

Perhaps because the question is so basic, the keywords that I can think up for this question all directs me to other things. I am trying to draw a graph with spiky curve lines that connect the medians. The real data is very big, but the starting values are duplicates of (0,0):
DATA<-data.frame(time<-c(sort(rep(c(0,2,4,8,12),4))),
conc<-c(rep(0,4),rnorm(n=4,mean=30),
rnorm(n=4,mean=10),
rnorm(n=4,mean=35),
rnorm(n=4,mean=15)))
# Create blank graph
plot(NULL,NULL,xlab="Time",ylab="Conc",
xlim=c(0,15),ylim=c(0,40),main="Example")
# Add line
require(quantreg)
require(plyr)
require(MatrixModels)
DATA<-plyr::arrange(DATA,time)
fit3<-rqss(DATA$conc~qss(DATA$time,constraint="N"),tau=0.5,data = DATA)
lines(unique(DATA$time)[-1],fit3$coef[1] + fit3$coef[-1],lwd=2)
As you can see, the line does not connect to the starting (0,0) values and instead start at the next lowest level.
I was tempted to cheat, but it does not connect to the lines and I would really prefer to work it out with the rest of the code instead of trying to pass off two lines as one:
# Cheating getaway but does not work well, segments are not connected
segments(x0=0,y0=0,x1=2,y1=30,lwd=2)
Some relevant answers that I found were not appropriate for my situation.
Line in R plot should start at a different timepoint for example suggest modifying the data, which would not help to extend my line and plus my actual data is too big that I would be wary to do this kind of manipulation. I would not want to use plot(x,y,type="l") even though it goes through the (0,0) point, because 1) it looks bad on the huge data, and 2) I would have to overlay another similar line using lines(). I wonder whether it has more to do with rqss and less with lines?
I apologize if this has already been asked before.

Resources