I am using MapSuite Desktop Edition 5.0. I have a multiline shapefile that is UTM. I have set the MapUnit to Meter.
When I invoke the GetLineOnALine(StartingPoint.LastPoint,percentage) I get the correct returned result.
If I invoke GetLineOnALine(StartingPoint.LastPoint,<pointshape>), the result starts from the end of the line correctly, but once the <pointshape> is reached, it adds coordinates to the returned line that are NOT part of the original.
I get the same results if I invoke the function passing two point shapes, one being the end point of the original line.
This issue appears sporatically at the beginning of the line, but always occurs at the end of the line.
This did not appear to be an issue prior to 4.5.168. Is this a new bug?
When I entered the previous message, the upload did not display the quote properly - GetLineOnALine(StartingPoint.LastPoint,pointshape) and GetLineOnALine(endpointshape,pointshape)
I do not have a small sample to upload. This was working prior to 4.5.168. Passing in a percentage works as before, but passing in a coordinate does not. It is like the function does not recognize the coordinate. I have tried passing in the endpoint and my pointshape, and also passing in the pointshape and the endpoint, both of which result in the same incorrect returned result.
I have been unable to trace where the extra coordinates come from, as there is no line in the file with these coordinates.
Your situation is possible, because when you pass in a percentage, it’s easy to return the line, but if you pass in a coordinate, we need considered if this point is in the line’s extension cords, if so, we will scale up the line to get the real position of the point and return the result.
But if without your data or sample, that mean we need use the data we had to tested it, and I’m not sure we can recreate the problem you meet.
Any more questions please feel free to let me know.
I have verified through ArcMap that the pointshape is in fact falls along the line. It is not possible at present to cut out just that area for you to test with. I suggest you get a point on a line, and then try the function. It should fail as mine did.
Additionally I found that passing in two coordinates that are definitely on the line, can also result in a line that does not pass the SimpleValidation. It would appear that the GetALineOnALine for a MultilineShape does not work at all when passed a coordinate, whether with the StartPoint and a coordinate or with two coordinates.
This is a critical function in my program and it is a real issue that it was working prior to 4.5.168 and it is no longer working. Also there was NO documentation in the change log/bug fixes that the logic for this function had been changed, other than to state that “Fixed a bug that the GetLineOnLine method doesn’t work correctly for some cases”. Should the change log not list of all functions where the logic has changed from the previous version so that users can check that their programs that depend on any of these function still work as expected?
visitA is a PointShape, visitB is a PointShape, lineshape2 is a MultilineShape, and visitA and visitB are along lineshape2. The fact that the points are on the lineshape2 has been verified in ArcMap. MapUnit is Meter.
The following code results in an line that does not pass SimpleValidation: MultilineShape newshape1 = (MultilineShape)lineshape2.GetLineOnALine(visitA, visitB);
The following code results in a line that starts at the end of lineshape2, goes to visitB, and then adds additional coordinates to the line that are not part of lineshape2: MultilineShape newshape1 = (MultilineShape)lineshape2.GetLineOnALine(StartingPoint.LastPoint,visitB);
The following code results in a line that starts at the start of lineshape2, goes to visitA, and then adds additional coordinates to the line that are not part of lineshape2: MultilineShape newshape1 =(MultilineShape)lineshape2.GetLineOnALine(StartingPoint.FirstPoint,visitA);
If I use GetLineOnALine passing in a distance or percentage, all works as expected.
Thanks for you post and clarification. I have tested the situation you mentioned: 1. NO, I can get the right line. 2. Yes, Looks like there is a problem to calculate the distance. I have reported to our product team and will let you know what they find. 3. NO, I can get the right line.
Thanks, and I will let you know as soon as we find the root cause. Please subscribe this post.
Thanks for your data, with these data, some problem have appeared, we are working on it but need some time to verify it, we will let you know as soon as possible.
Any more questions please feel free to let me know.
I’ve been experiencing this problem with the WPF Desktop Edition 5.0.83.0 also, specifically this part quoted below from Elisa:
Additionally I found that passing in two coordinates that are definitely on the line, can also result in a line that does not pass the SimpleValidation. It would appear that the GetALineOnALine for a MultilineShape does not work at all when passed a coordinate, whether with the StartPoint and a coordinate or with two coordinates.
Could you check if this fix has been applied to the WPF Desktop Edition?