[GRASS-user] some questions on r.tile

Hi,

I have a doubt about the use of r.tile with overlap. r.tile without overlap works without problem, however when I set an overlap, no matter how large (have tried 400, 40 and 4 with same outcome) it gives me the error:

ERROR: Illegal latitude for North

How should I calculate my overlap and my tiles in order to avoid this problem?

Furthermore, is there a way to set a different rule for rows and columns? say I want to generate vertical stripes that overlap each other for a certain number of columns?

Thanks for any hints

···

Margherita Di Leo

Hi

On Aug 10, 2016 4:34 PM, “Margherita Di Leo” <diregola@gmail.com> wrote:

Hi,

I have a doubt about the use of r.tile with overlap. r.tile without overlap works without problem, however when I set an overlap, no matter how large (have tried 400, 40 and 4 with same outcome) it gives me the error:

ERROR: Illegal latitude for North

Which projection are you using?
I suspect latlong?

How should I calculate my overlap and my tiles in order to avoid this problem?

Please let us know more… Perhaps also the command with parameters.

Furthermore, is there a way to set a different rule for rows and columns? say I want to generate vertical stripes that overlap each other for a certain number of columns?

This will require a source code enhancement.

Markus

Thanks for any hints


Margherita Di Leo


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Ciao Markus! Thanks for your answer,

···

On Wed, Aug 10, 2016 at 8:00 PM, Markus Neteler <neteler@osgeo.org> wrote:

Hi

On Aug 10, 2016 4:34 PM, “Margherita Di Leo” <diregola@gmail.com> wrote:

ERROR: Illegal latitude for North

Which projection are you using?
I suspect latlong?

yes, correct.

How should I calculate my overlap and my tiles in order to avoid this problem?

Please let us know more… Perhaps also the command with parameters.

The data source I’m using is GMTED 2010 at 30 arc second spatial resolution, global coverage → created VRT → linked via r.external → set g.region rast=

g.region rast=bln300_mosaic -ap
projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 89:59:59.5N
south: 70:00:00.5S
west: 179:59:59.5E
east: 179:59:59.5E
nsres: 0:00:30
ewres: 0:00:30
rows: 19200
cols: 43200
cells: 829440000

I wanted to try create 6 large tiles as a first tentative, to see how r.tile works.

Then i calculate them like this:

rows: 19200 / 2 = 9600

cols: 43200 / 3 = 14400

r.tile input=bln300_mosaic output=tiled width=14400 height=9600 overlap=4 --v
ERROR: Illegal latitude for North

hm…

Margherita Di Leo

Hi Margherita,

On Thu, Aug 11, 2016 at 10:09 AM, Margherita Di Leo <diregola@gmail.com> wrote:

Ciao Markus! Thanks for your answer,
On Wed, Aug 10, 2016 at 8:00 PM, Markus Neteler <neteler@osgeo.org> wrote:

Which projection are you using?
I suspect latlong?

yes, correct.

...

r.tile input=bln300_mosaic output=tiled width=14400 height=9600 overlap=4 --v
ERROR: Illegal latitude for North

I guess that the distance value must be given in degree when in
LatLong since I cannot see any geodesic support in r.tile (it does
exist e.g. in r.grow.distance). Internally it calculates with the
coordinates.

Probably r.tile is not yet suitable for LatLong?

Test case:

g.region res=1 n=90 s=-90 w=-180 e=180 -p
r.mapcalc "myarea = 1"
r.tile input=myarea output=tiled width=14400 height=9600 overlap=4
ERROR: Illegal latitude for North

Please open a ticket for this.

Markus

In the meantime you could try the following as a workaround:

Create a grid (v.mkgrid) for your tiles,
then loop over the tiles and set the region to your tile plus / minus the overlap you like to have at the boundaries after checking that current boundary does not exceed north or south limits.

It seems that g.region does not wrap latitudinal boundaries in the north, while it does for longitudinal limits and rounds latitudinal boundaries in the south.

Compare output from:
g.region -p n=90 s=-90 w=-180 e=180

g.region -p n=n+1 s=s-1 w=w-1 e=e+1

g.region -p n=n s=s-1 w=w-1 e=e+1

in a lat/lon location.

Cheers
Stefan