[GRASS-user] Invalid region and coordinates when trying to reproject.
Marcello Gorini
gorini at gmail.com
Sun Jul 1 23:57:59 PDT 2012
Thanks for the suggestions.
Markus:
> Please post
> g.proj -p
-PROJ_INFO--------------------
-----------------------------
name : Mercator
proj : merc
datum : wgs84
ellps : wgs84
lon_0 : 0
k : 1
x_0 : 0
y_0 : 0
no_defs : defined
-PROJ_UNITS------------------------------------------------
unit : metre
units : metres
meters : 1
Doesn't seem to have a problem, does it?
Now I looked at the revised wiki (thanks Hamish) and followed it entirely.
It worked. I guess either I hadn't followed everything the last time or
this r.region part was
really needed.
OK, but I have another problem.
When I first imported the data to the latlog location, besides being
flipped, it appeared stretched in the N-S direction.
When I fixed it with region w=-180 e=180, everything fell back to its
correct place and it was fine, with no more stretching.
Now, when I reprojected it, it is stretched again.
Doing g.region in my latlong location, I get a resolution of 5 minutes with
rows=2159 cols=4321.
When I r.proj -g in the mercator location, following Hamish suggestion, I
get
Input Projection Parameters: +proj=longlat +no_defs +a=6378137
+rf=298.257223563 +towgs84=0.000,0.000,0.000
Input Unit Factor: 1
Output Projection Parameters: +proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0
+no_defs +a=6378137 +rf=298.257223563 +towgs84=0.000,0.000,0.000
Output Unit Factor: 1
Input map <rbd at ATLANTIC> in location <GEBCO_GEODETIC>:
n=46050366.66617828 s=-46050366.66617872 w=-20028233.86541469
e=20028233.86541469 rows=2159 cols=4321
But when I apply the n-s w-e it suggests and r.proj again:
Input:
Cols: 4321 (4321)
Rows: 2159 (2159)
North: 89.916705 (89.916705)
South: -89.916705 (-89.916705)
West: -179.916686 (-179.916686)
East: 179.916686 (179.916686)
EW-res: 0.083275
NS-res: 0.083295
Output:
Cols: 4321 (4321)
Rows: 2159 (2159)
North: 46050366.666178 (46050366.666178)
South: -46050366.666179 (-46050366.666179)
West: -20028233.865415 (-20028233.865415)
East: 20028233.865415 (20028233.865415)
EW-res: 9270.184617
NS-res: 42658.977921
You see? It stretched the NS-res. Is it me or the data? (probably me, of
course).
Thanks again,
Marcello.
On Mon, Jul 2, 2012 at 2:47 AM, Hamish <hamish_b at yahoo.com> wrote:
> Markus:
> > ...
> > > |
> > Projection: x,y
> >
> > ... this looks suspicious! Above output may help us to find
> > the problem.
>
> probably he was following my tutorial at
> http://grass.osgeo.org/wiki/Global_datasets#ETOPO1_.28DEM.29
>
> which uses a nasty hack to get around the original grid-registered
> data exceeding the limits of polar coordinate space:
> r.in.bin -f in=etopo1_bed_g.flt out=etopo1_bed_g \
> n=90.008333333335 s=-90.008333333335 e=180.00833333334 \
> w=-180.00833333334 rows=10801 cols=21601 anull=-9999
>
> but the cellhd/ file was not reset in sync with the location.
>
> I have now rewriten that wiki entry to use a r.region cleanup
> method instead of ugly filesystem edits.
>
>
> Hamish
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20120702/03e47fff/attachment-0001.html>
More information about the grass-user
mailing list