[gdal-dev] help with gdalwarp

2009-01-04 Thread Alex Bernstein
Hi all,

Sorry for a newbie question. I've been reading this list and searching
elsewhere for a few days now to try to figure this out, but I'm still
missing something. I need to reproject a map from Plate Caree
projection to Lambert Azimuthal Equal Area projection centered on
0N,15E with gdalwarp. I'm using a Natural Earth II map from
http://www.shadedrelief.com/natural2/. The map
http://www.nacis.org/data/NE2/NE2_land_only.jpg is 16200x8100
pixels, plate caree, WGS84. It also has a world file
http://www.shadedrelief.com/natural2/images/world_16000.zip with
following information.
  0.02
  0.00
  0.00
  -0.02
  -180.00
  90.00

I run gdalwarp with following parameters:
gdalwarp -s_srs +proj=eqc +lat_ts=0 +lon_0=0 +datum=WGS84 -t_srs
+proj=laea +lat_0=0 +lon_0=15 +x_0=0 +y_0=0 +datum=WGS84 -co
INTERLEAVE=PIXEL -co TFW=YES -of GTiff
c:\dgwarp\source_images\NE2_land_only.jpg
c:\dgwarp\NE2_land_only_laea.tif

But the resulting image looks basically the same as the input,
definitely not like LAEA should look. gdalinfo on the output image
shows strange corner coordinates:
Driver: GTiff/GeoTIFF
Files: NE2_land_only_laea.tif
Size is 16166, 8168
Coordinate System is:
PROJCS[unnamed,
GEOGCS[WGS 84,
DATUM[WGS_1984,
SPHEROID[WGS 84,6378137,298.2572235630016,
AUTHORITY[EPSG,7030]],
AUTHORITY[EPSG,6326]],
PRIMEM[Greenwich,0],
UNIT[degree,0.0174532925199433],
AUTHORITY[EPSG,4326]],
PROJECTION[Lambert_Azimuthal_Equal_Area],
PARAMETER[latitude_of_center,0],
PARAMETER[longitude_of_center,15],
PARAMETER[false_easting,0],
PARAMETER[false_northing,0],
UNIT[metre,1,
AUTHORITY[EPSG,9001]]]
Origin = (-1665206.34306095800,90.180212867784576)
Pixel Size = (0.022078666990796,-0.022078666990796)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (-1665206.343,  90.180) (  0d 0'5.82W,  0d 0'2.91N)
Lower Left  (-1665206.343, -90.158) (  0d 0'5.82W,  0d 0'2.91S)
Upper Right (-1664849.419,  90.180) (  0d 0'5.82E,  0d 0'2.91N)
Lower Right (-1664849.419, -90.158) (  0d 0'5.82E,  0d 0'2.91S)
Center  (-1665027.881,   0.011) (  0d 0'0.00W,  0d 0'0.00N)
Band 1 Block=16166x1 Type=Byte, ColorInterp=Red
Band 2 Block=16166x1 Type=Byte, ColorInterp=Green
Band 3 Block=16166x1 Type=Byte, ColorInterp=Blue

What am I missing?
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] help with gdalwarp

2009-01-04 Thread Joaquim Luis

Alex Bernstein wrote:

Hi all,

Sorry for a newbie question. I've been reading this list and searching
elsewhere for a few days now to try to figure this out, but I'm still
missing something. I need to reproject a map from Plate Caree
projection to Lambert Azimuthal Equal Area projection centered on
0N,15E with gdalwarp. I'm using a Natural Earth II map from
http://www.shadedrelief.com/natural2/. The map
http://www.nacis.org/data/NE2/NE2_land_only.jpg is 16200x8100
pixels, plate caree, WGS84. It also has a world file
http://www.shadedrelief.com/natural2/images/world_16000.zip with
following information.
  0.02
  0.00
  0.00
  -0.02
  -180.00
  90.00


Alex,

The world file name must follow the conventions. If your file is called 
NE2_land_only.jpg
than the world file name must be either NE2_land_only.jgw or NE2_land_only.wld

And, humm, there is much sea water on that ..._land_only image

Joaquim Luis
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] help with gdalwarp

2009-01-04 Thread Alex Bernstein
On Sun, Jan 4, 2009 at 11:00 PM, Joaquim Luis jl...@ualg.pt wrote:
 Alex,

 The world file name must follow the conventions. If your file is called
 NE2_land_only.jpg
 than the world file name must be either NE2_land_only.jgw or
 NE2_land_only.wld

Joaquim, renaming the world file to NE2_land_only.jgw was one of first
things I've done, sorry I forgot to mention that. So it's not reason
for the problems I'm having with reprojection.

The coordinates in world file are specified in degrees, is this how it
supposed to be, or do I need to pass any switches to gdalwarp to
indicate that?
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] help with gdalwarp

2009-01-04 Thread Joaquim Luis

Alex Bernstein wrote:

On Sun, Jan 4, 2009 at 11:00 PM, Joaquim Luis jl...@ualg.pt wrote:



Joaquim, renaming the world file to NE2_land_only.jgw was one of first
things I've done, sorry I forgot to mention that. So it's not reason
for the problems I'm having with reprojection.

The coordinates in world file are specified in degrees, is this how it
supposed to be, or do I need to pass any switches to gdalwarp to
indicate that?


Alex,

Sorry, I don't know. Normally Lambert Azimuthal Equal Area should take two
standard parallels, but it makes no difference here. I tried

gdalwarp -s_srs +proj=eqc +lat_ts=0 +lon_0=0 +datum=WGS84
-t_srs +proj=laea +lat_1=20n +lat_2=60n -co TFW=YES NE2_land_only.jpg 
NE2_land_only_laea.tif

which reports
...
Upper Left  (-180.011,  89.4085425) (  0d 0'5.82W,  0d 0'2.91N)
Lower Left  (-180.011, -89.3968263) (  0d 0'5.82W,  0d 0'2.91S)
Upper Right ( 179.9964220,  89.4085425) (  0d 0'5.82E,  0d 0'2.91N)
Lower Right ( 179.9964220, -89.3968263) (  0d 0'5.82E,  0d 0'2.91S)
Center  (  -0.0073446,   0.0058581) (  0d 0'0.00W,  0d 0'0.00N)

but the file is not reprojected either.

I don't know if it is related but I found many instances where gdalwarp fails
on global files. I reported that twice, last one on ticket
http://trac.osgeo.org/gdal/ticket/2305
but unfortunately it didn't deserve any attention.

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] help with gdalwarp

2009-01-04 Thread Alex Bernstein
Joaquim,

Thanks for trying to help. I'm actually just interested in the map of
Africa from this global map. May be I'll try to figure out gdal
commands to crop and transform just the relevant region.

--Alex

On Mon, Jan 5, 2009 at 1:05 AM, Joaquim Luis jl...@ualg.pt wrote:
 Alex Bernstein wrote:

 On Sun, Jan 4, 2009 at 11:00 PM, Joaquim Luis jl...@ualg.pt wrote:

 Joaquim, renaming the world file to NE2_land_only.jgw was one of first
 things I've done, sorry I forgot to mention that. So it's not reason
 for the problems I'm having with reprojection.

 The coordinates in world file are specified in degrees, is this how it
 supposed to be, or do I need to pass any switches to gdalwarp to
 indicate that?

 Alex,

 Sorry, I don't know. Normally Lambert Azimuthal Equal Area should take two
 standard parallels, but it makes no difference here. I tried

 gdalwarp -s_srs +proj=eqc +lat_ts=0 +lon_0=0 +datum=WGS84
 -t_srs +proj=laea +lat_1=20n +lat_2=60n -co TFW=YES NE2_land_only.jpg
 NE2_land_only_laea.tif

 which reports
 ...
 Upper Left  (-180.011,  89.4085425) (  0d 0'5.82W,  0d 0'2.91N)
 Lower Left  (-180.011, -89.3968263) (  0d 0'5.82W,  0d 0'2.91S)
 Upper Right ( 179.9964220,  89.4085425) (  0d 0'5.82E,  0d 0'2.91N)
 Lower Right ( 179.9964220, -89.3968263) (  0d 0'5.82E,  0d 0'2.91S)
 Center  (  -0.0073446,   0.0058581) (  0d 0'0.00W,  0d 0'0.00N)

 but the file is not reprojected either.

 I don't know if it is related but I found many instances where gdalwarp
 fails
 on global files. I reported that twice, last one on ticket
 http://trac.osgeo.org/gdal/ticket/2305
 but unfortunately it didn't deserve any attention.


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] help with gdalwarp

2009-01-04 Thread Joaquim Luis

Alex Bernstein wrote:

Joaquim,

Thanks for trying to help. I'm actually just interested in the map of
Africa from this global map. May be I'll try to figure out gdal
commands to crop and transform just the relevant region.


That will work fine. I just tried with Mirone and checked against GMT
coastlines and the result is quite satisfactory.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] help with gdalwarp

2009-01-04 Thread Alex Bernstein
Seems to have worked! I used:

gdal_translate -a_srs +proj=longlat +datum=wgs84 -projwin -30 45 60 -45 -co 
TFW=YES -co INTERLEAVE=PIXEL -of Gtiff source_images\NE2_land_only.jpg test.tif
gdalwarp -t_srs +proj=laea +lat_0=0 +lon_0=15 +x_0=0 +y_0=0 -r lanczos -co 
INTERLEAVE=PIXEL -co TFW=YES -of GTiff test.tif test2.tif

The result looks like LAEA. I needed to change projection to make it
match another map that I had. Will check how good the map is now.

--Alex
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev