Skip to content

Commit

Permalink
Add unit test to validate modification related to DbfNumericDecimalField
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoNetoMartins committed Sep 6, 2024
1 parent fdf3bbb commit d1f50ed
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/NetTopologySuite.IO.Esri.Test/Issues/Issue057.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using NetTopologySuite.IO.Esri.Shapefiles.Readers;
using NUnit.Framework;

namespace NetTopologySuite.IO.Esri.Test.Issues;

/// <summary>
/// https://github.com/NetTopologySuite/NetTopologySuite.IO.Esri/issues/57
/// </summary>
internal class Issue057
{
[Test]
public void Decimal0_OpenShapefile()
{
var shpPath = TestShapefiles.PathTo("Issues/057/deter-nf-deter-public.shp");
var options = new ShapefileReaderOptions
{
GeometryBuilderMode = GeometryBuilderMode.FixInvalidShapes
};
using var shpReader = Shapefile.OpenRead(shpPath, options);

Assert.AreEqual(shpReader.ShapeType, ShapeType.Polygon);

while (shpReader.Read())
{
var dosis = shpReader.Fields["AREA_KM"].Value.ToString();
Assert.IsNotEmpty(dosis);
Assert.IsFalse(shpReader.Geometry.IsEmpty);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GEOGCS["SIRGAS 2000",DATUM["Sistema_de_Referencia_Geocentrico_para_las_AmericaS_2000",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6674"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4674"]]
Binary file not shown.
Binary file not shown.

0 comments on commit d1f50ed

Please sign in to comment.