Ticket #4486 (closed defect: invalid)
ORG reads incorrectly same content GML files
| Reported by: | duypl | Owned by: | tamas |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | CSharpBindings | Version: | 1.9.0 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Hi,
I'm using OGR .NET binding version 1.9 to read and convert GIS files to GML. I download the OGR .NET from this link http://www.gisinternals.com/sdk/PackageList.aspx?file=release-1600-gdal-1-9-mapserver-6-0.zip
Recently, when using OGR to read two same GML files, I found a funny issue: the content of two GML files is the same except one file has new line and white space while other doesn't. Then the OGR reads them with totally different geometry type !. Below is the code I use to read GML file, the geoType variable will result two different value for two GML file although their content is the same
- For the file without any new line and white space: geoType = wkbGeometryType.wkbMultiPoint
- For the file with new line and white space: geoType = wkbGeometryType.wkbPoint
Is it a bug ?
using (var ds = Ogr.Open("data.gml", 0))
{
using (var layer = ds.GetLayerByIndex(0))
{
Feature f = null;
do
{
f = layer.GetNextFeature();
if (f == null)
{
break;
}
using (f)
using (var geometry = f.GetGeometryRef())
{
var geoType = geometry.GetGeometryType();
}
} while (f != null);
}
}
Regards, Duy

