[GRASS-user] Help with reprojection

Hi,

I'm new to GRASS, and am having trouble with reprojection. I've spent
two days trying to figure this out, and I feel that I'm close, but
reprojection is still failing. Could anyone clue me in what I'm
missing?

The input data set is Natural Earth II map of the world
<http://www.nacis.org/data/NE2/NE2_WDB1.jpg&gt; 16200x8100 JPG in plate
carrée projection. I need to reproject it into Lambert azimuthal
equal-area projection centered on N0 E15. I'm using WinGRASS 6.3.0.

First, I've created GRASS location "geographic" with following region
and projection:

g.region -p

projection: 99 (Equidistant Cylindrical (Plate Caree))
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 8100
south: 0
west: 0
east: 16200
nsres: 1
ewres: 1
rows: 8100
cols: 16200
cells: 131220000

g.proj -p datumtrans=0

PROJ_INFO-------------------------------------------------
name : Equidistant Cylindrical (Plate Caree)
datum : wgs84
towgs84 : 0.000,0.000,0.000
proj : eqc
ellps : wgs84
a : 6378137.0000000000
es : 0.0066943800
f : 298.2572235630
lat_0 : 0.0000000000
lat_ts : 0.0000000000
lon_0 : 0.0000000000
-PROJ_UNITS------------------------------------------------
unit : meter
units : meters
meters : 1.0

I then imported the JPG map, which got split into color channels and
composed the channels together into single map.

After, I created a new location "lambert":

g.region -p

projection: 99 (Lambert Azimuthal Equal Area)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 8100
south: 0
west: 0
east: 16200
nsres: 1
ewres: 1
rows: 8100
cols: 16200
cells: 131220000

g.proj -p datumtrans=0

-PROJ_INFO-------------------------------------------------
name : Lambert Azimuthal Equal Area
datum : wgs84
towgs84 : 0.000,0.000,0.000
proj : laea
ellps : wgs84
a : 6378137.0000000000
es : 0.0066943800
f : 298.2572235630
lat_0 : 0.0000000000
lon_0 : 15.0000000000
x_0 : 0.0000000000
y_0 : 0.0000000000
-PROJ_UNITS------------------------------------------------
unit : meter
units : meters
meters : 1.0

Finally, when I try reprojection I get "Input raster map is outside
current region" error:

r.proj input=NE2 location=geographic mapset=PERMANENT method=cubic

Input Projection Parameters: +proj=eqc +lat_0=0.0000000000
+lat_ts=0.0000000000 +lon_0=0.0000000000 +a=6378137 +rf=298.257223563
+no_defs +towgs84=0.000,0.000,0.000
Input Unit Factor: 1
Output Projection Parameters: +proj=laea +lat_0=0.0000000000
+lon_0=15.0000000000 +x_0=0.0000000000 +y_0=0.0000000000 +a=6378137
+rf=298.257223563 +no_defs +towgs84=0.000,0.000,0.000
Output Unit Factor: 1
Input raster map is outside current region

How can I make this work?
Thanks,
Alex

2009/1/2 Alex Bernstein <pofig37@gmail.com>:

Hi,

Hello Alex!

I'm new to GRASS, and am having trouble with reprojection. I've spent
two days trying to figure this out, and I feel that I'm close, but
reprojection is still failing. Could anyone clue me in what I'm
missing?

I will try to give a bit of help here. I'm very limited by idiomatic issues.

The input data set is Natural Earth II map of the world
<http://www.nacis.org/data/NE2/NE2_WDB1.jpg&gt; 16200x8100 JPG in plate
carrée projection. I need to reproject it into Lambert azimuthal
equal-area projection centered on N0 E15. I'm using WinGRASS 6.3.0.

First, I've created GRASS location "geographic" with following region
and projection:

g.region -p

projection: 99 (Equidistant Cylindrical (Plate Caree))
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 8100
south: 0
west: 0
east: 16200
nsres: 1
ewres: 1
rows: 8100
cols: 16200
cells: 131220000

I think thath you have problems in projection and region definition.

You must check your region parameters. Geographic coordinates must be
in the following ranges:

north, south: [-90, 90]
west, east: [-180, 180]

Fix your region with something like:

g.region -p n=90 s=90 w=-180 e=180

But ... There is another problem. Your "Location" was created badly.

A "Location" in geographic coordinates, must :

g.region-p

projection: 3 (Latitude-Longitude)
....

(I don't know which projection is "projection: 99 ...". If someone
knows, please, tell me.)

You must begin again. Start "grass", and click "EPSG Codes". In the
next window, enter the code 4326, which is the correct value to use
geographical coordinates. Import your JPG image in this location.
(see images attached)

g.proj -p datumtrans=0

PROJ_INFO-------------------------------------------------
name : Equidistant Cylindrical (Plate Caree)
datum : wgs84
towgs84 : 0.000,0.000,0.000
proj : eqc
ellps : wgs84
a : 6378137.0000000000
es : 0.0066943800
f : 298.2572235630
lat_0 : 0.0000000000
lat_ts : 0.0000000000
lon_0 : 0.0000000000
-PROJ_UNITS------------------------------------------------
unit : meter
units : meters
meters : 1.0

I then imported the JPG map, which got split into color channels and
composed the channels together into single map.

After, I created a new location "lambert":

g.region -p

projection: 99 (Lambert Azimuthal Equal Area)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 8100
south: 0
west: 0
east: 16200
nsres: 1
ewres: 1
rows: 8100
cols: 16200
cells: 131220000

g.proj -p datumtrans=0

-PROJ_INFO-------------------------------------------------
name : Lambert Azimuthal Equal Area
datum : wgs84
towgs84 : 0.000,0.000,0.000
proj : laea
ellps : wgs84
a : 6378137.0000000000
es : 0.0066943800
f : 298.2572235630
lat_0 : 0.0000000000
lon_0 : 15.0000000000
x_0 : 0.0000000000
y_0 : 0.0000000000
-PROJ_UNITS------------------------------------------------
unit : meter
units : meters
meters : 1.0

Finally, when I try reprojection I get "Input raster map is outside
current region" error:

r.proj input=NE2 location=geographic mapset=PERMANENT method=cubic

Input Projection Parameters: +proj=eqc +lat_0=0.0000000000
+lat_ts=0.0000000000 +lon_0=0.0000000000 +a=6378137 +rf=298.257223563
+no_defs +towgs84=0.000,0.000,0.000
Input Unit Factor: 1
Output Projection Parameters: +proj=laea +lat_0=0.0000000000
+lon_0=15.0000000000 +x_0=0.0000000000 +y_0=0.0000000000 +a=6378137
+rf=298.257223563 +no_defs +towgs84=0.000,0.000,0.000
Output Unit Factor: 1
Input raster map is outside current region

How can I make this work?
Thanks,
Alex

If this helps you, maybe i can try to give a bit more of help.

Saludos
José María

(attachments)

new_location_from_epsg_code_2.png
new_location_from_epsg_code_2.png

On 02/01/09 20:04, Alex Bernstein wrote:

Finally, when I try reprojection I get "Input raster map is outside
current region" error:

Use v.in.region and v.proj first. See the Notes section in the manual page of r.proj.

Moritz