Free Support Forum -

Read SHP file of type LineString and compare distance to coordinates - does it use haversine? how to reproject?

Good day,

I simply want to get the closest point to a linestring shapefile feature. Does the getdistanceto calculate via haversine?
also, i think this isnt coming up with accurate numbers since its not reprojected, how do i do that?

        using (var layer = Drivers.Shapefile.OpenLayer("ShapeFiles\\UScoast_Merge_MultipartToSin.shp"))
            int count = layer.Count;
            for (int j = 0; j < count; j++)
                polygon1 = layer[j].Geometry as Aspose.Gis.Geometries.LineString;
                double distance = polygon1.GetDistanceTo(new Aspose.Gis.Geometries.Point(32.33, -64.84));


Hi, @bermuda1023

Thank you for your interest in the Aspose.GIS product. Could you please share the file. And we will try to help you more. We do not use haversine.

Best regards