Skip to content

Commit

Permalink
Merge pull request Esri#71 from ThomasEmge/dev
Browse files Browse the repository at this point in the history
fix for turning the outer way after tag transfer into supporting element
  • Loading branch information
ThomasEmge committed Jan 16, 2015
2 parents 03a1fa2 + a7e803b commit ee15a95
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/OSMGeoProcessing/OSMToolHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4322,6 +4322,7 @@ internal bool IsThisWayALine(string osmID, IFeatureClass lineFeatureClass, strin
try
{
int osmIDPolygonFieldIndex = polygonFeatureClass.FindField("OSMID");
int osmSupportingElementFieldIndex = polygonFeatureClass.FindField("osmSupportingElement");
string sqlPolyOSMID = polygonFeatureClass.SqlIdentifier("OSMID");

foreach (var relationItem in currentRelation.Items)
Expand All @@ -4336,7 +4337,7 @@ internal bool IsThisWayALine(string osmID, IFeatureClass lineFeatureClass, strin
{
osmIDQueryFilter.WhereClause = polygonFeatureClass.WhereClauseByExtensionVersion(currentRelationMember.@ref, "OSMID", 2);

IFeatureCursor featureCursor = polygonFeatureClass.Search(osmIDQueryFilter, false);
IFeatureCursor featureCursor = polygonFeatureClass.Update(osmIDQueryFilter, false);
comReleaser.ManageLifetime(featureCursor);

IFeature foundPolygonFeature = featureCursor.NextFeature();
Expand All @@ -4346,6 +4347,12 @@ internal bool IsThisWayALine(string osmID, IFeatureClass lineFeatureClass, strin

tag[] foundTags = _osmUtility.retrieveOSMTags(foundPolygonFeature, osmIDPolygonFieldIndex, ((IDataset)polygonFeatureClass).Workspace);

// set this feature from which we transfer to become a supporting element
if (osmSupportingElementFieldIndex > -1)
foundPolygonFeature.set_Value(osmSupportingElementFieldIndex, "yes");

featureCursor.UpdateFeature(foundPolygonFeature);

foreach (tag currentWayTag in foundTags)
{
// first one in wins
Expand Down

0 comments on commit ee15a95

Please sign in to comment.