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

Brian Oney zenlines at gmail.com
Tue Nov 1 10:45:58 EDT 2011


One would think the -l flag would do what it is supposed to, but this 
then squeezes the raster into a sliver. I get the warning...

May I ask why?:
...
         if (cellhd.east > 360.) cellhd.east = 180.;
...
Why not?
...
         if (cellhd.east > 180.) cellhd.east = 180.;
...

Also, is the 3d raster stuff necessary?



A further problem appears, when trying to "reset" the raster, which has 
an e-w resolution of 0 to have a global extent with a corresponding 
resolution. Maybe the r.region needs a funny something like:

         if (e-w_resol == 0.) e-w_resol= 0.000000001; /* or something 
like that */

Thanks for all the info!

Cheers,
Brian




On 11/01/2011 02:46 PM, Markus Neteler wrote:
> 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?
>
> Markus


More information about the grass-user mailing list