Skip to content

Commit

Permalink
fix for merging the tags of outer ways to the parent relation without…
Browse files Browse the repository at this point in the history
… tags
  • Loading branch information
unknown authored and unknown committed Jan 14, 2015
1 parent f7fd0e6 commit 5f3840b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion src/OSMGeoProcessing/OSMGPDiffLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2309,7 +2309,7 @@ private void manipulateRelations(Dictionary<string, relation> relations, string
}
#endregion

#region create - modigy polygon relations
#region create - modify polygon relations
foreach (string whereClause in polygonWhereClauses)
{
if (trackCancel.Continue() == false)
Expand Down Expand Up @@ -4209,15 +4209,28 @@ private void manipulateRelationFeature(relation createRelation, ref IFeature edi

if (tagCollectionFieldIndex > -1)
{
// if the current relation doesn't have keys we merge the tags from the outer rings to the relation
if (!_osmUtility.DoesHaveKeys(createRelation))
{
IFeatureClass osmPolygonFeatureClass = editFeature.Table as IFeatureClass;
relationTagList = osmToolHelper.MergeTagsFromOuterPolygonToRelation(createRelation, osmPolygonFeatureClass);
}


_osmUtility.insertOSMTags(tagCollectionFieldIndex, editFeature, relationTagList.ToArray());
}
}
else
{
// if no tags exist we'll attempt to merge the tags from the outer rings to the relation
IFeatureClass osmPolygonFeatureClass = editFeature.Table as IFeatureClass;

if (osmPolygonFeatureClass != null)
{
relationTagList = osmToolHelper.MergeTagsFromOuterPolygonToRelation(createRelation, osmPolygonFeatureClass);

_osmUtility.insertOSMTags(tagCollectionFieldIndex, editFeature, relationTagList.ToArray());
}
}

if (osmSupportingElementFieldIndex > -1)
Expand Down
2 changes: 1 addition & 1 deletion src/OSMGeoProcessing/OSMToolHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4334,7 +4334,7 @@ internal bool IsThisWayALine(string osmID, IFeatureClass lineFeatureClass, strin
{
using (ComReleaser comReleaser = new ComReleaser())
{
osmIDQueryFilter.WhereClause = sqlPolyOSMID + " = " + currentRelationMember.@ref;
osmIDQueryFilter.WhereClause = polygonFeatureClass.WhereClauseByExtensionVersion(currentRelationMember.@ref, "OSMID", 2);

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

0 comments on commit 5f3840b

Please sign in to comment.