public void TestCustom() { SpatialContext sc = Call("units", "u"); Assert.Equal(DistanceUnits.CARTESIAN, sc.GetUnits()); Assert.Equal(new CartesianDistCalc(), sc.GetDistCalc()); sc = Call("units", "u", "distCalculator", "cartesian^2", "worldBounds", "-100 0 75 200");//West South East North Assert.Equal(new CartesianDistCalc(true), sc.GetDistCalc()); Assert.Equal(new RectangleImpl(-100, 75, 0, 200), sc.GetWorldBounds()); sc = Call("units", "miles", "distCalculator", "lawOfCosines"); Assert.Equal(DistanceUnits.MILES, sc.GetUnits()); var test = new GeodesicSphereDistCalc.LawOfCosines(sc.GetUnits().EarthRadius()); Assert.Equal(test, sc.GetDistCalc()); }
public void TestCustom() { SpatialContext sc = Call("geo", "false"); Assert.True(!sc.IsGeo()); Assert.Equal(new CartesianDistCalc(), sc.GetDistCalc()); sc = Call("geo", "false", "distCalculator", "cartesian^2", "worldBounds", "-100 0 75 200");//West South East North Assert.Equal(new CartesianDistCalc(true), sc.GetDistCalc()); Assert.Equal(new RectangleImpl(-100, 75, 0, 200, sc), sc.GetWorldBounds()); sc = Call("geo", "true", "distCalculator", "lawOfCosines"); Assert.True(sc.IsGeo()); var test = new GeodesicSphereDistCalc.LawOfCosines(); Assert.Equal(test, sc.GetDistCalc()); }