This project is read-only.

Add new vertice ?

May 10, 2014 at 3:34 PM
Edited May 10, 2014 at 3:35 PM

I'm searching how can I create a new vertex on a polyline after user select the location of this vertex. I guess I may use some Pythagore's function but is there a more simple way to do that using Mapwingis functions ?

I looked at .distance, but if I find the minimal distance between datapoint and shape, I don't know immediately if the shape that will have the new vertex is on the right, left, above, under user's datapoint.

I considered .GetIntersection, building a small line corresponding to the user datapoint and applying it to a shape found, but does this method return the point of intersection as a type Point shape ?

From another point of view, how can I get the segment the shape to be cut, that's to say the segment between the two vertices closest to the user's datapoint?

Hope I'm clear enough,

Thanks for any help,

May 10, 2014 at 5:27 PM
Here is what I would do if no better idea :
  • Calcule distance between user point and a each line shapes created from each couple of vertex (0-1, 1-2, 2-3...) of the given shape
  • minimal distance found return memorized start and end vertices of the segment to cut,
  • calculate XY of the new vertex on this segment using either start or end XY and distance, according to the fact that minimal distance is the perpendicular height of a Pythagore triangle.
Hoping I didn't write stupid idea that would last here for years, any remarks will be appreciated !
Dec 5, 2014 at 7:49 AM
Dec 5, 2014 at 8:17 AM
Hi Paul,

Thanks, looks like part of my work will be useless or would have been quicker with this nice new version !

I planned to go on 4.9 but so far, it's difficult to switch because it requires two differents computers to mainain bth version at least a few weeks.

Dec 8, 2014 at 7:26 AM
Hi Olivier,

One of or users suggested to add a manifest file to the C# application with the location of the ocx. Then it would not be needed to register the application and thus (in theory) you can have multiple versions of MapWinGIS on the same computers.
I must say I have not yet looked into this. I'll try to do so within 2 weeks.

Here's some more info: