Trimble Business Center

 View Only
Expand all | Collapse all

Best fit line with curves?

  • 1.  Best fit line with curves?

    Posted 10-06-2018 01:02

    Hi!

     

    Look at my screendumps. I have a line, 5400m long measured with gps on a atv every second meter. This line i suppose to be my alignment for a corridor so i have to make it smooth. Is there anyway to easy get curves or radius to the line istead of 2m straight pieces? I dont want to draw a whole new line if i dont have to.



  • 2.  Re: Best fit line with curves?

    Posted 10-06-2018 02:23

    Of course "Best fit line" function is the best tool for this, i just have to figure out how to best use it for my purpose.



  • 3.  Re: Best fit line with curves?

    Posted 10-10-2018 07:52

    A "best fit" line would still need a lot of user control to fit the data you have.  You couldn't have one best fit line/curve as it would attempt to fit all the data points at once.  You would need to define start and stop locations for the "best fit" which could take a lot of time.  Civil 3d has a best fit feature for alignments that will attempt to create curves and tangents between data points, but I haven't had much luck with it doing what I want it to do.  

     

    If it were me I'd just draw a new linestring on top of your data and attempt to best fit it myself by adding curves where needed to keep within any tolerances that you may have.  If you wanted your new alignment to be within a certain distance from your surveyed alignment you could just offset the survey line left and right that certain distance, then you have a way to easily see if your new smooth alignment is within your tolerances.  Again, this takes time, but would work.  

     

    You could also try to filter the line vertices with the project cleanup command.  That could eliminate a ton of vertices that you would be attempting to best fit through.  

     

    I don't think there's an easy solution!  



  • 4.  Re: Best fit line with curves?

    Posted 10-11-2018 09:43

    Thats what i did, i did a offset from my line, 25cm at each side and then fitted the new line inside of that with the "best fit line" tool.:)



  • 5.  Re: Best fit line with curves?

    Posted 10-10-2018 10:04

    The Best Fit Line command is likely the closest that we have to being able to fit a 2D or 3D linestring through a set of points. The Best Fit Line settings allows you to select the points, set the Linetype - likely select the Polynomia Curve 2D (Plan View) and then you will need to set the Polynomial Degree to e.g. 20 to get it to closely fit your points with a complex line. You can increase / decrease the Polynomial degree and see what happens to the line - if you set it too low it approximates a straight line, too high and you will get a crazy line, but in the middle there is an "about right" that will get you a smoothed line that closely fits your data. You can also add or remove points that appear to be pulling the line off where you think it needs to be before you accept the result and create the line.

     

    The line that is created is a chorded line, but it will be less chorded than the raw line between all your points and may be a better basis for an alignment. Once you have the chorded line you can use that to create a Road Model but it will still be chorded (not smooth tangential alignment geometry), 

     

    I dont have a good data set to test this on - I created a rough data set and this is the result that I got

     

     

    Try this out and see what you think - what is the application that you are doing where you are the "designer" of the road based on your AV surveyed centerline (is it a Forest Road regrading or something that you are doing?). While this is not "Major Highways" it may work for some applications.

     

    I also tested this by creating a HAL VAL with Real Geometry, then created points at 5' intervals along the line in 3D and then ran Best Fit Line to those points and it looks like it fits to better than  +/- 0.3' (Hz) or +/- 0.06' (Vt) over the whole length of 1900' that I tried - this is a pretty good fit (but Chorded). Obviously with curves the results would differ but I am interested to see what we can do (see below)

     

    I also took the opportunity to chat to our Road Engineering developers. The Road Geometry Engine tools already has a Least Squares Fitting engine built in for Horizontal and Vertical Geometry, however we don't have a User Interface or Command to access it today, however we could run some tests to see how well it fits your needs here and look to maybe develop something in the future if the output we can generate makes sense. If you (and anyone else) could provide me with a sequential point list (where each point is in the correct order for stationing purposes) (p,n,e,z,d or p,e,n,z,d) with or without P and D fields, I will try to get some developer time to test this out to see what we can do and generate a Project that shows the results - we can then discuss the value of putting a UI to the Engine to generate this in the product sometime in the future.

     

    Alan



  • 6.  Re: Best fit line with curves?

    Posted 10-11-2018 10:28

    This is what i am doing. We have a famous channel in sweden called Göta kanal and right now we have the job to create 3D data for a total of 7500m of the channel in 3 different places. One of the places is 5400m long. The pictures below. We are suppose to create new 3D data for machine control, new drawings and cut n fill maps because the are going to redo some of the channel. The slopes are getting bad and the bottom with aint enough and so on. The one line that controls the whole project is the edge of the road (to the right in the picture), we cant move the more than 25cm in any way. If we move it towards the channel it will be to much fill (hard to get material to the site) and to the other side its trees wich we can NOT touch. As i said earlier we did measure the edge of the road with a atv with a R10 mounted and measured every 2m. They wanted us to create a smooth and nice line for the new edge of the channel. When i started with the line i almost gave up when i realised how much work this was going to be........But, i started to test the feature "best fit line" and when i figured out how it did work i was great, it really took away plenty of hours for me. I tested different ways and choosed a different amount of point if it was a big curve or kind of straight. I am pleased with the result. 

     

    Here is the file with aprox 2400 points  Dropbox - VK Fyrhjuling.csv 

     

    Thanks for a great forum.

     

     



  • 7.  Re: Best fit line with curves?

    Posted 11-03-2018 15:00

    Frederik - watch your email for some information ....

     

    Alan



  • 8.  Re: Best fit line with curves?

    Posted 11-22-2019 12:44

    How do you remove all the elvevations labels from the best fit line?  I can't seem to get rid of them.

     

    Thanks,

    Brandon



  • 9.  Re: Best fit line with curves?

    Posted 11-22-2019 14:51

    I have actually figured it out, it is a button on the bottom ribbon saying "Toggle Line Marking"

     

    Thanks,

    Brandon