>
> Message: 4
> Date: Sat, 3 Jan 2009 13:25:31 -0800 (PST)
> From: Hamish [<hamish_b@yahoo.com>](mailto:hamish_b@yahoo.com)
> Subject: Re: [GRASS-user] Re: GRASS-user] Help with reprojection
> To: [grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
> Message-ID: [<62626.56685.qm@web110014.mail.gq1.yahoo.com>](mailto:62626.56685.qm@web110014.mail.gq1.yahoo.com)
> Content-Type: text/plain; charset=us-ascii
>
> Hamish wrote:
>
>> > - create a simple xy location
>> > (lat/lon location will not allow north > 90, and your image while
>> > still not geo-referenced will go to 8100)
>> > - run r.region to set n,s,e,w bounds to 90,-90,180,-180
>> > - run g.setproj to rejig the location into a lat/lon one.
>>
>
> umm, that might not work -- r.info will still know the map is XY even
> if the location is changed to lat/lon.
>
>
>> > - check resolution is correct (nicely "0:01:20") with r.info.
>> > - zoom to area of interest. you probably do not want to reproject
>> > entire planet. after zooming check resolution is preserved,
>> > (g.region -p, maybe with "g.region res=0:01:20 -a" after zoom to fix)
>> > and run "r.mapcalc cropmap=fullmap" to perform the crop.
>> >
>> > then from the lambert location run r.proj to pull the
>> > cropped image across.
>> >
>> > there are some examples of this process in the GRASS wiki,
>> > look at the "Global datasets" page.
>>
>
> the above issue should be covered there; also check the mailing list
> archives.
>
> so your "easiest" solution is to create a "world file". see the GDAL
> JPG or GeoTiff format import page, or do a web search for instructions.
>
>
> Hamish
>
Hamish,
Grass-6.3.0 under Mac doesn't seem to be checking for the world file.
My test:
1) Export a raster using r.out.tiff with the "create world file" box checked
2) Check the output folder:
test.tiff
test.tfw
3) Import using r.in.gdal:
r.in.gdal input=test.tiff output=test_2
In mine, this produces a projection mismatch error - which seems to tell me that Grass isn't noticing the tfw file.
Richard
On Mon, Jan 5, 2009 at 6:37 AM, rchirgwin@ozemail.com.au
<rchirgwin@ozemail.com.au> wrote:
Date: Sat, 3 Jan 2009 13:25:31 -0800 (PST)
From: Hamish <hamish_b@yahoo.com>
Hamish wrote:
> - create a simple xy location
> (lat/lon location will not allow north > 90, and your image while
> still not geo-referenced will go to 8100)
> - run r.region to set n,s,e,w bounds to 90,-90,180,-180
> - run g.setproj to rejig the location into a lat/lon one.
umm, that might not work -- r.info will still know the map is XY even
if the location is changed to lat/lon.
> - check resolution is correct (nicely "0:01:20") with r.info.
> - zoom to area of interest. you probably do not want to reproject
> entire planet. after zooming check resolution is preserved,
> (g.region -p, maybe with "g.region res=0:01:20 -a" after zoom to fix)
> and run "r.mapcalc cropmap=fullmap" to perform the crop.
>
> then from the lambert location run r.proj to pull the
> cropped image across.
>
> there are some examples of this process in the GRASS wiki,
> look at the "Global datasets" page.
the above issue should be covered there; also check the mailing list
archives.
so your "easiest" solution is to create a "world file". see the GDAL
JPG or GeoTiff format import page, or do a web search for instructions.
Grass-6.3.0 under Mac doesn't seem to be checking for the world file.
My test:
1) Export a raster using r.out.tiff with the "create world file" box checked
2) Check the output folder:
test.tiff
test.tfw
3) Import using r.in.gdal:
r.in.gdal input=test.tiff output=test_2
In mine, this produces a projection mismatch error - which seems to tell me
that Grass isn't noticing the tfw file.
We would need more details to better understand the problem.
What does gdalinfo report on the file? (GRASS calls GDAL to read
the files).
Markus
Thanks everyone for trying to help. A few hours ago, I've finally
accomplished what I needed by using gdalwarp directly. I had some
trouble with it as well, because it couldn't handle the reprojection
of a global image. But once I limited it to the region of interest, it
worked,
Thanks again,
--Alex
On Mon, Jan 5, 2009 at 11:11 AM, Alex Bernstein <pofig37@gmail.com> wrote:
Thanks everyone for trying to help. A few hours ago, I've finally
accomplished what I needed by using gdalwarp directly. I had some
trouble with it as well, because it couldn't handle the reprojection
of a global image.
There is a ticket open for that:
http://trac.osgeo.org/gdal/ticket/2305
To communicate interest, please add yourself in CC to the ticket.
But once I limited it to the region of interest, it worked,
Good to know.
Independently, import and reprojection (r.proj which differs from gdalwarp)
should work.
Markus
Markus Neteler wrote:
On Mon, Jan 5, 2009 at 6:37 AM, rchirgwin@ozemail.com.au
<rchirgwin@ozemail.com.au> wrote:
Date: Sat, 3 Jan 2009 13:25:31 -0800 (PST)
From: Hamish <hamish_b@yahoo.com>
Hamish wrote:
- create a simple xy location
(lat/lon location will not allow north > 90, and your image while
still not geo-referenced will go to 8100)
- run r.region to set n,s,e,w bounds to 90,-90,180,-180
- run g.setproj to rejig the location into a lat/lon one.
umm, that might not work -- r.info will still know the map is XY even
if the location is changed to lat/lon.
- check resolution is correct (nicely "0:01:20") with r.info.
- zoom to area of interest. you probably do not want to reproject
entire planet. after zooming check resolution is preserved,
(g.region -p, maybe with "g.region res=0:01:20 -a" after zoom to fix)
and run "r.mapcalc cropmap=fullmap" to perform the crop.
then from the lambert location run r.proj to pull the
cropped image across.
there are some examples of this process in the GRASS wiki,
look at the "Global datasets" page.
the above issue should be covered there; also check the mailing list
archives.
so your "easiest" solution is to create a "world file". see the GDAL
JPG or GeoTiff format import page, or do a web search for instructions.
Grass-6.3.0 under Mac doesn't seem to be checking for the world file.
My test:
1) Export a raster using r.out.tiff with the "create world file" box checked
2) Check the output folder:
test.tiff
test.tfw
3) Import using r.in.gdal:
r.in.gdal input=test.tiff output=test_2
In mine, this produces a projection mismatch error - which seems to tell me
that Grass isn't noticing the tfw file.
We would need more details to better understand the problem.
What does gdalinfo report on the file? (GRASS calls GDAL to read
the files).
Markus
Markus,
Here's a sample gdalinfo output:
Driver: GTiff/GeoTIFF
Files: Tiff_Test.tif
Size is 4838, 3781
Coordinate System is `'
Origin = (150.345869440000001,-33.599355220000000)
Pixel Size = (0.000002780000000,-0.000002780000000)
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 150.3458694, -33.5993552)
Lower Left ( 150.3458694, -33.6098664)
Upper Right ( 150.3593191, -33.5993552)
Lower Right ( 150.3593191, -33.6098664)
Center ( 150.3525943, -33.6046108)
Band 1 Block=4838x1 Type=Byte, ColorInterp=Red
Band 2 Block=4838x1 Type=Byte, ColorInterp=Green
Band 3 Block=4838x1 Type=Byte, ColorInterp=Blue
The world file:
0.000002780000000
0.000000000000000
0.000000000000000
-0.000002780000000
150.345870829999996
-33.599356610000001
This file and the world file are the only items in the folder, and were
created by r.out.tiff from a raster in a working location.
ERROR: Projection of dataset does not appear to match current location.
Location PROJ_INFO is:
name: Lat/Lon
proj: ll
datum: wgs84
ellps: wgs84
no_defs: defined
Import dataset PROJ_INFO is:
cellhd.proj = 0 (unreferenced/unknown)
Cheers,
Richard
Richard,
On Mon, Jan 5, 2009 at 8:55 PM, Richard Chirgwin
<rchirgwin@ozemail.com.au> wrote:
...
Grass-6.3.0 under Mac doesn't seem to be checking for the world file.
It does - see below:
My test:
1) Export a raster using r.out.tiff with the "create world file" box checked
2) Check the output folder:
test.tiff
test.tfw
3) Import using r.in.gdal:
r.in.gdal input=test.tiff output=test_2
In mine, this produces a projection mismatch error - which seems to tell me
that Grass isn't noticing the tfw file.
No, that's not the message
See below:
...
Here's a sample gdalinfo output:
Driver: GTiff/GeoTIFF
Files: Tiff_Test.tif
Size is 4838, 3781
Coordinate System is `'
-> the Coordinate System is (naturally) missing. Why? Because
in the .tfw file it is not stored. It might be an additional .prj file
(not sure if GDAL would recognize that, maybe yes).
...
The world file:
0.000002780000000
0.000000000000000
0.000000000000000
-0.000002780000000
150.345870829999996
-33.599356610000001
This file and the world file are the only items in the folder, and were
created by r.out.tiff from a raster in a working location.
Right.
ERROR: Projection of dataset does not appear to match current location.
Correct message because GRASS/GDAL cannot guess the projection
of the TIFF (since it is not specified).
Location PROJ_INFO is:
name: Lat/Lon
proj: ll
datum: wgs84
ellps: wgs84
no_defs: defined
Import dataset PROJ_INFO is:
cellhd.proj = 0 (unreferenced/unknown)
GRASS is right: the PROJ_INFO is undefined. Just a human will recognize
that it may be LatLong.
Solution: use r.in.gdal -o to disable the test and import into a location
with correct projection. Then the map will be placed correctly.
Cheers
Markus