Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I built an IPointCollection and can display it, but I would like to display multiple copies in different locations. Is there a way to center a point collection on another IPoint?

share|improve this question
up vote 3 down vote accepted

Would ITransform2D (or 3D) work for you?

You can use whatever point you wanted to in the original point collection (centroid, endpoints, midpoints) and calculate the dx and dy needed to move. Or just construct an line from the two points and use MoveVector.

share|improve this answer
+1 this is the way to go. – George Jul 23 '11 at 16:30

You're gonna have to modify the coordinates of each point.
You can write a method that accepts an IPointCollection, an IPoint and produces a shifted IPointCollection which would be the original IPointCollection but with all the coordinates shifted.
Doing this in a separate method is important to avoid accidentally modifying the original IPointCollection.
The tricky part is how to shift the points. You can assume that you'll make the first point in the IPointCollection be the IPoint passed to the method and apply the same shift to all the other points.
There are other options, like assuming that the input IPoint would be the new center of the IPointCollection. Do this by calculating the centroid of the IPointCollection and calculating the shift between it and the input IPoint then applying this shift to all the other points.

share|improve this answer

Your Answer


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.