public static double PtDistance(ref MapWinGIS.Point pt0, ref MapWinGIS.Point pt1)
public static double PtDistance(MapWinGIS.Point pt0, MapWinGIS.Point pt1)
I don't see any way to call either function in VB.NET. The compiler just won't allow it.
Thats a curious one, they should be exactly the same, I can't see why it would even let it compile with both in Global.cs.
In any case they are both identical methods internally. I'll take one out and send in the changes but it will take a while to get released. In the mean time you can just use the code directly, its only 4 lines.
I did write my own distance calculation, although for a different reason. It turns out that working with a very large number of MapWinGIS.Point objects can be horrendously slow. Pulling out the X and Y coords from all points, putting them into an array and working only with the array in my case was about 3 orders of magnitude faster (1000x) compared to working with the shapefile points themselves. Probably the .NET/COM overhead for shapefiles - or maybe shapefiles are just slow, relatively speaking.
The COM overhead is most likely the main reason why it is so slow.
You could use a custom struct/class to hold the coordinates and use that instead of MapWinGIS.Point.
That will speed things up.
Sergei is also working on something in the OCX to overcome this issue, because we see the same slowness when reprojecting points.
I don't know when he will finish that.
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group
Download the latest beta installer at:
Follow me on Twitter MapWindow_nl to read when a new installer is published.
Release manager, configuration manager and
forum moderator of MapWindow GIS
Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
View my profile on LinkedIn