Open rpachaly opened 11 months ago
@FLO-2DKaren Hi Karen. Do you have any idea on how to do this on QGIS? I'm trying to find an efficient way to do the same thing that mapper does but nothing seems to smooth the edges the way mapper does.
I need to run a couple of algorithms to get the same mapper result. It will take around 3-5 seconds per map I think.
Did you use raster contour tool?
To get this kind of result, I follow these steps:
It is not efficient but it works.
It works fine for continuous data, but for categorized data (e.g. hazard maps) it is bad.
Maybe we should see what the Mapper code is doing. I’ll ask JJ to give us some help.
@FLO-2DJJ hi JJ. Can you tell us how Mapper builds contour maps? If you follow this conversion you’ll get an idea of what’s happening with the raster maps.
hould see what the Mapper code is doing. I’ll ask JJ to give us some help.
Great idea! If I have to code everything, I'll have something to be based on.
Yes. I've been following this. Great work Robson. Tomorrow I'll see if there is something that can be done according to my experience with Mapper. It uses a different approach but could show some light on the issue.
On Fri, 27 Oct 2023, 9:51 pm Robson Pachaly, @.***> wrote:
hould see what the Mapper code is doing. I’ll ask JJ to give us some help.
Great idea! If I have to code everything, I'll have something to be based on.
— Reply to this email directly, view it on GitHub https://github.com/FLO-2DSoftware/FLO-2DMapCrafter/issues/23#issuecomment-1783429088, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE32O74OQG46U5FOW7X3Q5LYBQGDFAVCNFSM6AAAAAA6SXGH2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBTGQZDSMBYHA . You are receiving this because you were mentioned.Message ID: @.***>
1. Create the "Contour Polygons" from the raster 2. Create the "Raster pixel to points" 3. Create the "Concave hull (k-nearest neighbor)" using the "Raster pixel to points" -> to remove the square edges 4. Apply the "Smooth" for better visualization using the "Concave hull (k-nearest neighbor)" -> it is not necessary 5. Clip the "Contour Polygons" with "Smooth" to remove the edges.
@rpachaly hi Robson, can I see the code you are using here. Do you have a branch with this code so that I can see it? I t doesn't seem to be in the "new_mapping" branch.
@FLO-2DJJ Hi JJ,
No, this is not coded yet. This is just the QGIS native algorithms that I intent to use. If you think this is a good approach, I'll code this way. Otherwise, feel free to suggest other approaches.
Ok. No problem. Currently I'm looking at the old Mapper code to see the approach. The code itself is obsolete and no longer supported but it could show a direction to follow. Thanks.
On Sat, 28 Oct 2023, 4:52 pm Robson Pachaly, @.***> wrote:
@FLO-2DJJ https://github.com/FLO-2DJJ Hi JJ,
No, this is not coded yet. This is just the QGIS native algorithms that I intent to use. If you think this is a good approach, I'll code this way. Otherwise, feel free to suggest other approaches.
— Reply to this email directly, view it on GitHub https://github.com/FLO-2DSoftware/FLO-2DMapCrafter/issues/23#issuecomment-1783836928, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE32O77V6ECMDTX7HOQRTWTYBULZHAVCNFSM6AAAAAA6SXGH2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBTHAZTMOJSHA . You are receiving this because you were mentioned.Message ID: @.***>
To create filled contours (shaded contours) in the old Mapper, like this Maximum Water Surface Elevation
it doesn't create contour lines first. Instead it creates a 2D rectangular matrix (280 x 222 in this example) with the value of the variable in each cell (or a very small negative value to indicate novalue). Then it calls a SimplePlot function (SimplePlot was the name software used) to create the the plot. Maybe we could try a similar approach in QGIS. I have not found it yet.
Thanks JJ! This is a good direction to follow. I don't think that creating the contours is a good approach, specially for categorized data.
The GRASS r.resamp.inter algorithm interpolate the raster values and create a very good internal result. But the edges are still grid-like and it misses some areas close to the raster's edges.
This plugin is also good. It creates contour polygons from points. https://github.com/ccrook/QGIS-Contour-Plugin
Interesting. I'm going to try creating cell centroids and continue from there.
On Tue, 31 Oct 2023, 5:59 pm Robson Pachaly, @.***> wrote:
This plugin is also good. It creates contour polygons from points. https://github.com/ccrook/QGIS-Contour-Plugin
— Reply to this email directly, view it on GitHub https://github.com/FLO-2DSoftware/FLO-2DMapCrafter/issues/23#issuecomment-1787617992, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE32O74C2JO2PQPCIF5UZE3YCEU5VAVCNFSM6AAAAAA6SXGH2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBXGYYTOOJZGI . You are receiving this because you were mentioned.Message ID: @.***>
Yes Robson, the https://github.com/ccrook/QGIS-Contour-Plugin plugin produces acceptable results. Let's try its several options to see if we can adopt it.
It creates a 'Vector points' layer.
That looks good! I'm think that the best option so far is to understand the Contour Plugin logic and adapt it to MapCrafter. I was worried about the processing time to create a map, but Mapper also takes some seconds to generate a Shaded Contour map.
I suggest we let the end users figure this out for now. Not many people request contours and those who do should be able to figure it out with the QGIS toolbox. Let's not spend more time on this. We have more important tasks.
Find a way to smooth the grid edges like Mapper