bilaldursun1 / nettopologysuite

Automatically exported from code.google.com/p/nettopologysuite
0 stars 0 forks source link

Bug in ShapefileWriter.WriteDummyDbf #57

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using this method creates an shp file that cannot be loaded into ArcMap.

What is the expected output? What do you see instead?
The written Shpefile should be able to be loaded into ArcMap sofware, but 
instead an exception is thrown - "Number of shapes does not match number of 
table records".

What version of the product are you using? On what operating system?
NTS 1.7.3. Windows Server 2003.

Please provide any additional information below.
What seems to cause the problem is that the DbaseFileHeader is not written 
correctly since the NumRecords property is not set. Because of that, the 
header states there are 0 shapes in the file, when there are actually more 
than that

Original issue reported on code.google.com by oha...@gmail.com on 4 Feb 2010 at 8:03

GoogleCodeExporter commented 9 years ago
I've generated a sample shapefile using this code:
  var p1 = Factory.CreatePoint(new Coordinate(100, 100));
  var p2 = Factory.CreatePoint(new Coordinate(200, 200));
  var coll = new GeometryCollection(new IGeometry[] { p1, p2, });
  var writer = new ShapefileWriter(Factory);
  writer.Write(@"c:\test_arcview", coll);
  ShapefileWriter.WriteDummyDbf(@"c:\test_arcview.dbf", 2);
(see attached file)
This file is opened with qgis and gvsig, I'm unable to open it with ArcMap so 
can you 
try to verify if it works?

Original comment by diegogu...@gmail.com on 4 Feb 2010 at 2:14

Attachments:

GoogleCodeExporter commented 9 years ago
looks ok for my tests

Original comment by diegogu...@gmail.com on 21 Apr 2010 at 3:00