Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/NetTopologySuite.IO.Esri.Shapefile/Dbf/DbfReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ private void Initialize(Stream stream, Encoding encoding = null)
internal void Restart()
{
DbfStream.Seek(HeaderSize, SeekOrigin.Begin);
CurrentIndex = 0;
}


Expand Down
25 changes: 25 additions & 0 deletions test/NetTopologySuite.IO.Esri.Test/Issues/Issue063.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using NUnit.Framework;

namespace NetTopologySuite.IO.Esri.Test.Issues;

/// <summary>
/// https://github.com/NetTopologySuite/NetTopologySuite.IO.Esri/issues/63
/// </summary>
internal class Issue063
{
[Test]
public void ShapefileResetTest()
{
var shpPath = TestShapefiles.PathTo("nested_polygons.shp");
using var shpReader = Shapefile.OpenRead(shpPath);

// This test need a shapefile with one feature (RecordCount == 1)
Assert.That(shpReader.RecordCount, Is.EqualTo(1));

var readOk = shpReader.Read();
Assert.IsTrue(readOk);
shpReader.Restart();
readOk = shpReader.Read();
Assert.IsTrue(readOk);
}
}