• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v5 Water Detection idea (work-around)

Messages
1,521
Country
unitedstates
Ah, good eye. I corrected but still get the following error at the detection step:

11:07 AM SceneryProcessor Error System.IO.InvalidDataException: Unexpected image type Emgu.CV.Image`2[Emgu.CV.Structure.Gray,System.Byte]
at ASToFra.scenProc.Steps.DetectFeatures.Process(List`1 cells, String[] arguments)
at ASToFra.scenProc.Processor.SceneryProcessor.Process()
at ASToFra.scenProc.Processor.SceneryProcessor.ProcessConfig(String filename, List`1 commands)

For Method 1, here is a screenshot:

74 BS32 slope method 2 - CEN_0-1_FAREA-200.jpg


The following steps were used for the above results:
ImportGDAL|B:\CA\Section_74\Images\CA_BS32_DEM.tif|*|NOREPROJ|String;CENTER|elev
ImportGDAL|B:\CA\Section_74\Images\CA_BS32.tif|*|NOREPROJ|String;type|image

ProcessElevationRaster|type="elev"|SLOPE|String;type|slope

SplitGrid|LOD13|*

DetectFeatures|type="image"|B:\CA\Section_74\_Control Data\CA_Section_74_TFE_Water.tf2|String;WatType|water|NONE

AddAttributeSampleRaster|type="water"|type="slope"|CENTER|slope

# Unload all features where the slope is above a certain threshold
UnloadFeatures|slope_0>1

MergeGrid

ExportOGR|WatType="water"AND FAREA>200|ESRI Shapefile|B:\CA\Section_74\Masks Water Tests\CA_BS32_WM_CENT_1_200.shp|water

It almost appears at the Unload step, anything greater than 1% is retained, not removed... the opposite? As you can see those slopes are way greater than 1%.
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,886
Country
netherlands
In the step where you add the slope attribute you are using type="water", while elsewhere you use Wat type="water". So I don't think a slope attribute is added and therefore nothing is unloaded as well.

In the event log you should see messages how many features were processed by the step.
 
Messages
1,521
Country
unitedstates
Ok, made the correction. Still no change. Here is the script and a screenie of the processing where no features were removed.

ImportGDAL|B:\CA\Section_74\Images\CA_BS32_DEM.tif|*|NOREPROJ|String;CENTER|elev
ImportGDAL|B:\CA\Section_74\Images\CA_BS32.tif|*|NOREPROJ|String;type|image

ProcessElevationRaster|type="elev"|SLOPE|String;type|slope

SplitGrid|LOD13|*

DetectFeatures|type="image"|B:\CA\Section_74\_Control Data\CA_Section_74_TFE_Water.tf2|String;type|water|NONE

AddAttributeSampleRaster|type="water"|type="slope"|CENTER|slope

UnloadFeatures|slope_0>1

MergeGrid

ExportOGR|type="water"|ESRI Shapefile|B:\CA\Section_74\Masks Water Tests\CA_BS32_WM_CENT_1.shp|water

74 BS32 slope method 2 - CEN_0-1 processing steps.jpg
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,886
Country
netherlands
You assign your elevation raster an attribute CENTER="elev", but when calculating the slope you select type="elev". So that means nothing matches and no slope is calculated.
 
Messages
677
Country
ca-quebec
Hi,

Could the procedure be adapted for mountain roads in FS2020? Like lakes and rivers, we often see them following the slope when in reality they are transversely flat.

I had suggested this simple routine to Asobo: every x meters (depending on the desired degree of precision), transversely, place the highest side of the road at the same level as the lowest side. Without answer...
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,886
Country
netherlands
I'm not sure how scenproc could help with roads in MSFS, since scenproc can not make them.

To be able to fix roads you would need very high resolution elevation data as well, which is not always available. It would be easier to have some procedural rules that roads are flat and modify the elevation data based on that.
 
Messages
1,521
Country
unitedstates
Back from another trip, I was able to make the adjustments and I am beginning to see promising results as a work-around. Lot's of testing in different geographic areas are still needed but this could save a lot a of "clean-up" time where the current water detection misses. I'll show you results when I continue testing. :)
 
Messages
1,521
Country
unitedstates
Starting to test with your 2nd method. I am confused with this step:

DetectFeatures|type="slope"|slope_threshold.tfc|String;type|mask|NONE

Am I to create a 2nd .tfc file (which you named above 'slope_threshold.tfc' as an example), for this method to process? If so, how does one create this tfc file? I take it using the TFE but is there a step to create this? Does one create a TFE script and use the Threshold Binary step? How would the TFE script look like?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,886
Country
netherlands
You just make a texture filter like normal, but then to work on the slope image instead of images. So it just needs a binary threshold step with the threshold slope value you want.
 
Messages
1,521
Country
unitedstates
I may need a little "hand-holding" as I go through method #2. To create the 2nd texture filter (.tf2), I will have to break down my DEM image into sample size images like I do with my regular images? Or can I just use the DEM image itself since the size is so small? Yea, way lost here. So if I open the Threshold Binary step in TFE I default threshold of 128, which would understand this is half way on the grayscale of the DEM image? How does the relate to slop when that represents altitude?
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,886
Country
netherlands
Hi,

I would just try it at the current size first. You are not using the DEM image directly of course in the texture filter, you are using the slope image that was generated from it. By using the 2nd texture filter you can select the areas with low slope and use these for masking in the water detection.
 
Top