public static void GetEdgeNodes(TabHandle feature, int part, out double startLongX, out double startLatY, out double endLongX, out double endLatY) { int vCount = Mitab.mitab_c_get_vertex_count(feature, part); startLongX = (double)Mitab.mitab_c_get_vertex_x(feature, part, 0); startLatY = (double)Mitab.mitab_c_get_vertex_y(feature, part, 0); endLongX = (double)Mitab.mitab_c_get_vertex_x(feature, part, vCount - 1); endLatY = (double)Mitab.mitab_c_get_vertex_y(feature, part, vCount - 1); }
public static double[][] GetCoordsD(TabHandle feature, int part) { int vCount = Mitab.mitab_c_get_vertex_count(feature, part); double[][] result = new double[vCount][]; for (int k = 0; k < vCount; k++) { double x = (double)Mitab.mitab_c_get_vertex_x(feature, part, k); double y = (double)Mitab.mitab_c_get_vertex_y(feature, part, k); result[k] = new double[2] { x, y }; } return(result); }
public static float[][] GetCoordsF(TabHandle feature, int part) { int vCount = Mitab.mitab_c_get_vertex_count(feature, part); float[][] result = new float[vCount][]; for (int k = 0; k < vCount; k++) { float x = (float)Mitab.mitab_c_get_vertex_x(feature, part, k); float y = (float)Mitab.mitab_c_get_vertex_y(feature, part, k); result[k] = new float[2] { x, y }; } return(result); }
public static void GetCurrentCentroid(TabHandle feature, int part, out double cx, out double cy) { double x = 0, y = 0; cx = 0; cy = 0; int c = Mitab.mitab_c_get_vertex_count(feature, part); cx = Mitab.mitab_c_get_vertex_x(feature, part, 0); cy = Mitab.mitab_c_get_vertex_y(feature, part, 0); for (int k = 1; k < c; k++) { x = Mitab.mitab_c_get_vertex_x(feature, part, k); y = Mitab.mitab_c_get_vertex_y(feature, part, k); cx = (cx + x) / 2; cy = (cy + y) / 2; } }