/* **************************************************************************** * * MODULE: v.transform * AUTHOR(S): See other files as well... * Eric G. Miller * PURPOSE: To transform a vector layer's coordinates via a set of tie * points. * COPYRIGHT: (C) 2002 by the GRASS Development Team * * This program is free software under the GNU General Public * License (>=v2). Read the file COPYING that comes with GRASS * for details. * *****************************************************************************/ /* * Functions in this file: * setup_transform ( n_points) * returns: ALL_OK, POINTS_NOT_SPREAD, NEED_MORE_POINTS * init_transform_arrays() * print_transform_error(stat) * * Written by the GRASS Team, 02/16/90, -mh . */ #include #include #include #include #include "trans.h" int setup_transform (int n_points) { int status ; /* compute_transformation_coef() returns: * -2, Not enough points * 1, everything is okay * -1, points weren't spread out enough */ /* if there are enough points registered compute residuals */ if(n_points >= MIN_COOR) status = compute_transformation_coef (ax, ay, bx, by, use, MAX_COOR) ; else return(NEED_MORE_POINTS) ; if(status != ALL_OK) return(POINTS_NOT_SPREAD) ; residuals_a_predicts_b (ax, ay, bx, by, use, MAX_COOR, residuals, &rms) ; return (ALL_OK) ; } /* setup_transform() */ int init_transform_arrays (void) { int i ; /* initiliaze use[], no points valid */ for (i=0 ; i