本文整理汇总了C#中IFeatureClass.SqlIdentifier方法的典型用法代码示例。如果您正苦于以下问题:C# IFeatureClass.SqlIdentifier方法的具体用法?C# IFeatureClass.SqlIdentifier怎么用?C# IFeatureClass.SqlIdentifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFeatureClass
的用法示例。
在下文中一共展示了IFeatureClass.SqlIdentifier方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: loadOSMWays
//.........这里部分代码省略.........
{
IFeatureCursor insertLineCursor = osmLineFeatureClass.Insert(true);
comReleaser.ManageLifetime(insertLineCursor);
IFeatureBuffer featureLineBuffer = osmLineFeatureClass.CreateFeatureBuffer();
comReleaser.ManageLifetime(featureLineBuffer);
IFeatureCursor insertPolygonCursor = osmPolygonFeatureClass.Insert(true);
comReleaser.ManageLifetime(insertPolygonCursor);
IFeatureBuffer featurePolygonBuffer = osmPolygonFeatureClass.CreateFeatureBuffer();
comReleaser.ManageLifetime(featurePolygonBuffer);
if (((IWorkspace)featureWorkspace).WorkspaceFactory.WorkspaceType == esriWorkspaceType.esriRemoteDatabaseWorkspace)
{
lineFeatureLoad = osmLineFeatureClass as IFeatureClassLoad;
polygonFeatureLoad = osmPolygonFeatureClass as IFeatureClassLoad;
}
if (lineFeatureLoad != null)
{
lineFeatureLoad.LoadOnlyMode = true;
}
if (polygonFeatureLoad != null)
{
polygonFeatureLoad.LoadOnlyMode = true;
}
ISpatialReference nativeLineSpatialReference = ((IGeoDataset)osmLineFeatureClass).SpatialReference;
ISpatialReference nativePolygonSpatialReference = ((IGeoDataset)osmPolygonFeatureClass).SpatialReference;
IQueryFilter osmIDQueryFilter = new QueryFilterClass();
string sqlPointOSMID = osmPointFeatureClass.SqlIdentifier("OSMID");
IFeatureCursor updatePointCursor = null;
osmFileXmlReader = System.Xml.XmlReader.Create(osmFileLocation);
waySerializer = new XmlSerializer(typeof(way));
// the point query filter for updates will not changes, so let's do that ahead of time
try
{
osmIDQueryFilter.SubFields = osmPointFeatureClass.ShapeFieldName + "," + osmPointFeatureClass.Fields.get_Field(osmPointIDFieldIndex).Name + "," + osmPointFeatureClass.Fields.get_Field(osmWayRefCountFieldIndex).Name;
}
catch
{ }
osmFileXmlReader.MoveToContent();
while (osmFileXmlReader.Read())
{
if (osmFileXmlReader.IsStartElement())
{
if (osmFileXmlReader.Name == "way")
{
string currentwayString = osmFileXmlReader.ReadOuterXml();
// assuming the way to be a polyline is sort of a safe assumption
// and won't cause any topology problem due to orientation and closeness
bool wayIsLine = true;
bool wayIsComplete = true;
way currentWay = null;
try
{
using (StringReader wayReader = new System.IO.StringReader(currentwayString))
示例2: MergeTagsFromOuterPolygonToRelation
internal List<ESRI.ArcGIS.OSM.OSMClassExtension.tag> MergeTagsFromOuterPolygonToRelation(ESRI.ArcGIS.OSM.OSMClassExtension.relation currentRelation, IFeatureClass polygonFeatureClass)
{
Dictionary<string, ESRI.ArcGIS.OSM.OSMClassExtension.tag> mergedTagList = new Dictionary<string, ESRI.ArcGIS.OSM.OSMClassExtension.tag>();
IQueryFilter osmIDQueryFilter = new QueryFilterClass();
try
{
int osmIDPolygonFieldIndex = polygonFeatureClass.FindField("OSMID");
string sqlPolyOSMID = polygonFeatureClass.SqlIdentifier("OSMID");
foreach (var relationItem in currentRelation.Items)
{
if (relationItem is ESRI.ArcGIS.OSM.OSMClassExtension.member)
{
ESRI.ArcGIS.OSM.OSMClassExtension.member currentRelationMember = relationItem as ESRI.ArcGIS.OSM.OSMClassExtension.member;
if (currentRelationMember.role.ToLower().Equals("outer"))
{
using (ComReleaser comReleaser = new ComReleaser())
{
osmIDQueryFilter.WhereClause = sqlPolyOSMID + " = " + [email protected];
IFeatureCursor featureCursor = polygonFeatureClass.Search(osmIDQueryFilter, false);
comReleaser.ManageLifetime(featureCursor);
IFeature foundPolygonFeature = featureCursor.NextFeature();
if (foundPolygonFeature == null)
continue;
tag[] foundTags = _osmUtility.retrieveOSMTags(foundPolygonFeature, osmIDPolygonFieldIndex, ((IDataset)polygonFeatureClass).Workspace);
foreach (tag currentWayTag in foundTags)
{
// first one in wins
try
{
if (!mergedTagList.ContainsKey(currentWayTag.k))
{
mergedTagList.Add(currentWayTag.k, currentWayTag);
}
}
catch { }
}
}
}
}
else if (relationItem is tag)
{
tag relationTag = relationItem as tag;
try
{
if (!mergedTagList.ContainsKey(relationTag.k))
{
mergedTagList.Add(relationTag.k, relationTag);
}
}
catch { }
}
}
}
catch { }
return mergedTagList.Values.ToList();
}
示例3: loadOSMRelations
//.........这里部分代码省略.........
bool relationIndexRebuildRequired = false;
if (relationTable != null)
{
osmFileXmlReader = System.Xml.XmlReader.Create(osmFileLocation);
relationSerializer = new XmlSerializer(typeof(relation));
using (ComReleaser comReleaser = new ComReleaser())
{
using (SchemaLockManager linelock = new SchemaLockManager(osmLineFeatureClass as ITable), polygonLock = new SchemaLockManager(osmPolygonFeatureClass as ITable), relationLock = new SchemaLockManager(relationTable))
{
ICursor rowCursor = relationTable.Insert(true);
comReleaser.ManageLifetime(rowCursor);
IRowBuffer rowBuffer = relationTable.CreateRowBuffer();
comReleaser.ManageLifetime(rowBuffer);
IFeatureCursor lineFeatureInsertCursor = osmLineFeatureClass.Insert(true);
comReleaser.ManageLifetime(lineFeatureInsertCursor);
IFeatureBuffer lineFeatureBuffer = osmLineFeatureClass.CreateFeatureBuffer();
comReleaser.ManageLifetime(lineFeatureBuffer);
IFeatureCursor polygonFeatureInsertCursor = osmPolygonFeatureClass.Insert(true);
comReleaser.ManageLifetime(polygonFeatureInsertCursor);
IFeatureBuffer polygonFeatureBuffer = osmPolygonFeatureClass.CreateFeatureBuffer();
comReleaser.ManageLifetime(polygonFeatureBuffer);
int relationCount = 1;
int relationDebugCount = 1;
string lineSQLIdentifier = osmLineFeatureClass.SqlIdentifier("OSMID");
string polygonSQLIdentifier = osmPolygonFeatureClass.SqlIdentifier("OSMID");
message.AddMessage(_resourceManager.GetString("GPTools_OSMGPFileReader_resolvegeometries"));
osmFileXmlReader.MoveToContent();
while (osmFileXmlReader.Read())
{
if (osmFileXmlReader.IsStartElement())
{
if (osmFileXmlReader.Name == "relation")
{
relation currentRelation = null;
try
{
// read the full relation node
string currentrelationString = osmFileXmlReader.ReadOuterXml();
using (StringReader relationReader = new System.IO.StringReader(currentrelationString))
{
// de-serialize the xml into to the class instance
currentRelation = relationSerializer.Deserialize(relationReader) as relation;
}
if (currentRelation == null)
continue;
relationDebugCount = relationDebugCount + 1;
esriGeometryType detectedGeometryType = determineRelationGeometryType(osmLineFeatureClass, osmPolygonFeatureClass, relationTable, currentRelation);
if (checkForExisting)
{
switch (detectedGeometryType)