[GRASS-user] Re: GRASS-user] Help with reprojection
Michael Barton
michael.barton at asu.edu
Fri Jan 2 19:35:23 EST 2009
On Jan 2, 2009, at 4:38 PM, <grass-user-request at lists.osgeo.org> wrote:
> Message: 2
> Date: Fri, 2 Jan 2009 21:04:44 +0200
> From: "Alex Bernstein" <pofig37 at gmail.com>
> Subject: [GRASS-user] Help with reprojection
> To: grass-user at lists.osgeo.org
> Message-ID:
> <bf69017a0901021104n29f77efal2206f53128b08435 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> 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> 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?
Your problem is that this map is an image, not a GIS map. It is in
what is called an xy "projection" in GRASS. That is, it is in no
projection at all. The coordinates of each cell are simply the xy
coordinates from the corner, not their position in the world.
In a 'real' GIS map, each cell would have some kind of real-world
geographic coordinates (latlon, UTM, etc).
To get from a graphic image like this to geospatial data, you need to
georectify the map. It would be a good idea for you to get an intro
GIS book so that you can understand what is going on with this if it
is unfamiliar to you.
The steps you need to follow in GRASS are...
1) create an xy location
2) import your jpg map into the xy location
3) open GRASS in your Lambert location
4) start the georectifier and georectify the map from the xy to
Lambert location.
Looking at the jpg, it has no latlon or other geographic markers. This
will make it difficult to georectify accurately. If you are looking
for nice geospatial data of world topography, it might be better for
you to download some data rather than trying to georectify a jpg
image. GTOPO30 or similar scale (1km or larger) topography can be
downloaded from a variety of places. Check the GRASS site to links to
geospatial data. Also check out the GLCF <http://glcf.umiacs.umd.edu/
>. For global-scale imagery, try MODIS satellite data. The good thing
about these data sets is that they are already georectified and can be
imported directly into GRASS as GIS data. You can then easily
reproject to something else.
Michael
More information about the grass-user
mailing list