Beispiel #1
0
        public void CoordinateService_SimpleXYZNEEToLLH(double lat, double lon, double height, ReturnAs returnAs)
        {
            var xyz = _convertCoordinates.NEEToLLH(_csib, new XYZ(2313, 1204, 609), returnAs);

            xyz.Should().NotBeNull();
            xyz.X.Should().BeApproximately(lon, LL_CM_TOLERANCE);
            xyz.Y.Should().BeApproximately(lat, LL_CM_TOLERANCE);
            xyz.Z.Should().BeApproximately(height, LL_CM_TOLERANCE);
        }
Beispiel #2
0
        public void Should_see_Height_values_differ_when_comparing_CS_files_with_VERT_ADJUST(double lat, double lon, double height, ReturnAs returnAs, string dcFilename)
        {
            var csib = GetCSIBFromDC(dcFilename);

            var xyz = _convertCoordinates.NEEToLLH(csib, new XYZ(2313, 1204, 609), returnAs);

            xyz.Should().NotBeNull();
            xyz.X.Should().BeApproximately(lon, LL_CM_TOLERANCE);
            xyz.Y.Should().BeApproximately(lat, LL_CM_TOLERANCE);
            xyz.Z.Should().BeApproximately(height, LL_CM_TOLERANCE);
        }
Beispiel #3
0
        // creates an array of NEE for a sub grid
        //  which is sent to Coordinate service
        //  to resolve into a list of LHH (in same order)
        // Note: only adds entry where cellPassCount exists, so may not be 1024 entries
        private XYZ[] SetupLLPositions(string csibName, IClientLeafSubGrid subGrid)
        {
            var indexIntoNEECoords = 0;
            var NEECoords          = new XYZ[1024];
            var subGridProfile     = subGrid as ClientCellProfileLeafSubgrid;

            subGrid.CalculateWorldOrigin(out double subGridWorldOriginX, out double subGridWorldOriginY);
            SubGridUtilities.SubGridDimensionalIterator((x, y) =>
            {
                var cell = subGridProfile.Cells[x, y];
                if (cell.PassCount == 0) // Nothing for us to do, as cell is empty
                {
                    return;
                }
                var easting  = subGridWorldOriginX + (x + 0.5) * subGridProfile.CellSize;
                var northing = subGridWorldOriginY + (y + 0.5) * subGridProfile.CellSize;
                NEECoords[indexIntoNEECoords] = new XYZ(easting, northing, cell.Height);
                indexIntoNEECoords++;
            });

            return(_convertCoordinates.NEEToLLH(csibName, NEECoords.ToCoreX_XYZ()).ToTRex_XYZ());
        }
Beispiel #4
0
        public void NEEToLLH_should_handle_many_concurrent_threads()
        {
            var inputs = new List <NEE[]>
            {
                new [] {
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    }
                },
                new [] {
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    }
                },
                new [] {
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    }
                },
                new [] {
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    }
                },
                new [] {
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    }
                },
                new [] {
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    },
                    new NEE {
                        North = 0000, East = 0000, Elevation = 0000
                    }
                }
            };

            Parallel.ForEach(inputs, (nee) =>
            {
                _ = _convertCoordinates.NEEToLLH(CSIB.DIMENSIONS_2012_WITHOUT_VERT_ADJUST, nee);
            });
        }