Subscribe to this thread
Home - General / All posts - Eliminating Slivers when Creating Contours
eolsonAG16 post(s)
#24-Feb-21 18:02

I have a point layer that I am creating surfaces off of. I have tested several different methods for the way that surface and its corresponding contours are created, but I tend to end up with tiny slivers in the end result.

Is there a way to mitigate that in the surface calculation? I know if you combine contours it can get rid of those, but I am hoping there is a way to set a minimum contour to end up in the result or something like that.

Perhaps changing the pixel size would help too? I don't want too coarse of an image though.

I have attached a word doc with images for the surface I have made and the numbers I assigned along with the resulting contour image. This one is better than some I have seen, but it still has a significant amount of tiny polygons I would like to avoid.

Attachments:
ManifoldQuestion.docx

danb


1,745 post(s)
#24-Feb-21 18:39

Looks like you need the equivalent of the Eliminate function in ArcGIS?

https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/eliminate.htm

I am sure that many moons ago Tim (tjhb) posted some M8 SQL to do this (or something very similar) so with any luck you might be able to find it with a forum search.


Landsystems Ltd ... Know your land | www.landsystems.co.nz

eolsonAG16 post(s)
#24-Feb-21 19:49

"Eliminate" makes me think that it won't exactly cover what I need. I will check out that link though, and then peruse the forum for that post you mentioned.

Thank you for your help.

dchall8
848 post(s)
#24-Feb-21 18:52

If you are talking about the small areas, you could calculate the area of each contour object and pick a threshold below which you want to delete the objects. Then sort by area and delete the small ones. There might be a more elegant transform for that, but there are many ways to do the same thing.

eolsonAG16 post(s)
#24-Feb-21 19:51

It is less of me trying to delete objects as it is merging them into a range without me having to remove ranges.

For my purposes, I can't have blank areas in the final result and I am guessing this method would create those.

I will give it a try nonetheless though, and I appreciate your suggestion.

tjhb

9,635 post(s)
#24-Feb-21 19:10

You could try to remove these slivers after creating contours, but in my opinion it is better to avoid creating them.

That is simple to do: pass a very light filter over the surface before making contours. I would suggest using a Blur filter with a radius of 1 (that is very light). With noisier data I would run a Median filter first, and replace the Blur with LowPass1, increasing the radius only if necessary.

eolsonAG16 post(s)
#24-Feb-21 19:52

This has some promise after testing it on one example. Seems to smooth out those areas and create a surface that fits my needs a bit better.

Thank you for your help on this one. I appreciate it!

tjhb

9,635 post(s)
#24-Feb-21 20:02

I misspoke: I remember now that the Blur filter in 8 has a fixed radius (no parameter).

If I need a wider radius I will iterate viz. Blur(Blur(Blur(...))). This behaves well. There are no square artefacts.

Mike Pelletier


1,860 post(s)
#24-Feb-21 21:54

Your suggestion of a single blur with 1 radius works really well on our lidar data in 9. Thanks!

Contouring is so much better in 9. Beyond the speed, the preview option makes trying different contour steps easy, as well as using the smooth transform to remove unnecessary. Much more enjoyable to use.

dchall8
848 post(s)
#25-Feb-21 22:27

Blurring is a genius suggestion. I'm going back to redo a ton of stuff right now.

Dimitri


6,512 post(s)
#25-Feb-21 08:31

I have a point layer that I am creating surfaces off of

This is puzzling, because creating surfaces creates a raster, not a vector. There are no vector slivers in a raster image. Do you mean the issue is that you are creating contours from a surface?

There's no need to create contours from points in order to create a raster surface. Create a raster surface directly from the points, using the Interpolate transform template. No slivers.

eolsonAG16 post(s)
#25-Feb-21 18:52

My apologies. I may be phrasing this incorrectly. I am creating a raster surface from a point layer so that I can then create contours from that.

The issue arises when I go from the raster step to the contours. It tends to create several tiny polygons that I would prefer to avoid making. The filter option mentioned above has helped mitigate this from happening so far, but I have not tested it a lot just yet.

I am also still in Manifold 8, so I am not sure if that affects the usage of the interpolate template mentioned here.

tjhb

9,635 post(s)
#25-Feb-21 18:57

I thought you were perfectly clear.

You would be better off in Manifold 9, no question. But the same issue would arise, and in my opinion light smoothing would still be the answer.

eolsonAG16 post(s)
#25-Feb-21 19:12

So I have 9 downloaded, but the business I work for has been built around 8. I honestly wouldn't even know where to begin in trying to transfer all of the capabilities, add-ins, etc.

I wish it was as simple as just opening a project in 9 that was created in 8, but unfortunately it doesn't appear that way. Though I definitely have not given it enough attention.

tjhb

9,635 post(s)
#25-Feb-21 19:24

Yes, you're right. It is far from trivial.

But worthwhile!

Just keep roughly up to date with developments in 9, make test projects using the Viewer, and when it clicks for your use cases, well, then it clicks.

It will probably turn on some item you can't achieve in 8 (in a reasonable time), but is trivially achievable in 9.

There are lots of those. Many.

drtees102 post(s)
#01-Mar-21 22:53

I have a work-around for you since you are using M8. First, I make a copy of the area that I want to use to create contours (avoiding permanent changes to the source layer). I open the copy I just made and then go to Surface Transform. Use the AvgValue(s,w) command where s is the source surface file, and w is a factor used by Manifold for averaging pixels. I use a w value of 1 (3x3 pixels). Once this is complete, you can use Surface Contours to create your topology. What I have found its that the little snippets of topography created without averaging the surface raster no longer appear using the averaged surface raster. Also, the contours created often match survey data to a remarkable degree.

Manifold User Community Use Agreement Copyright (C) 2007-2019 Manifold Software Limited. All rights reserved.