• 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 Clipping polys using a 2nd poly layer

Messages
1,637
Country
unitedstates
Can I use one poly layer to "clip" a 2nd poly layer. At first glance I would say yes as by using this step:

BooleanFeatures|DIFFERENCE|VegType="*crop*"|FROMFILE="CHICO_Z20_buildMS.shp"|3

I was able to clip out nice little holes in my crop polys around my buildings (farms in this case). But when I try to do this on a broader scale clipping trees from croplands all tree polys that touch a crop poly is deleted.

For example, the screenshot below shows my trees in green surrounding a couple of farms.

Trees at farms.jpg


Now I have added a 2nd layer, my crop polys in orange.

Trees at farms w Crops as a mask.jpg


So I am assuming I could use a similar step like:

BooleanFeatures|DIFFERENCE|VegType="tree"|VegType="*crop*"|0

and it would cut though/slice ("clip"), the tree polys. Instead, it is completely deleting the tree polys. Even the trees directly around the farm houses where they are not touching the crop poly. Is this possible or am I using the step incorrectly?

Right now I have to run several "stages" of scenPROC to achieve the desired results.
1. run scenProc to detect/create trees using TFE
2. Export into QGIS to clip the tree polys using the cropland polys (using QGISs DIFFERENCE)
3. Run a second scenPROC to make some adjustments (buffer, etc.), and create the agn files.

Would like to do it all in one scenPROC run but maybe not possible?

This leads to a 2nd question. If I use a step on a poly, lets say like buffer, or a boolean, can the results be saved (or temporarily used) as a newly named layer to continue the scenPROC process with that newly named poly? Curious.

Thanks
 
"UnloadFeatures" and "UnloadXMLObjects" might do the trick for you,

No, UnloadFeatures won't help here. That will remove the entire feature when it matches the filter and thus does not clip it based on another polygon.

So I am assuming I could use a similar step like:

BooleanFeatures|DIFFERENCE|VegType="tree"|VegType="*crop*"|0

and it would cut though/slice ("clip"), the tree polys. Instead, it is completely deleting the tree polys. Even the trees directly around the farm houses where they are not touching the crop poly. Is this possible or am I using the step incorrectly?

This looks OK, except that a scale of 0 will not work. If you want to remove all trees that are in the crop polygons you would have to set the scale to 1.

This leads to a 2nd question. If I use a step on a poly, lets say like buffer, or a boolean, can the results be saved (or temporarily used) as a newly named layer to continue the scenPROC process with that newly named poly? Curious.

The BooleanFeatures step does modify the polygons you select as the first set. So if you do a difference with the second set, then the first set is modified and any step afterwards will use the modified one, not the original ones. The second set is never modified by the step. The BufferFeatures step works the same, it does also modify the features that you select with the filter.

Btw, I have just updated the scenProc manual to show more clearly what the effect of the BooleanFeatures step is on a set of polygons. It will show images of the difference between A and B, B and A and the intersection between the two.
 
@arno my suggestion/workaround pertains to running everything off one script instead of one stage/script at a time,
if he unloads the data he can run the next stage in the same script instead of starting a new script,
thus combining it all in one script even if its not the most elegant way about it can be achieved in one script run i believe,
 
Last edited:
As I understood it the main reason to run two scripts is because one action did not work in scenproc.

Unload is not needed that often. It only makes sense if you want to remove data because its not needed, e.g. unload certain trees so that you can use a simpler filter later on to select trees.
 
I guess this was what I was thinking. A step creates a certain process that is changing a layer. I now need to use the results of that layer to use as part of a new step. Now, I thought I was gonna need this with my trees as I could not seem to clip out crop areas around farm houses and then immediately use the modified crop layer to now filter out trees in croplands. One scenProc script to edit the cropland layer, a 2nd scenProc script to Clip out trees from the mod cropland layer.

However, after reading your post above, Arno on changing my '0' to a '1' is seems I can do what I want all in one script. More testing to confirm today but geeeze... here I thought I tried all combinations to get it to work to find out it was a simple integer! Arrg..:mad: No prob... all part of the game.

So with that that leads to a new 2nd question. I've always imported all my data at the top of the script. Could one perform a step on a layer, save it with a different name, use Chris's suggestion of unload features, then import the new modified layer back into the middle of the script and perform steps on that?

Also, the new scenPROC version adding in the Boolean results is REALLY helpful. Thx for that edition.
 
Last edited:
Hi,

You can save in the middle of the script, unload and load new data. But why would you want that? You already had that data loaded else you could not save it. So I don't see the need for this.
 
Back
Top