[GRASS-user] Re: r.in.gdal oddity

Markus Neteler neteler at osgeo.org
Tue Nov 1 09:46:33 EDT 2011

On Mon, Oct 31, 2011 at 9:25 PM, Brian Oney <zenlines at gmail.com> wrote:
> Yes, everything works great. Thanks again.
> Ok, good to know. Yeah, the algorithm could be improved I guess. But, the
> improvement that I would suggest is supposed to be the -l flag, right?

Yes, that was the idea of the -l flag.

> Just force it to be 180W and 180E... I thought (the -l flag) it is just a recent
> addition to GRASS 6.4, so maybe it needs a some t.l.c...

I run into the same problem recently (see my other posting) and didn't
manage to import with -l. Using

 gdal_translate -a_ullr -180 90 180 -60 inmap outmap

is a solution but it would be better to get -l working (since it should do
the same). The code piece is

    /* constrain to geographic coords */
    if (flag_l->answer && G_projection() == PROJECTION_LL) {
        if (cellhd.north > 90.) cellhd.north = 90.;
        if (cellhd.south < -90.) cellhd.south = -90.;
        if (cellhd.east > 360.) cellhd.east = 180.;
        if (cellhd.west < -180.) cellhd.west = -180.;
        cellhd.ns_res = (cellhd.north - cellhd.south) / cellhd.rows;
        cellhd.ew_res = (cellhd.east - cellhd.west) / cellhd.cols;
        cellhd.ew_res3 = cellhd.ew_res;
        cellhd.ns_res3 = cellhd.ns_res;

        G_warning(_("Map bounds have been constrained to geographic "
            "coordinates. You will almost certainly want to check "
            "map bounds and resolution with r.info and reset them "
            "with r.region before going any further."));

... the warning is not particularly clear to me - "reset them" in this sense?


More information about the grass-user mailing list