Opened 12 years ago

Closed 12 years ago

#4485 closed defect (invalid)

OGR reads incorrectly the same content gml files

Reported by: duypl Owned by: tamas
Priority: normal Milestone: 1.9.1
Component: CSharpBindings Version: unspecified
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

Can you help take a look on it ?

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

Attachments (1)

no-white-space.gml (1.1 KB ) - added by duypl 12 years ago.
GML file with no new line and white space

Download all attachments as: .zip

Change History (2)

by duypl, 12 years ago

Attachment: no-white-space.gml added

GML file with no new line and white space

comment:1 by duypl, 12 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.