News:

Thou shalt confirm thine airspeed on final, lest the earth rise up and smite thee. (pre-landing checklist, v1)

Main Menu

Unable to write AirspaceData in db

Started by thebeloved, April 13, 2016, 01:47:04 PM

Previous topic - Next topic

thebeloved

Hi!

I'm trying to rebuild the Plan-G db. The operation end successfully, however no airspace are availabe in the map. Looking at the log i found this error:

14:43:52.4 Writing 21583 Airspace Boundaries
14:43:52.4 WriteAirspaceData: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.ArrayList.get_Item(Int32 index)
   at Plan_G3.Data.FSData.generateAirspaceVectors(BglAirspace asp, String& latitudes, String& longitudes, Single& circleLatitude, Single& circleLongitude, Single& circleRadius)
   at Plan_G3.Data.FSData.WriteAirspaceData(List`1 airspaces)

Do you have an idea about why this exception comes up? Has someone faced this problem before?

Plan-G 3.1.3.113 on Win 7

tim arnot


Tim. @TimArnot

thebeloved


tim arnot

Do you have any add ons that change the default airspace? Also, could you attach the log file? thanks.

Tim. @TimArnot

thebeloved

Hi Tim,

found the issue. One of the airspace BGL had an error. Once decompiled i found the problem. If you see in the XML structure the "index" value is not contiguous(it skips from 1 to 3). Once corrected and recompiled, Plan-G was able to write the Airspace Data.

Hope this helps to strengthen the error catching capability of Plan-G.

<Boundary
      type="CLASS_D"
      name="TORINO CTR ZONE 2"
      >
      <BoundaryStart
         lat="N45 13.867"
         lon="E007 23.517"
         minimumAltitudeType="MSL"
         altitudeMinimum="457.2M"
         maximumAltitudeType="AGL"
         altitudeMaximum="2590.8M"/>
      <Com
         frequency="129.2750"
         type="APPROACH"
         name="TORINO"/>
      <Line
         lat="N44 37.000"
         lon="E007 15.000"/>
      <Line
         lat="N44 37.000"
         lon="E007 54.500"/>
      <Line
         lat="N44 40.767"
         lon="E008 03.717"/>
      <Origin
         lat="N44 55.483"
         lon="E007 51.717"/>
      <Arc
         type="COUNTER_CLOCKWISE"
         index="0"
         lat="N44 55.567"
         lon="E008 15.667"/>
      <Line
         lat="N45 10.867"
         lon="E008 15.650"/>
      <Origin
         lat="N45 11.000"
         lon="E008 10.000"/>
      <Arc
         type="COUNTER_CLOCKWISE"
         index="1"
         lat="N45 14.717"
         lon="E008 12.083"/>
      <Line
         lat="N45 22.317"
         lon="E007 44.550"/>
      <Origin
         lat="N45 12.067"
         lon="E007 38.883"/>
      <Arc
         type="COUNTER_CLOCKWISE"
         index="3"
         lat="N45 13.867"
         lon="E007 23.517"/>