本文整理汇总了C#中OSGeo.GetFieldAsDoubleList方法的典型用法代码示例。如果您正苦于以下问题:C# OSGeo.GetFieldAsDoubleList方法的具体用法?C# OSGeo.GetFieldAsDoubleList怎么用?C# OSGeo.GetFieldAsDoubleList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OSGeo
的用法示例。
在下文中一共展示了OSGeo.GetFieldAsDoubleList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadOgrFeatureToFeatureDataRow
private static FeatureDataRow LoadOgrFeatureToFeatureDataRow(FeatureDataTable table, OSGeo.OGR.Feature ogrFeature, GeoAPI.Geometries.IGeometryFactory factory)
{
var values = new object[ogrFeature.GetFieldCount()];
for (var iField = 0; iField < ogrFeature.GetFieldCount(); iField++)
{
// No need to get field value if there's no value available...
if (!ogrFeature.IsFieldSet(iField))
{
continue;
}
int count;
switch (ogrFeature.GetFieldType(iField))
{
case OgrFieldType.OFTString:
case OgrFieldType.OFTWideString:
values[iField] = ogrFeature.GetFieldAsString(iField);
break;
case OgrFieldType.OFTStringList:
case OgrFieldType.OFTWideStringList:
values[iField] = ogrFeature.GetFieldAsStringList(iField);
break;
case OgrFieldType.OFTInteger:
values[iField] = ogrFeature.GetFieldAsInteger(iField);
break;
case OgrFieldType.OFTIntegerList:
values[iField] = ogrFeature.GetFieldAsIntegerList(iField, out count);
break;
case OgrFieldType.OFTReal:
values[iField] = ogrFeature.GetFieldAsDouble(iField);
break;
case OgrFieldType.OFTRealList:
values[iField] = ogrFeature.GetFieldAsDoubleList(iField, out count);
break;
case OgrFieldType.OFTDate:
case OgrFieldType.OFTDateTime:
case OgrFieldType.OFTTime:
Int32 y, m, d, h, mi, s, tz;
ogrFeature.GetFieldAsDateTime(iField, out y, out m, out d, out h, out mi, out s, out tz);
try
{
if (y == 0 && m == 0 && d == 0)
values[iField] = DateTime.MinValue.AddMinutes(h * 60 + mi);
else
values[iField] = new DateTime(y, m, d, h, mi, s);
}
// ReSharper disable once EmptyGeneralCatchClause
catch { }
break;
default:
Debug.WriteLine("Cannot handle Ogr DataType '{0}'", ogrFeature.GetFieldType(iField));
break;
}
}
var fdr = (FeatureDataRow)table.LoadDataRow(values, true);
using (var gr = ogrFeature.GetGeometryRef())
{
fdr.Geometry = ParseOgrGeometry(gr, factory);
gr.Dispose();
}
return fdr;
}