[GRASS-dev] v.transform, wishlist #420

Hamish hamish_nospam at yahoo.com
Tue Jun 12 00:37:34 EDT 2007


Harri Kiiskinen wrote:
> I looked into the matter somewhat deeper, and it turns out not
> to be as simple as just putting in G_scan_*()-functions. These
> functions delegate the work to ll_scan(), through G_lat_scan()
> and G_long_scan(), and ll_scan() normalizes its resulting arguments
> to the ranges [-180,180] and [-90,90]. The result is, that the
> coordinates can be given to these functions only if it is supposed
> to be lat/long-coordinate.


lib/gis/wind_scan.c

int G_scan_northing ( const char *buf, double *northing, int projection)
{
    if (projection == PROJECTION_LL)
    {
        if(G_lat_scan (buf, northing))
            return 1;
        if (!scan_double (buf, northing))
            return 0;
        return (*northing <= 90.0 && *northing >= -90.0);
    }

    return scan_double (buf, northing);
}


it only calls G_lat_scan() if the location's projection is lat/lon.
No need for any extra checks.


> In the long run, I'd like to further modify this module so, that the
> resulting vector could be placed in a different location/mapset, so it
> could be used to transform vector files from a location based on a
> local coordinate system to another, 'global' system. 

could the derived transform parms be used as the +towgs84 7-term
projection in the new location, then v.proj?


Hamish




More information about the grass-dev mailing list