Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

i want to create a ArcEngine function using .net that allow to do the same thing like (see picture): enter image description here

  • select 2 polygons
  • click merge

Is there somebody who can help please!! Sincerely

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

hello i found the the answer by self :

Private Sub mergeFeatures()

Dim mergee As IFeature 'first ifeature
Dim merger As IFeature 'second ifeature

mergee = featureLayerParcelle.FeatureClass.GetFeature(8) 'get the ifeature that has objectid=8
merger = featureLayerParcelle.FeatureClass.GetFeature(9) 'get the ifeature that has objectid=9
Dim union As ITopologicalOperator = CType(mergee.Shape, ITopologicalOperator) 'itopological variable
StarEditLayer(featureLayerParcelle) ' start editing
mergee.Shape = union.Union(merger.Shape) ' the first ifeature set it geometry with the union of the tow features
merger.Delete() ' delete second ifeature
mergee.Store() 'save 
pEditor.StopEditing(True) 'stop editing and save 
AxMapControl1.CurrentTool = Nothing

End Sub

so you can personalize it : get object id when we clique and start fusion

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.