Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
SHAliakbari committed Mar 25, 2024
1 parent 704521f commit ce30eb9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Examples/WebApp/gdal2tiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public gdal2tiles(string geoTiffPath, GeoLayers geoLayers)
};

geoLayer tmp = new geoLayer(geoRasterLayerOptions);
tmp.initialize(geoRasterLayerOptions);
//tmp.initialize(geoRasterLayerOptions);
return tmp;

});
Expand Down
43 changes: 28 additions & 15 deletions nUnitTests/mainTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,31 +115,46 @@ public void TestGeoRasterValues()
[Test]
public void TestBounds()
{
var geoRasterLayerOptions = new GeoRasterLayerOptions()
geoLayer tmp = new geoLayer(new GeoRasterLayerOptions()
{
georaster = georaster,
resolution= 256 // optional parameter for adjusting display resolution
};
geoLayer tmp = new geoLayer(geoRasterLayerOptions);
tmp.initialize(geoRasterLayerOptions);
});

var bounds = tmp.getBounds();
Assert.That(System.Math.Round( bounds.getSouthEast().Lat,2), Is.EqualTo(-35.45));
Assert.That(System.Math.Round(bounds.getSouthEast().Lng, 2), Is.EqualTo( -53.17));
Assert.That(System.Math.Round(bounds.getNorthWest().Lat,2), Is.EqualTo(13.14));
Assert.That(System.Math.Round(bounds.getSouthEast().Lat, 2), Is.EqualTo(-35.45));
Assert.That(System.Math.Round(bounds.getSouthEast().Lng, 2), Is.EqualTo(-53.17));
Assert.That(System.Math.Round(bounds.getNorthWest().Lat, 2), Is.EqualTo(13.14));
Assert.That(System.Math.Round(bounds.getNorthWest().Lng, 2), Is.EqualTo(-161.79));
tmp.Dispose();
}

[Test]
public void TestBoundsInProj84()
{
geoLayer tmp = new geoLayer(new GeoRasterLayerOptions()
{
georaster = georaster,
resolution= 256 // optional parameter for adjusting display resolution
});

SimplePoint bounds = tmp.getTopLeftPointInProj("8439",zoom = 8);

Check failure on line 141 in nUnitTests/mainTests.cs

View workflow job for this annotation

GitHub Actions / build

The name 'zoom' does not exist in the current context

Check failure on line 141 in nUnitTests/mainTests.cs

View workflow job for this annotation

GitHub Actions / build

'geoLayer' does not contain a definition for 'getTopLeftPointInProj' and no accessible extension method 'getTopLeftPointInProj' accepting a first argument of type 'geoLayer' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 141 in nUnitTests/mainTests.cs

View workflow job for this annotation

GitHub Actions / build

The name 'zoom' does not exist in the current context

Check failure on line 141 in nUnitTests/mainTests.cs

View workflow job for this annotation

GitHub Actions / build

'geoLayer' does not contain a definition for 'getTopLeftPointInProj' and no accessible extension method 'getTopLeftPointInProj' accepting a first argument of type 'geoLayer' could be found (are you missing a using directive or an assembly reference?)

Assert.That(System.Math.Round(bounds.getSouthEast().Lat, 2), Is.EqualTo(-35.45));

Check failure on line 143 in nUnitTests/mainTests.cs

View workflow job for this annotation

GitHub Actions / build

'SimplePoint' does not contain a definition for 'getSouthEast' and no accessible extension method 'getSouthEast' accepting a first argument of type 'SimplePoint' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 143 in nUnitTests/mainTests.cs

View workflow job for this annotation

GitHub Actions / build

'SimplePoint' does not contain a definition for 'getSouthEast' and no accessible extension method 'getSouthEast' accepting a first argument of type 'SimplePoint' could be found (are you missing a using directive or an assembly reference?)
Assert.That(System.Math.Round(bounds.getSouthEast().Lng, 2), Is.EqualTo(-53.17));

Check failure on line 144 in nUnitTests/mainTests.cs

View workflow job for this annotation

GitHub Actions / build

'SimplePoint' does not contain a definition for 'getSouthEast' and no accessible extension method 'getSouthEast' accepting a first argument of type 'SimplePoint' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 144 in nUnitTests/mainTests.cs

View workflow job for this annotation

GitHub Actions / build

'SimplePoint' does not contain a definition for 'getSouthEast' and no accessible extension method 'getSouthEast' accepting a first argument of type 'SimplePoint' could be found (are you missing a using directive or an assembly reference?)
Assert.That(System.Math.Round(bounds.getNorthWest().Lat, 2), Is.EqualTo(13.14));

Check failure on line 145 in nUnitTests/mainTests.cs

View workflow job for this annotation

GitHub Actions / build

'SimplePoint' does not contain a definition for 'getNorthWest' and no accessible extension method 'getNorthWest' accepting a first argument of type 'SimplePoint' could be found (are you missing a using directive or an assembly reference?)
Assert.That(System.Math.Round(bounds.getNorthWest().Lng, 2), Is.EqualTo(-161.79));

Check failure on line 146 in nUnitTests/mainTests.cs

View workflow job for this annotation

GitHub Actions / build

'SimplePoint' does not contain a definition for 'getNorthWest' and no accessible extension method 'getNorthWest' accepting a first argument of type 'SimplePoint' could be found (are you missing a using directive or an assembly reference?)
tmp.Dispose();
}

[Test]
public void TestgetProjector()
{
var geoRasterLayerOptions = new GeoRasterLayerOptions()
geoLayer tmp = new geoLayer(new GeoRasterLayerOptions()
{
georaster = georaster,
resolution= 256 // optional parameter for adjusting display resolution
};
geoLayer tmp = new geoLayer(geoRasterLayerOptions);
tmp.initialize(geoRasterLayerOptions);
});

var proj = tmp.getProjector();
//TODO : check WKT value
Expand All @@ -149,13 +164,11 @@ public void TestgetProjector()
[Test]
public void TestIsValidTile()
{
var geoRasterLayerOptions = new GeoRasterLayerOptions()
geoLayer tmp = new geoLayer(new GeoRasterLayerOptions()
{
georaster = georaster,
resolution= 256 // optional parameter for adjusting display resolution
};
geoLayer tmp = new geoLayer(geoRasterLayerOptions);
tmp.initialize(geoRasterLayerOptions);
});

Assert.That(tmp.IsValidTile(new Coords { x = 199, y = 200, z = 8 }), Is.EqualTo(false));
Assert.That(tmp.IsValidTile(new Coords { x = 199, y = 200, z = 8 }), Is.EqualTo(false));
Expand Down
1 change: 1 addition & 0 deletions src/geoLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ public bool isSimpleCRS(CRS crs)
public geoLayer(GeoRasterLayerOptions options)
{
this.options = options;
initialize(options);

}

Expand Down

0 comments on commit ce30eb9

Please sign in to comment.