• 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.

scenProc CreateAGNPolyVeg Argument out of Range

MatthiasKNU

Resource contributor
Messages
962
Country
germany
Hello Arno,

I hope you are well, even in these times!

After a long time I think I found a bug in ScenProc again...
At this point I would like to thank you again, without ScenProc all my sceneries would have been unthinkable!

Code:
08:01    SceneryProcessor    Error        System.AggregateException: Mindestens ein Fehler ist aufgetreten. ---> System.ArgumentOutOfRangeException: Der Index lag außerhalb des Bereichs. Er darf nicht negativ und kleiner als die Sammlung sein.
Parametername: index
   bei System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   bei System.Collections.Generic.List`1.RemoveAt(Int32 index)
   bei ASToFra.Geometry.Polygon.CleanPolygon(Double eps)
   bei ASToFra.Geometry.BooleanOperator.GetBooleanResult(BooleanType btype)
   bei ASToFra.Geometry.BooleanOperator.get_AminusB()
   bei ASToFra.scenProc.DataModel.PolygonFeature.GetPolygonsWithoutHoles()
   bei ASToFra.scenProc.Steps.CreateAGNPolyVeg.<>c__DisplayClass1_0.<Process>b__0(GridCell cell)
   bei System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   bei System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   bei System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   bei System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   bei System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
   bei System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   bei System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, Action`1 body)
   bei ASToFra.scenProc.Steps.CreateAGNPolyVeg.Process(List`1 cells, String[] arguments)
   bei ASToFra.scenProc.Processor.SceneryProcessor.Process()
   bei ASToFra.scenProc.Processor.SceneryProcessor.ProcessConfig(String filename, List`1 commands)
---> (Interne Ausnahme #0) System.ArgumentOutOfRangeException: Der Index lag außerhalb des Bereichs. Er darf nicht negativ und kleiner als die Sammlung sein.
Parametername: index
   bei System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   bei System.Collections.Generic.List`1.RemoveAt(Int32 index)
   bei ASToFra.Geometry.Polygon.CleanPolygon(Double eps)
   bei ASToFra.Geometry.BooleanOperator.GetBooleanResult(BooleanType btype)
   bei ASToFra.Geometry.BooleanOperator.get_AminusB()
   bei ASToFra.scenProc.DataModel.PolygonFeature.GetPolygonsWithoutHoles()
   bei ASToFra.scenProc.Steps.CreateAGNPolyVeg.<>c__DisplayClass1_0.<Process>b__0(GridCell cell)
   bei System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   bei System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   bei System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)<---

I have immediately uploaded the relevant shapefile for troubleshooting. I ran an error check on the shapefile, the shapefile seems to be OK:

Best regards!
Matthias
 
Hi Mattias,

That is quite a big SHP file. Did you split the file in AGN grid with SplitGrid first and now you are creating polygonal vegetation with which filter?

Arno
 
Hi Arno,

damn, I forgot to add the script... My bad, sorry.

Code:
ImportOGR|C:\Users\mknue\Desktop\agnCreator\temp\landuse28.shp|*|*|NOREPROJ
SplitGrid|AGN|*
CreateAGNPolyVeg|GUID="{555d00a0-ddf2-4328-9478-b1048bc52853}"|{555d00a0-ddf2-4328-9478-b1048bc52853}
CreateAGNPolyVeg|GUID="{43c5b4ac-0366-430c-b303-dc7c61c711a5}"|{43c5b4ac-0366-430c-b303-dc7c61c711a5}
CreateAGNPolyVeg|GUID="{ca0818dd-dab8-4edd-9b14-d69766fea98a}"|{ca0818dd-dab8-4edd-9b14-d69766fea98a}
ExportAGN|P3D v2|OUTPUT\texture_processed28

If you look at the shapefile, you will see that I have already split the large polygons into many small ones to avoid holes and thus increase the processing speed. With other shapefiles - some even larger - there have been no problems so far.
 
OK, let me see if I can reproduce the crash that way.
 
Hi,

Yes, I could reproduce it. But since the SHP file is so huge it is hard to debug the error (at the moment the crash happens, I can't see anymore what the input data was and if that contains anything irregular).
 
Hi!
Thanks for the response!
I have greatly reduced the size of the shapefile and deleted all unproblematic features. Maybe it helps!

 
It's still 8000 features to dig through while trying to find the one that crashes, but let's see if it is easier with this fine.
 
When I check the SHP file in QGIS the validity check reports there are around 300 features with self intersecting rings. After I remove those the file processes fine.

I'll still see if I can make scenProc more robust for it as well.
 
Good morning Arno!

That's quite interesting - I ran the Check geometries tool in ArcGIS over it, and it doesn't show me any errors.
Also the Repair-Geometries-Tool does nothing, so I on my side have no further possibility to check the features.
 
Hi,

I have made some changes now to the ImportOGR step. It will buffer the invalid geometries, that fixes the crash. The fix will be in the next development release.
 
Hi Arno!

Thanks a lot! That sounds interesting - and thanks a lot for your very, very fast updates!
 
Hi Arno, this last update erase the mouse right click, so I doesn't show the short examples or open files from folders, Is there another option for this, thanks
 
Hi,

It was actually not this change, but another change I made yesterday that caused the issue you described. I have fix it now and in the next development release it will work OK again. Thanks for reporting.
 
Hi Arno!

I just tried the update out - and what should I say? It works perfectly! So I can continue to create the update for Kenya!
Thanks a lot for making ScenProc better and better and better! :)
 
Back
Top