Discussion:
GDAL Translate and PNM format
(too old to reply)
Jim Julian
2007-11-21 11:48:48 UTC
Permalink
Thanks Anand,

The switches work, of course, but the bil format turned out to be of
a type not compatible with the PNM format (INT16). I settled for GeoTiff.

Jim Julian
Andrey Kiselev
2007-11-21 11:48:48 UTC
Permalink
Post by Jim Julian
The switches work, of course, but the bil format turned out to be of
a type not compatible with the PNM format (INT16). I settled for GeoTiff.
You can safely convert Int16 into UInt16 (with -ot switch) if you have
only positive values in input file.
--
Andrey V. Kiselev
Home phone: +7 812 5274898 ICQ# 26871517
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
I used your application gdal_translate to convert a 16
bit GeoTiff file to an 8 bit bmp file using command
line arguments:

gdal_translate -of bmp -ot byte -scale one.tif two.bmp

and it worked fine,

I then switched to your source code of gdal_translate
and put all the needed dlls and lib files and it
compiled correctly, but the result of its conversion
for the same file resulted in an image all black, why
is that?

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
Frank Warmerdam
2007-11-21 11:48:48 UTC
Permalink
Post by Ayman Kamal
I used your application gdal_translate to convert a 16
bit GeoTiff file to an 8 bit bmp file using command
gdal_translate -of bmp -ot byte -scale one.tif two.bmp
and it worked fine,
I then switched to your source code of gdal_translate
and put all the needed dlls and lib files and it
compiled correctly, but the result of its conversion
for the same file resulted in an image all black, why
is that?
Ayman,

I don't know.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, ***@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
Jim Julian
2007-11-21 11:48:48 UTC
Permalink
HI Andrey,

The BIL file was originally an HGF from the SRTM download site mentioned by
Markus Neteler. The files seem to be DEM files and contain a no_data value
which is negative.

Thanks,
Jim Julian


---------------------------------------------------------------------------
Post by Andrey Kiselev
Post by Jim Julian
The switches work, of course, but the bil format turned out to be of
a type not compatible with the PNM format (INT16). I settled for GeoTiff.
You can safely convert Int16 into UInt16 (with -ot switch) if you have
only positive values in input file.
--
Andrey V. Kiselev
Home phone: +7 812 5274898 ICQ# 26871517
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
Andrey Kiselev
2007-11-21 11:48:48 UTC
Permalink
Post by Jim Julian
The BIL file was originally an HGF from the SRTM download site mentioned by
Markus Neteler. The files seem to be DEM files and contain a no_data value
which is negative.
In this case val_repl.py script (in /pymod/samples directory) will help
you. With this script you can replace negative NoData by the more
appropriate one. Something like:

val_repl.py -innd -500 -outnd 0 infile outfile
--
Andrey V. Kiselev
Home phone: +7 812 5274898 ICQ# 26871517
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
ok sir, I found a way to make "gdal_translate" be able
to convert those 16-bit geotiff files:

gdal_translate -of bmp -ot byte file1.tif file2.bmp

(( simply I didn't put -scale in the command line ))

I just want one thing, do you have explanation for this?

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
Frank Warmerdam
2007-11-21 11:48:48 UTC
Permalink
Post by Ayman Kamal
ok sir, I found a way to make "gdal_translate" be able
gdal_translate -of bmp -ot byte file1.tif file2.bmp
(( simply I didn't put -scale in the command line ))
I just want one thing, do you have explanation for this?
Ayman,

Substantially different machinery is used with scaling is used from when it
isn't. However, I have rerun a test of converting a 16bit input file to
8bit BMP with scaling on my Linux system and it works fine even under
valgrind, so I still don't know why your local build didn't work. If you
are still interested in the issue, the obvious step to take is for you to
try and debug the problem since you are apparently the only one able to
reproduce the problem.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, ***@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
I want to be able to convert a "bmp" file to a
"GeoTiff" file.

I used gdal_translate to do this, but the resulting
file didn't of course contain georeferencing data.

Now:
1. Is it possible (if I find the goereferencing data)
to give them to GDAL SDK so that GDAL can generate a
GeoTiff file with georeferencing data embeded inside?

if (1.)
{
2. What data do I need to supply to GDAL to
accomplish this?

3. What functions to use in GDAL to save such data
in thre resulting GeoTiff file?
}
else
{
4. Can you help me in any means to accomoplish
this?
}



__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
Frank Warmerdam
2007-11-21 11:48:48 UTC
Permalink
Post by Ayman Kamal
I want to be able to convert a "bmp" file to a
"GeoTiff" file.
I used gdal_translate to do this, but the resulting
file didn't of course contain georeferencing data.
1. Is it possible (if I find the goereferencing data)
to give them to GDAL SDK so that GDAL can generate a
GeoTiff file with georeferencing data embeded inside?
if (1.)
{
2. What data do I need to supply to GDAL to
accomplish this?
3. What functions to use in GDAL to save such data
in thre resulting GeoTiff file?
}
else
{
4. Can you help me in any means to accomoplish
this?
}
Ayman,

You need to call GDALSetGeoTransform() with the appropriate affine geotransform.
Please ensure you are using a fairly recent GDAL (like a CVS snapshot not less
than 3 weeks old as there were some bugs in GeoTIFF update-in-place in 1.1.8).

The following is a fairly minimal example. If you want to write the coordinate
system also use the GDALSetProjection() method.

#include "gdal.h"

int main()

{
GDALDatasetH hDS;
double adfGeoTransform[6];

GDALAllRegister();

hDS = GDALOpen( "work.tif", GA_Update );

adfGeoTransform[0] = 1000; /* top left x */
adfGeoTransform[1] = 2.0; /* horizontal pixel size */
adfGeoTransform[2] = 0.0;
adfGeoTransform[3] = 6120; /* top left y */
adfGeoTransform[4] = 0.0;
adfGeoTransform[5] = -2.0; /* vertical pixel size */

GDALSetGeoTransform( hDS, adfGeoTransform );

GDALClose( hDS );
}

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, ***@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
Roger James
2007-11-21 11:48:48 UTC
Permalink
Ayman,

I you convert the file to to an ordinary tiff, you can use my georef
program to give it co-ordinate information. You will need the
co-ordinates of three ground control points visible in the upper left,
upper right, and lower left quadrants of the image. You can find georef
at www.beardandsandals.co.uk.

Roger

-----Original Message-----
From: gdal-dev-***@remotesensing.org
[mailto:gdal-dev-***@remotesensing.org] On Behalf Of Ayman Kamal
Sent: 11 March 2003 08:01
To: gdal-***@remotesensing.org
Subject: [Gdal-dev] saving GeoTiff

I want to be able to convert a "bmp" file to a
"GeoTiff" file.

I used gdal_translate to do this, but the resulting
file didn't of course contain georeferencing data.

Now:
1. Is it possible (if I find the goereferencing data)
to give them to GDAL SDK so that GDAL can generate a
GeoTiff file with georeferencing data embeded inside?

if (1.)
{
2. What data do I need to supply to GDAL to
accomplish this?

3. What functions to use in GDAL to save such data
in thre resulting GeoTiff file?
}
else
{
4. Can you help me in any means to accomoplish
this?
}



__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
I don't need a program, I need some sort of code or
dll to use in my own code, I am not an end user.
Post by Frank Warmerdam
Ayman,
I you convert the file to to an ordinary tiff, you
can use my georef
program to give it co-ordinate information. You will
need the
co-ordinates of three ground control points visible
in the upper left,
upper right, and lower left quadrants of the image.
You can find georef
at www.beardandsandals.co.uk.
Roger
-----Original Message-----
Of Ayman Kamal
Sent: 11 March 2003 08:01
Subject: [Gdal-dev] saving GeoTiff
I want to be able to convert a "bmp" file to a
"GeoTiff" file.
I used gdal_translate to do this, but the resulting
file didn't of course contain georeferencing data.
1. Is it possible (if I find the goereferencing
data)
to give them to GDAL SDK so that GDAL can generate a
GeoTiff file with georeferencing data embeded
inside?
if (1.)
{
2. What data do I need to supply to GDAL to
accomplish this?
3. What functions to use in GDAL to save such
data
in thre resulting GeoTiff file?
}
else
{
4. Can you help me in any means to accomoplish
this?
}
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
I debugged through "gdal_translate" demo application
and found that the two functions I care about are:

poVDS->SetProjection( pszProjection );
poVDS->SetGeoTransform( adfGeoTransform );

I know that pszProjection is the projection string,
and adfGeoTransform is likely coordinates of area.

I want to know what are the minimum parameters that I
have to provide for both those functions to generate a
GeoTiff file?

And if you can help me to know what are the different
possiblities of (valid) parameters ranges that can be entered?

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
Frank Warmerdam
2007-11-21 11:48:48 UTC
Permalink
Post by Ayman Kamal
I debugged through "gdal_translate" demo application
poVDS->SetProjection( pszProjection );
poVDS->SetGeoTransform( adfGeoTransform );
I know that pszProjection is the projection string,
and adfGeoTransform is likely coordinates of area.
I want to know what are the minimum parameters that I
have to provide for both those functions to generate a
GeoTiff file?
And if you can help me to know what are the different
possiblities of (valid) parameters ranges that can be entered?
Ayman,

I presume you received and reviewed my last email demonstrating
SetGeoTransform(). If you have specific questions let me know.

The SetProjection() method (like most other methods) is documented
at:
http://www.remotesensing.org/gdal/class_GDALDataset.html

You may want to read this topic for a little greater understanding of
the OpenGIS Well Known Text format for coordinate system definitions:
http://gdal.velocet.ca/projects/opengis/ogrhtml/osr_tutorial.html

Depending on the generality of solution you need, it is generally a good
idea to generate sample GeoTIFF files for the coordinate systems you want
and then use gdalinfo to dump the corresponding "WKT". You can then
manipulate the actual parameter values as needed in your actual code, or
use the OGRSpatialReference methods to create a WKT string.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, ***@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
I used "gdal_translate" to convert a gray .bmp file to
a geotiff file. I opened this file using GDAL library,
and tried it in other viewers, it worked.

Now I tried to convert a colored .bmp files: 256,
24bit
Then I opened the resulting geotiff file in my
application using GDAL and tried the same using OpenEV
and it worked,

BUT:

I tried to open it using differnt GeoTiff viewers, one
of them showed it as a whole black and the other didnt
open it and complained with the message:

"65535: Sample out of range, max 3"

What is the problem? Is the problem that the images
arec colored or what?


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
Frank Warmerdam
2007-11-21 11:48:48 UTC
Permalink
Post by Ayman Kamal
I used "gdal_translate" to convert a gray .bmp file to
a geotiff file. I opened this file using GDAL library,
and tried it in other viewers, it worked.
Now I tried to convert a colored .bmp files: 256,
24bit
Then I opened the resulting geotiff file in my
application using GDAL and tried the same using OpenEV
and it worked,
I tried to open it using differnt GeoTiff viewers, one
of them showed it as a whole black and the other didnt
"65535: Sample out of range, max 3"
What is the problem? Is the problem that the images
arec colored or what?
Ayman,

I have never seen this message before. Could you provide the "gdalinfo"
report for the TIFF file produced by GDAL? It would also be helpful to have
the "tiffinfo" report for it, if you are that application. Tiffinfo is
usually installed with libtiff on most Linux systems or you can build it
from source (http://www.libtiff.org).

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, ***@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
I attach the file "fltinfo.txt" that contains the
fltinfo for two images, the first one is a colored 256
color image, the second is the same as the first but
converted to gray scale.

The colored one causes the problem, but the gray scale
doesn't

The program that complained about the colored image
file is "3DEM"
Post by Ayman Kamal
Post by Ayman Kamal
I used "gdal_translate" to convert a gray .bmp
file to
Post by Ayman Kamal
a geotiff file. I opened this file using GDAL
library,
Post by Ayman Kamal
and tried it in other viewers, it worked.
Now I tried to convert a colored .bmp files: 256,
24bit
Then I opened the resulting geotiff file in my
application using GDAL and tried the same using
OpenEV
Post by Ayman Kamal
and it worked,
I tried to open it using differnt GeoTiff viewers,
one
Post by Ayman Kamal
of them showed it as a whole black and the other
didnt
Post by Ayman Kamal
"65535: Sample out of range, max 3"
What is the problem? Is the problem that the
images
Post by Ayman Kamal
arec colored or what?
Ayman,
I have never seen this message before. Could you
provide the "gdalinfo"
report for the TIFF file produced by GDAL? It would
also be helpful to have
the "tiffinfo" report for it, if you are that
application. Tiffinfo is
usually installed with libtiff on most Linux systems
or you can build it
from source (http://www.libtiff.org).
Best regards,
--
---------------------------------------+--------------------------------------
Post by Ayman Kamal
I set the clouds in motion - turn up | Frank
light and sound - activate the windows |
http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial
Programmer for Rent
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
-------------- next part --------------
--------------------------------------------------------------------------------------------------------------------------
((fltinfo data for the 256 color image))
((The one that causes the problems))

--------------------------------------------------------------------------------------------------------------------------
Driver: GTiff/GeoTIFF
Size is 800, 600
Coordinate System is:
GEOGCS["NAD83",
DATUM["North_American_Datum_1983",
SPHEROID["GRS 1980",6378137,298.257222101]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433]]
Origin = (-115.679700,46.440000)
Pixel Size = (0.001000,-0.001000)
Corner Coordinates:
Upper Left (-115.6797000, 46.4400000) (115d40'46.92"W, 46d26'24.00"N)
Lower Left (-115.6797000, 45.8400000) (115d40'46.92"W, 45d50'24.00"N)
Upper Right (-114.8797000, 46.4400000) (114d52'46.92"W, 46d26'24.00"N)
Lower Right (-114.8797000, 45.8400000) (114d52'46.92"W, 45d50'24.00"N)
Center (-115.2797000, 46.1400000) (115d16'46.92"W, 46d 8'24.00"N)
Band 1 Block=800x2 Type=Float32, ColorInterp=Red
Min=-4294967295.000/0, Max=4294967295.000/0
Band 2 Block=800x2 Type=Float32, ColorInterp=Green
Min=-4294967295.000/0, Max=4294967295.000/0
Band 3 Block=800x2 Type=Float32, ColorInterp=Blue
Min=-4294967295.000/0, Max=4294967295.000/0
--------------------------------------------------------------------------------------------------------------------------
((fltinfo data for the same image after being converted to gray scale))

--------------------------------------------------------------------------------------------------------------------------
Driver: GTiff/GeoTIFF
Size is 800, 600
Coordinate System is:
GEOGCS["NAD83",
DATUM["North_American_Datum_1983",
SPHEROID["GRS 1980",6378137,298.257222101]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433]]
Origin = (-115.679700,46.440000)
Pixel Size = (0.001000,-0.001000)
Corner Coordinates:
Upper Left (-115.6797000, 46.4400000) (115d40'46.92"W, 46d26'24.00"N)
Lower Left (-115.6797000, 45.8400000) (115d40'46.92"W, 45d50'24.00"N)
Upper Right (-114.8797000, 46.4400000) (114d52'46.92"W, 46d26'24.00"N)
Lower Right (-114.8797000, 45.8400000) (114d52'46.92"W, 45d50'24.00"N)
Center (-115.2797000, 46.1400000) (115d16'46.92"W, 46d 8'24.00"N)
Band 1 Block=800x2 Type=Float32, ColorInterp=Gray
Min=-4294967295.000/0, Max=4294967295.000/0
Vincent Schut
2007-11-21 11:48:48 UTC
Permalink
Post by Ayman Kamal
I attach the file "fltinfo.txt" that contains the
fltinfo for two images, the first one is a colored 256
color image, the second is the same as the first but
converted to gray scale.
The colored one causes the problem, but the gray scale
doesn't
The program that complained about the colored image
file is "3DEM"
Ayman,

I just saw your fltinfo.txt and would like to add my 2c to your thread:
For both of the images, you are using a datatype of 32 bit floating point. It
is very well possible that not all viewers can show a 3 band 32bit float
tiff? Maybe you could try to save it with outputtype byte. You won't need
32bit floating point anyway, if your data came from 256 color bmp... Saving
as byte would save you a lot of disk/memory space (and reading speed). You
could also try to save it as a 8 bit palette image, but I am not shure
whether gdal_translate can produce such a tiff file...

Regards,
Vincent Schut.
Frank Warmerdam
2007-11-21 11:48:48 UTC
Permalink
Post by Ayman Kamal
I attach the file "fltinfo.txt" that contains the
fltinfo for two images, the first one is a colored 256
color image, the second is the same as the first but
converted to gray scale.
The colored one causes the problem, but the gray scale
doesn't
Ayman,

As noted by the other writer, the problem is use of 32bit
floating point GeoTIFF. Many applications don't support these at
all. How did you produce these files? Surely gdal_translate wouldn't
produce them by default from a BMP file as it attempts to preserve the
original data type (8bit).

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, ***@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
Vincent Schut
2007-11-21 11:48:48 UTC
Permalink
Ok, I converted it to a goetiff file with a "byte"
widht, but I get a complain from the goetiff viewer
satating "Not a geotiff DEM filie"
and this is expected, as I am supposed to deal with
NED files which are geotiff files with a 32 bit
floating bit data, when the application found that the
data isn't 32 bit floating it didn't approve it.
My main scope is NED and not GeoTiff, but simply NED
data comes in many format flavors one of which is
GeoTiff but it must be 32 bit floating point.
Ah well but I think DEM files would never have 3 bands... That's the problem
maybe. You can either have a DEM file, which in fact is not an image but just
a floating point, 2-dimensional dataset, or you can have an image (that may
be representing the height as colors) which can have 3 bands, but is of
course not a DEM. I mean, if a DEM had three bands, what would the
interpretation of these bands be?
If you really want to make a DEM out of a BMP file (correct me if I'm wrong,
but it sounds like you're trying to do something like that...), you probably
could do it by one more gdal_translate step: make a new geotiff from the
32bit float 3 band geotiff, using only one band (use gdal_translate -b [ band
number ] [3bandfloat.tif] [1bandfloat.tif] ). But I wonder whether this file
would be a good representation of the original 256 color file.
Post by Frank Warmerdam
Post by Ayman Kamal
I attach the file "fltinfo.txt" that contains the
fltinfo for two images, the first one is a colored
256
Post by Ayman Kamal
color image, the second is the same as the first
but
Post by Ayman Kamal
converted to gray scale.
The colored one causes the problem, but the gray
scale
Post by Ayman Kamal
doesn't
The program that complained about the colored
image
Post by Ayman Kamal
file is "3DEM"
Ayman,
I just saw your fltinfo.txt and would like to add my
For both of the images, you are using a datatype of
32 bit floating point. It
is very well possible that not all viewers can show
a 3 band 32bit float
tiff? Maybe you could try to save it with outputtype
byte. You won't need
32bit floating point anyway, if your data came from
256 color bmp... Saving
as byte would save you a lot of disk/memory space
(and reading speed). You
could also try to save it as a 8 bit palette image,
but I am not shure
whether gdal_translate can produce such a tiff
file...
Regards,
Vincent Schut.
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
--
______________________________________
Vincent Schut (***@sarvision.com)
Sarvision B.V.
Wageningen, The Netherlands
www.sarvision.com
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
1.
You mentioned that
adfGeoTransform[0] = /* top left x */
adfGeoTransform[3] = /* top left y */

-Does top left x mean the value of longitude for top
left corner?
-Does top left y mean the value of lattitude for top
left corner?

2.
What does horizental, vertical pixel size mean?

3.
Are adfGeoTransform[2],adfGeoTransform[4] always 0?

4.
If the user doesn't give me any of these data, and
still wants me to generate a GeoTiff file out of his
faces' images for example,
are there default values that I can supply to generate
a valid GeoTiff file?
Post by Ayman Kamal
Post by Ayman Kamal
I want to be able to convert a "bmp" file to a
"GeoTiff" file.
I used gdal_translate to do this, but the
resulting
Post by Ayman Kamal
file didn't of course contain georeferencing data.
1. Is it possible (if I find the goereferencing
data)
Post by Ayman Kamal
to give them to GDAL SDK so that GDAL can generate
a
Post by Ayman Kamal
GeoTiff file with georeferencing data embeded
inside?
Post by Ayman Kamal
if (1.)
{
2. What data do I need to supply to GDAL to
accomplish this?
3. What functions to use in GDAL to save such
data
Post by Ayman Kamal
in thre resulting GeoTiff file?
}
else
{
4. Can you help me in any means to accomoplish
this?
}
Ayman,
You need to call GDALSetGeoTransform() with the
appropriate affine geotransform.
Please ensure you are using a fairly recent GDAL
(like a CVS snapshot not less
than 3 weeks old as there were some bugs in GeoTIFF
update-in-place in 1.1.8).
The following is a fairly minimal example. If you
want to write the coordinate
system also use the GDALSetProjection() method.
#include "gdal.h"
int main()
{
GDALDatasetH hDS;
double adfGeoTransform[6];
GDALAllRegister();
hDS = GDALOpen( "work.tif", GA_Update );
adfGeoTransform[0] = 1000; /* top left x */
adfGeoTransform[1] = 2.0; /* horizontal pixel
size */
adfGeoTransform[2] = 0.0;
adfGeoTransform[3] = 6120; /* top left y */
adfGeoTransform[4] = 0.0;
adfGeoTransform[5] = -2.0; /* vertical pixel
size */
GDALSetGeoTransform( hDS, adfGeoTransform );
GDALClose( hDS );
}
Best regards,
--
---------------------------------------+--------------------------------------
Post by Ayman Kamal
I set the clouds in motion - turn up | Frank
light and sound - activate the windows |
http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial
Programmer for Rent
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
Frank Warmerdam
2007-11-21 11:48:48 UTC
Permalink
Post by Ayman Kamal
1.
You mentioned that
adfGeoTransform[0] = /* top left x */
adfGeoTransform[3] = /* top left y */
-Does top left x mean the value of longitude for top
left corner?
-Does top left y mean the value of lattitude for top
left corner?
Ayman,

Yes, if the coordinate system of the image is lat/long.
Post by Ayman Kamal
2.
What does horizental, vertical pixel size mean?
The width of a pixel is the coordinate system being used.
Post by Ayman Kamal
3.
Are adfGeoTransform[2],adfGeoTransform[4] always 0?
No. If the image is not "north up", that is the image is
rotated or sheared from the normal map orientation these will
be non-zero and then the interpretation of the pixel size is
more complicated.

In common use these values will be zero.
Post by Ayman Kamal
4.
If the user doesn't give me any of these data, and
still wants me to generate a GeoTiff file out of his
faces' images for example,
are there default values that I can supply to generate
a valid GeoTiff file?
It is pointless to create a "Geo" TIFF file without knowing anything
about a meaningful coordinate system. If you feel the need to do so pick
any random values you feel like.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, ***@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
Below is the "gdalinfo" data for a geotiff file, I
used "gdal_translate" to convert this file to a bmp
file, the resulting file appeared as all white, when I
removed the -scale option the resulting bmp file
appeared correct.

Can you help me?
------------------------------------------------------
Driver: GTiff/GeoTIFF
Size is 375, 473
Coordinate System is:
PROJCS["unnamed",
GEOGCS["NAD27",
DATUM["North_American_Datum_1927",
SPHEROID["Clarke
1866",6378206.4,294.9786982139006,
AUTHORITY["EPSG","7008"]],
AUTHORITY["EPSG","6267"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4267"]],
AUTHORITY["EPSG","26715"],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",-93],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["unknown",1]]
Origin = (716880.000000,4305960.000000)
Pixel Size = (30.000000,-30.000000)
Corner Coordinates:
Upper Left ( 716880.000, 4305960.000) (
90d29'59.67"W, 38d52'39.45"N)
Lower Left ( 716880.000, 4291770.000) (
90d30'15.74"W, 38d44'59.53"N)
Upper Right ( 728130.000, 4305960.000) (
90d22'13.25"W, 38d52'29.20"N)
Lower Right ( 728130.000, 4291770.000) (
90d22'30.16"W, 38d44'49.33"N)
Center ( 722505.000, 4298865.000) (
90d26'14.71"W, 38d48'44.44"N)
Band 1 Block=375x1 Type=Float32, ColorInterp=Gray
------------------------------------------------------
Post by Ayman Kamal
Post by Ayman Kamal
ok sir, I found a way to make "gdal_translate" be
able
Post by Ayman Kamal
gdal_translate -of bmp -ot byte file1.tif
file2.bmp
Post by Ayman Kamal
(( simply I didn't put -scale in the command line
))
Post by Ayman Kamal
I just want one thing, do you have explanation for
this?
Ayman,
Substantially different machinery is used with
scaling is used from when it
isn't. However, I have rerun a test of converting a
16bit input file to
8bit BMP with scaling on my Linux system and it
works fine even under
valgrind, so I still don't know why your local build
didn't work. If you
are still interested in the issue, the obvious step
to take is for you to
try and debug the problem since you are apparently
the only one able to
reproduce the problem.
Best regards,
--
---------------------------------------+--------------------------------------
Post by Ayman Kamal
I set the clouds in motion - turn up | Frank
light and sound - activate the windows |
http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial
Programmer for Rent
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
Andrey Kiselev
2007-11-21 11:48:48 UTC
Permalink
Post by Ayman Kamal
Below is the "gdalinfo" data for a geotiff file, I
used "gdal_translate" to convert this file to a bmp
file, the resulting file appeared as all white, when I
removed the -scale option the resulting bmp file
appeared correct.
Can you help me?
------------------------------------------------------
Driver: GTiff/GeoTIFF
Size is 375, 473
...
Post by Ayman Kamal
Band 1 Block=375x1 Type=Float32, ColorInterp=Gray
It is possible you have input data which cannot be scaled to range
0--255 without additional processing.
--
Andrey V. Kiselev
Home phone: +7 812 5274898 ICQ# 26871517
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
Thank you very much sir,
but still I have one point not clear enough: "pixel
sie", I want to ask the user to supply me with the
needed data, Shall I put in the dialog "pixel size"

please I need to understand this point correctly.

By the way, I figured out that there are vertical
DATUMs like NAVD, are they supported in GDAL?
Post by Frank Warmerdam
Post by Ayman Kamal
1.
You mentioned that
adfGeoTransform[0] = /* top left x */
adfGeoTransform[3] = /* top left y */
-Does top left x mean the value of longitude for
top
Post by Ayman Kamal
left corner?
-Does top left y mean the value of lattitude for
top
Post by Ayman Kamal
left corner?
Ayman,
Yes, if the coordinate system of the image is
lat/long.
Post by Ayman Kamal
2.
What does horizental, vertical pixel size mean?
The width of a pixel is the coordinate system being
used.
Post by Ayman Kamal
3.
Are adfGeoTransform[2],adfGeoTransform[4] always
0?
No. If the image is not "north up", that is the
image is
rotated or sheared from the normal map orientation
these will
be non-zero and then the interpretation of the pixel
size is
more complicated.
In common use these values will be zero.
Post by Ayman Kamal
4.
If the user doesn't give me any of these data, and
still wants me to generate a GeoTiff file out of
his
Post by Ayman Kamal
faces' images for example,
are there default values that I can supply to
generate
Post by Ayman Kamal
a valid GeoTiff file?
It is pointless to create a "Geo" TIFF file without
knowing anything
about a meaningful coordinate system. If you feel
the need to do so pick
any random values you feel like.
Best regards,
--
---------------------------------------+--------------------------------------
Post by Frank Warmerdam
I set the clouds in motion - turn up | Frank
light and sound - activate the windows |
http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial
Programmer for Rent
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
Frank Warmerdam
2007-11-21 11:48:48 UTC
Permalink
Post by Ayman Kamal
Thank you very much sir,
but still I have one point not clear enough: "pixel
sie", I want to ask the user to supply me with the
needed data, Shall I put in the dialog "pixel size"
please I need to understand this point correctly.
Ayman,

I can't easily judge what is appropriate for your dialogs. It might well
be that your users will have no idea what the size of a pixel is, and will
want to give the top left, and bottom right lat/long coordiantes for an
image from which you will need to derive the pixel size.
Post by Ayman Kamal
By the way, I figured out that there are vertical
DATUMs like NAVD, are they supported in GDAL?
GDAL has no support for vertical datums. The OGC Well Known Text format
used by GDAL for representing coordinate systems does support compound
coordinate systems which include a vertical datum, but GDAL (and the
OGRSpatialReference) do *not* support these, much less use them for anything
useful.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, ***@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
If I want to convert a "bmp" to a "GeoTiff" using
GDAL, can the source "bmp" be a buffer in memory or
does it have to be a bmp file on the disk?

If it can be a buffer what function(s) neede?
Post by Frank Warmerdam
Post by Ayman Kamal
1.
You mentioned that
adfGeoTransform[0] = /* top left x */
adfGeoTransform[3] = /* top left y */
-Does top left x mean the value of longitude for
top
Post by Ayman Kamal
left corner?
-Does top left y mean the value of lattitude for
top
Post by Ayman Kamal
left corner?
Ayman,
Yes, if the coordinate system of the image is
lat/long.
Post by Ayman Kamal
2.
What does horizental, vertical pixel size mean?
The width of a pixel is the coordinate system being
used.
Post by Ayman Kamal
3.
Are adfGeoTransform[2],adfGeoTransform[4] always
0?
No. If the image is not "north up", that is the
image is
rotated or sheared from the normal map orientation
these will
be non-zero and then the interpretation of the pixel
size is
more complicated.
In common use these values will be zero.
Post by Ayman Kamal
4.
If the user doesn't give me any of these data, and
still wants me to generate a GeoTiff file out of
his
Post by Ayman Kamal
faces' images for example,
are there default values that I can supply to
generate
Post by Ayman Kamal
a valid GeoTiff file?
It is pointless to create a "Geo" TIFF file without
knowing anything
about a meaningful coordinate system. If you feel
the need to do so pick
any random values you feel like.
Best regards,
--
---------------------------------------+--------------------------------------
Post by Frank Warmerdam
I set the clouds in motion - turn up | Frank
light and sound - activate the windows |
http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial
Programmer for Rent
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
Frank Warmerdam
2007-11-21 11:48:48 UTC
Permalink
Post by Ayman Kamal
If I want to convert a "bmp" to a "GeoTiff" using
GDAL, can the source "bmp" be a buffer in memory or
does it have to be a bmp file on the disk?
If it can be a buffer what function(s) neede?
Ayman,

The short answer is that there is no simply provided mechanism for
reading and writing file formats stored all in memory (except for the
memory format of course). It is theoretically possible to hook the VSI
IO functions in such a way as to allow drivers that are entirely VSI
based to access in-memory file images if that is particularly critical.
VSI is the POSIX style IO API cover layer.

Note that some drivers do not go through VSI. BMP does.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, ***@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
Then, if it can be derived, how can I do so, If it
can't, can you give me more explanation?

If you don't have enough time to answer me, can you
please givem me a link to a web page or whatsoever
resource that explains this. I need to understand this
point THOROUGHLY.
Post by Ayman Kamal
Post by Ayman Kamal
Thank you very much sir,
"pixel
Post by Ayman Kamal
sie", I want to ask the user to supply me with the
needed data, Shall I put in the dialog "pixel
size"
Post by Ayman Kamal
please I need to understand this point correctly.
Ayman,
I can't easily judge what is appropriate for your
dialogs. It might well
be that your users will have no idea what the size
of a pixel is, and will
want to give the top left, and bottom right lat/long
coordiantes for an
image from which you will need to derive the pixel
size.
Post by Ayman Kamal
By the way, I figured out that there are vertical
DATUMs like NAVD, are they supported in GDAL?
GDAL has no support for vertical datums. The OGC
Well Known Text format
used by GDAL for representing coordinate systems
does support compound
coordinate systems which include a vertical datum,
but GDAL (and the
OGRSpatialReference) do *not* support these, much
less use them for anything
useful.
Best regards,
--
---------------------------------------+--------------------------------------
Post by Ayman Kamal
I set the clouds in motion - turn up | Frank
light and sound - activate the windows |
http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial
Programmer for Rent
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com
Frank Warmerdam
2007-11-21 11:48:48 UTC
Permalink
Post by Ayman Kamal
Then, if it can be derived, how can I do so, If it
can't, can you give me more explanation?
If you don't have enough time to answer me, can you
please givem me a link to a web page or whatsoever
resource that explains this. I need to understand this
point THOROUGHLY.
Ayman,

I do not know off hand of a resouce that discusses this thoroughly. I would
suggest you review the information in the GDAL data model document about
"Affine GeoTransform".

http://www.remotesensing.org/gdal/gdal_datamodel.html

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, ***@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
ok sir, I figured out that the pixel size decides how
long does the pixel represent in actual model system
units, as the scale factor for geograpich maps,

1. Now I just want to know, for the 4 mentioned
coordinate systems
"NAD27", "NAD83", "WGS72", "WGS84" what are the units
of the model system?? I want to ask the user to
explain this for the user.

2. What are the ranges for valid data the user can
provide for the top left corner of image & for pixel
size.

3. I saved a certain image using GDAL and each time
changed the pixel size,and then opened this image
using GDAL and noticed that there was no difference in
how the image looked like, I am sure of that. Can you
explain?
Post by Frank Warmerdam
Post by Ayman Kamal
Then, if it can be derived, how can I do so, If it
can't, can you give me more explanation?
If you don't have enough time to answer me, can
you
Post by Ayman Kamal
please givem me a link to a web page or whatsoever
resource that explains this. I need to understand
this
Post by Ayman Kamal
point THOROUGHLY.
Ayman,
I do not know off hand of a resouce that discusses
this thoroughly. I would
suggest you review the information in the GDAL data
model document about
"Affine GeoTransform".
http://www.remotesensing.org/gdal/gdal_datamodel.html
Post by Frank Warmerdam
Best regards,
--
---------------------------------------+--------------------------------------
Post by Frank Warmerdam
I set the clouds in motion - turn up | Frank
light and sound - activate the windows |
http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial
Programmer for Rent
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
Ed McNierney
2007-11-21 11:48:48 UTC
Permalink
Ayman -

1. The four mentioned "coordinate systems" are datums, not coordinate
systems. The "units of the model system" depend upon the specific map
projection you are using. For example, I live in Masschusetts, USA, and
locally we use the Massachusetts State Plane coordinate system, which
can be implemented in either feet or meters. The majority of projected
coordinate systems use meters, but the correct value will depend on the
specific system you are using.

2. The top left corner coordinates and pixel size are all floating-point
numbers and can accommodate any plausible numbers you might have.

3. I don't think you have given us enough information here - can you
explain exactly how you changed the pixel size?

- Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
Phone: (978) 251-4242 Fax: (978) 251-1396
***@topozone.com


-----Original Message-----
From: Ayman Kamal [mailto:***@yahoo.com]
Sent: Tuesday, March 18, 2003 10:03 AM
To: gdal-***@remotesensing.org
Subject: Re: [Gdal-dev] saving GeoTiff

ok sir, I figured out that the pixel size decides how
long does the pixel represent in actual model system
units, as the scale factor for geograpich maps,

1. Now I just want to know, for the 4 mentioned
coordinate systems
"NAD27", "NAD83", "WGS72", "WGS84" what are the units
of the model system?? I want to ask the user to
explain this for the user.

2. What are the ranges for valid data the user can
provide for the top left corner of image & for pixel
size.

3. I saved a certain image using GDAL and each time
changed the pixel size,and then opened this image
using GDAL and noticed that there was no difference in
how the image looked like, I am sure of that. Can you
explain?
Post by Frank Warmerdam
Post by Ayman Kamal
Then, if it can be derived, how can I do so, If it
can't, can you give me more explanation?
If you don't have enough time to answer me, can
you
Post by Ayman Kamal
please givem me a link to a web page or whatsoever
resource that explains this. I need to understand
this
Post by Ayman Kamal
point THOROUGHLY.
Ayman,
I do not know off hand of a resouce that discusses
this thoroughly. I would
suggest you review the information in the GDAL data
model document about
"Affine GeoTransform".
http://www.remotesensing.org/gdal/gdal_datamodel.html
Post by Frank Warmerdam
Best regards,
--
---------------------------------------+--------------------------------
------
Post by Frank Warmerdam
I set the clouds in motion - turn up | Frank
light and sound - activate the windows |
http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial
Programmer for Rent
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
1.
sorry sir if I was wrong when calling "NAD83",..
coordinate systems, but I referred to
http://gdal.velocet.ca/projects/opengis/ogrhtml/osr_tutorial.html

where it mentions exactly:
"The OGRSpatialReference has built in support for a
few well known coordinate systems, which include
"NAD27", "NAD83", "WGS72" and "WGS84....."


2. I changed the pixel size by changing the values of
adfGeoTransform[1]//horizental pixel size
adfGeoTransform[5]//vertical pixel size

in "gdal_translate" code.

I am sure that the pixel size was changed, as I opened
the images in other softwares and noticed that the
size of the grid cells has changed accordingly.

3. Anyway, what I want simply is as follows:
I want to show a dialog the user that contains the
parametes he/she must fill to be able to generate a
correct GeoTiff image,
-I figuered out that I will ask him/her to choose one
of "NAD83","NAD27","WGS72","WGS84"
-Ask him/her about the latitude and longitude of top
left corner
-Ask him/her about pixel size, and I mention the unit
of size, so what does DATUM mean, and if he chooses
any of the DATUMs, what will the unit be?
Post by Ed McNierney
Ayman -
1. The four mentioned "coordinate systems" are
datums, not coordinate
systems. The "units of the model system" depend
upon the specific map
projection you are using. For example, I live in
Masschusetts, USA, and
locally we use the Massachusetts State Plane
coordinate system, which
can be implemented in either feet or meters. The
majority of projected
coordinate systems use meters, but the correct value
will depend on the
specific system you are using.
2. The top left corner coordinates and pixel size
are all floating-point
numbers and can accommodate any plausible numbers
you might have.
3. I don't think you have given us enough
information here - can you
explain exactly how you changed the pixel size?
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
Phone: (978) 251-4242 Fax: (978) 251-1396
-----Original Message-----
Sent: Tuesday, March 18, 2003 10:03 AM
Subject: Re: [Gdal-dev] saving GeoTiff
ok sir, I figured out that the pixel size decides
how
long does the pixel represent in actual model system
units, as the scale factor for geograpich maps,
1. Now I just want to know, for the 4 mentioned
coordinate systems
"NAD27", "NAD83", "WGS72", "WGS84" what are the
units
of the model system?? I want to ask the user to
explain this for the user.
2. What are the ranges for valid data the user can
provide for the top left corner of image & for pixel
size.
3. I saved a certain image using GDAL and each time
changed the pixel size,and then opened this image
using GDAL and noticed that there was no difference
in
how the image looked like, I am sure of that. Can
you
explain?
Post by Frank Warmerdam
Post by Ayman Kamal
Then, if it can be derived, how can I do so, If
it
Post by Frank Warmerdam
Post by Ayman Kamal
can't, can you give me more explanation?
If you don't have enough time to answer me, can
you
Post by Ayman Kamal
please givem me a link to a web page or
whatsoever
Post by Frank Warmerdam
Post by Ayman Kamal
resource that explains this. I need to
understand
Post by Frank Warmerdam
this
Post by Ayman Kamal
point THOROUGHLY.
Ayman,
I do not know off hand of a resouce that discusses
this thoroughly. I would
suggest you review the information in the GDAL
data
Post by Frank Warmerdam
model document about
"Affine GeoTransform".
http://www.remotesensing.org/gdal/gdal_datamodel.html
Post by Ed McNierney
Post by Frank Warmerdam
Best regards,
--
---------------------------------------+--------------------------------
Post by Ed McNierney
------
Post by Frank Warmerdam
I set the clouds in motion - turn up | Frank
light and sound - activate the windows |
http://pobox.com/~warmerdam
and watch the world go round - Rush |
Geospatial
Post by Frank Warmerdam
Programmer for Rent
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness,
live on your desktop!
http://platinum.yahoo.com
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
Ed McNierney
2007-11-21 11:48:48 UTC
Permalink
Ayman -

Since you mention "latitude and longitude", I will assume your data is
unprojected and in decimal degrees. If so, then the "projection" is
usually called "unprojected" or "geographic" - you need the datum and
the latitude and longitude to define a location.

If your data is in decimal degrees, then the units of pixel size are in
decimal degrees. The values specified by the user should be the size of
each pixel in degrees of latitude and degrees of longitude. It is
unusual for raster data to be in decimal degrees, so make sure that is
correct. Most raster data is projected.

- Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
Phone: (978) 251-4242 Fax: (978) 251-1396
***@topozone.com


-----Original Message-----
From: Ayman Kamal [mailto:***@yahoo.com]
Sent: Tuesday, March 18, 2003 10:42 AM
To: gdal-***@remotesensing.org
Subject: RE: [Gdal-dev] saving GeoTiff

1.
sorry sir if I was wrong when calling "NAD83",..
coordinate systems, but I referred to
http://gdal.velocet.ca/projects/opengis/ogrhtml/osr_tutorial.html

where it mentions exactly:
"The OGRSpatialReference has built in support for a
few well known coordinate systems, which include
"NAD27", "NAD83", "WGS72" and "WGS84....."


2. I changed the pixel size by changing the values of
adfGeoTransform[1]//horizental pixel size
adfGeoTransform[5]//vertical pixel size

in "gdal_translate" code.

I am sure that the pixel size was changed, as I opened
the images in other softwares and noticed that the
size of the grid cells has changed accordingly.

3. Anyway, what I want simply is as follows:
I want to show a dialog the user that contains the
parametes he/she must fill to be able to generate a
correct GeoTiff image,
-I figuered out that I will ask him/her to choose one
of "NAD83","NAD27","WGS72","WGS84"
-Ask him/her about the latitude and longitude of top
left corner
-Ask him/her about pixel size, and I mention the unit
of size, so what does DATUM mean, and if he chooses
any of the DATUMs, what will the unit be?
Post by Ed McNierney
Ayman -
1. The four mentioned "coordinate systems" are
datums, not coordinate
systems. The "units of the model system" depend
upon the specific map
projection you are using. For example, I live in
Masschusetts, USA, and
locally we use the Massachusetts State Plane
coordinate system, which
can be implemented in either feet or meters. The
majority of projected
coordinate systems use meters, but the correct value
will depend on the
specific system you are using.
2. The top left corner coordinates and pixel size
are all floating-point
numbers and can accommodate any plausible numbers
you might have.
3. I don't think you have given us enough
information here - can you
explain exactly how you changed the pixel size?
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
Phone: (978) 251-4242 Fax: (978) 251-1396
-----Original Message-----
Sent: Tuesday, March 18, 2003 10:03 AM
Subject: Re: [Gdal-dev] saving GeoTiff
ok sir, I figured out that the pixel size decides
how
long does the pixel represent in actual model system
units, as the scale factor for geograpich maps,
1. Now I just want to know, for the 4 mentioned
coordinate systems
"NAD27", "NAD83", "WGS72", "WGS84" what are the
units
of the model system?? I want to ask the user to
explain this for the user.
2. What are the ranges for valid data the user can
provide for the top left corner of image & for pixel
size.
3. I saved a certain image using GDAL and each time
changed the pixel size,and then opened this image
using GDAL and noticed that there was no difference
in
how the image looked like, I am sure of that. Can
you
explain?
Post by Frank Warmerdam
Post by Ayman Kamal
Then, if it can be derived, how can I do so, If
it
Post by Frank Warmerdam
Post by Ayman Kamal
can't, can you give me more explanation?
If you don't have enough time to answer me, can
you
Post by Ayman Kamal
please givem me a link to a web page or
whatsoever
Post by Frank Warmerdam
Post by Ayman Kamal
resource that explains this. I need to
understand
Post by Frank Warmerdam
this
Post by Ayman Kamal
point THOROUGHLY.
Ayman,
I do not know off hand of a resouce that discusses
this thoroughly. I would
suggest you review the information in the GDAL
data
Post by Frank Warmerdam
model document about
"Affine GeoTransform".
http://www.remotesensing.org/gdal/gdal_datamodel.html
Post by Ed McNierney
Post by Frank Warmerdam
Best regards,
--
---------------------------------------+--------------------------------
Post by Ed McNierney
------
Post by Frank Warmerdam
I set the clouds in motion - turn up | Frank
light and sound - activate the windows |
http://pobox.com/~warmerdam
and watch the world go round - Rush |
Geospatial
Post by Frank Warmerdam
Programmer for Rent
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness,
live on your desktop!
http://platinum.yahoo.com
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
Now, after I saved several GeoTiff files using
"gdal_translate" source as a program to modify the
settings of Geo data, I don't know what is the value
of the geo data saved???

By changing the values of adfGeoTransform[] elemets:
*I change the top left corner (longitude, lattitude)
*I change the pixel size

and when I open the image using different viewers, I
get the same image no matter what the values are, the
only change I see is the size and values of grids of
lattitude and longitude lines.

But how the imaage looks, or the height data that some
viewers show, are all unchanged.

Can you explain to me??
Post by Ed McNierney
Ayman -
Since you mention "latitude and longitude", I will
assume your data is
unprojected and in decimal degrees. If so, then the
"projection" is
usually called "unprojected" or "geographic" - you
need the datum and
the latitude and longitude to define a location.
If your data is in decimal degrees, then the units
of pixel size are in
decimal degrees. The values specified by the user
should be the size of
each pixel in degrees of latitude and degrees of
longitude. It is
unusual for raster data to be in decimal degrees, so
make sure that is
correct. Most raster data is projected.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
Phone: (978) 251-4242 Fax: (978) 251-1396
-----Original Message-----
Sent: Tuesday, March 18, 2003 10:42 AM
Subject: RE: [Gdal-dev] saving GeoTiff
1.
sorry sir if I was wrong when calling "NAD83",..
coordinate systems, but I referred to
http://gdal.velocet.ca/projects/opengis/ogrhtml/osr_tutorial.html
Post by Ed McNierney
"The OGRSpatialReference has built in support for a
few well known coordinate systems, which include
"NAD27", "NAD83", "WGS72" and "WGS84....."
2. I changed the pixel size by changing the values
of
adfGeoTransform[1]//horizental pixel size
adfGeoTransform[5]//vertical pixel size
in "gdal_translate" code.
I am sure that the pixel size was changed, as I
opened
the images in other softwares and noticed that the
size of the grid cells has changed accordingly.
I want to show a dialog the user that contains the
parametes he/she must fill to be able to generate a
correct GeoTiff image,
-I figuered out that I will ask him/her to choose
one
of "NAD83","NAD27","WGS72","WGS84"
-Ask him/her about the latitude and longitude of top
left corner
-Ask him/her about pixel size, and I mention the
unit
of size, so what does DATUM mean, and if he chooses
any of the DATUMs, what will the unit be?
Post by Ed McNierney
Ayman -
1. The four mentioned "coordinate systems" are
datums, not coordinate
systems. The "units of the model system" depend
upon the specific map
projection you are using. For example, I live in
Masschusetts, USA, and
locally we use the Massachusetts State Plane
coordinate system, which
can be implemented in either feet or meters. The
majority of projected
coordinate systems use meters, but the correct
value
Post by Ed McNierney
will depend on the
specific system you are using.
2. The top left corner coordinates and pixel size
are all floating-point
numbers and can accommodate any plausible numbers
you might have.
3. I don't think you have given us enough
information here - can you
explain exactly how you changed the pixel size?
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
Phone: (978) 251-4242 Fax: (978) 251-1396
-----Original Message-----
Sent: Tuesday, March 18, 2003 10:03 AM
Subject: Re: [Gdal-dev] saving GeoTiff
ok sir, I figured out that the pixel size decides
how
long does the pixel represent in actual model
system
Post by Ed McNierney
units, as the scale factor for geograpich maps,
1. Now I just want to know, for the 4 mentioned
coordinate systems
"NAD27", "NAD83", "WGS72", "WGS84" what are the
units
of the model system?? I want to ask the user to
explain this for the user.
2. What are the ranges for valid data the user can
provide for the top left corner of image & for
pixel
Post by Ed McNierney
size.
3. I saved a certain image using GDAL and each
time
Post by Ed McNierney
changed the pixel size,and then opened this image
using GDAL and noticed that there was no
difference
Post by Ed McNierney
in
how the image looked like, I am sure of that. Can
you
explain?
Post by Frank Warmerdam
Post by Ayman Kamal
Then, if it can be derived, how can I do so,
If
Post by Ed McNierney
it
Post by Frank Warmerdam
Post by Ayman Kamal
can't, can you give me more explanation?
If you don't have enough time to answer me,
can
Post by Ed McNierney
Post by Frank Warmerdam
you
Post by Ayman Kamal
please givem me a link to a web page or
whatsoever
Post by Frank Warmerdam
Post by Ayman Kamal
resource that explains this. I need to
understand
Post by Frank Warmerdam
this
Post by Ayman Kamal
point THOROUGHLY.
Ayman,
I do not know off hand of a resouce that
discusses
Post by Ed McNierney
Post by Frank Warmerdam
this thoroughly. I would
suggest you review the information in the GDAL
data
Post by Frank Warmerdam
model document about
"Affine GeoTransform".
http://www.remotesensing.org/gdal/gdal_datamodel.html
Post by Ed McNierney
Post by Ed McNierney
Post by Frank Warmerdam
Best regards,
--
---------------------------------------+--------------------------------
Post by Ed McNierney
Post by Ed McNierney
------
Post by Frank Warmerdam
I set the clouds in motion - turn up | Frank
light and sound - activate the windows |
http://pobox.com/~warmerdam
and watch the world go round - Rush |
Geospatial
Post by Frank Warmerdam
Programmer for Rent
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
=== message truncated ===


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
Ed McNierney
2007-11-21 11:48:48 UTC
Permalink
Ayman -

What do you expect to see? Many viewers will load an image and display the entire image on the screen, or display the upper-left portion at 100% zoom - one pixel on the screen for each input pixel in the image. Both of these views are independent of the geographic coordinates or the pixel size, so changing those values won't change the image. They WILL change the coordinate information (for things like the "size and values of grids", so your description sounds exactly like what I would expect to see.

- Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
***@topozone.com
(978) 251-4242

-----Original Message-----
From: Ayman Kamal [mailto:***@yahoo.com]
Sent: Wednesday, March 19, 2003 10:34 AM
To: gdal-***@remotesensing.org
Subject: RE: [Gdal-dev] saving GeoTiff


Now, after I saved several GeoTiff files using
"gdal_translate" source as a program to modify the
settings of Geo data, I don't know what is the value
of the geo data saved???

By changing the values of adfGeoTransform[] elemets:
*I change the top left corner (longitude, lattitude)
*I change the pixel size

and when I open the image using different viewers, I
get the same image no matter what the values are, the
only change I see is the size and values of grids of
lattitude and longitude lines.

But how the imaage looks, or the height data that some
viewers show, are all unchanged.

Can you explain to me??
Post by Ed McNierney
Ayman -
Since you mention "latitude and longitude", I will
assume your data is
unprojected and in decimal degrees. If so, then the
"projection" is
usually called "unprojected" or "geographic" - you
need the datum and
the latitude and longitude to define a location.
If your data is in decimal degrees, then the units
of pixel size are in
decimal degrees. The values specified by the user
should be the size of
each pixel in degrees of latitude and degrees of
longitude. It is
unusual for raster data to be in decimal degrees, so
make sure that is
correct. Most raster data is projected.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
Phone: (978) 251-4242 Fax: (978) 251-1396
-----Original Message-----
Sent: Tuesday, March 18, 2003 10:42 AM
Subject: RE: [Gdal-dev] saving GeoTiff
1.
sorry sir if I was wrong when calling "NAD83",..
coordinate systems, but I referred to
http://gdal.velocet.ca/projects/opengis/ogrhtml/osr_tutorial.html
Post by Ed McNierney
"The OGRSpatialReference has built in support for a
few well known coordinate systems, which include
"NAD27", "NAD83", "WGS72" and "WGS84....."
2. I changed the pixel size by changing the values
of
adfGeoTransform[1]//horizental pixel size
adfGeoTransform[5]//vertical pixel size
in "gdal_translate" code.
I am sure that the pixel size was changed, as I
opened
the images in other softwares and noticed that the
size of the grid cells has changed accordingly.
I want to show a dialog the user that contains the
parametes he/she must fill to be able to generate a
correct GeoTiff image,
-I figuered out that I will ask him/her to choose
one
of "NAD83","NAD27","WGS72","WGS84"
-Ask him/her about the latitude and longitude of top
left corner
-Ask him/her about pixel size, and I mention the
unit
of size, so what does DATUM mean, and if he chooses
any of the DATUMs, what will the unit be?
Post by Ed McNierney
Ayman -
1. The four mentioned "coordinate systems" are
datums, not coordinate
systems. The "units of the model system" depend
upon the specific map
projection you are using. For example, I live in
Masschusetts, USA, and
locally we use the Massachusetts State Plane
coordinate system, which
can be implemented in either feet or meters. The
majority of projected
coordinate systems use meters, but the correct
value
Post by Ed McNierney
will depend on the
specific system you are using.
2. The top left corner coordinates and pixel size
are all floating-point
numbers and can accommodate any plausible numbers
you might have.
3. I don't think you have given us enough
information here - can you
explain exactly how you changed the pixel size?
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
Phone: (978) 251-4242 Fax: (978) 251-1396
-----Original Message-----
Sent: Tuesday, March 18, 2003 10:03 AM
Subject: Re: [Gdal-dev] saving GeoTiff
ok sir, I figured out that the pixel size decides
how
long does the pixel represent in actual model
system
Post by Ed McNierney
units, as the scale factor for geograpich maps,
1. Now I just want to know, for the 4 mentioned
coordinate systems
"NAD27", "NAD83", "WGS72", "WGS84" what are the
units
of the model system?? I want to ask the user to
explain this for the user.
2. What are the ranges for valid data the user can
provide for the top left corner of image & for
pixel
Post by Ed McNierney
size.
3. I saved a certain image using GDAL and each
time
Post by Ed McNierney
changed the pixel size,and then opened this image
using GDAL and noticed that there was no
difference
Post by Ed McNierney
in
how the image looked like, I am sure of that. Can
you
explain?
Post by Frank Warmerdam
Post by Ayman Kamal
Then, if it can be derived, how can I do so,
If
Post by Ed McNierney
it
Post by Frank Warmerdam
Post by Ayman Kamal
can't, can you give me more explanation?
If you don't have enough time to answer me,
can
Post by Ed McNierney
Post by Frank Warmerdam
you
Post by Ayman Kamal
please givem me a link to a web page or
whatsoever
Post by Frank Warmerdam
Post by Ayman Kamal
resource that explains this. I need to
understand
Post by Frank Warmerdam
this
Post by Ayman Kamal
point THOROUGHLY.
Ayman,
I do not know off hand of a resouce that
discusses
Post by Ed McNierney
Post by Frank Warmerdam
this thoroughly. I would
suggest you review the information in the GDAL
data
Post by Frank Warmerdam
model document about
"Affine GeoTransform".
http://www.remotesensing.org/gdal/gdal_datamodel.html
Post by Ed McNierney
Post by Ed McNierney
Post by Frank Warmerdam
Best regards,
--
---------------------------------------+--------------------------------
Post by Ed McNierney
Post by Ed McNierney
------
Post by Frank Warmerdam
I set the clouds in motion - turn up | Frank
light and sound - activate the windows |
http://pobox.com/~warmerdam
and watch the world go round - Rush |
Geospatial
Post by Frank Warmerdam
Programmer for Rent
_______________________________________________
Gdal-dev mailing list
http://remotesensing.org/mailman/listinfo/gdal-dev
=== message truncated ===


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
Sir,
What I want to make sure about is, if I don't care
about showing a grid for coordinates(long,lat), then
If I just take the raster data out of the geotiff
file, this will be adequate?

If we say yes for the above question, then if I open a
geotiff file and just read the raster data, I should
get the same view I have when opening it using a
GeoTiff viewer,

BUT what I notices when I started search about

GeoTiff, when opening geotiff files with ordinary
image viwers(not supporting geotiff) they showed the
image differnt from it appears in geotiff viewrs.

Can you PLEASE explain to me?
Post by Ed McNierney
Ayman -
What do you expect to see? Many viewers will load
an image and display the entire image on the screen,
or display the upper-left portion at 100% zoom - one
pixel on the screen for each input pixel in the
image. Both of these views are independent of the
geographic coordinates or the pixel size, so
changing those values won't change the image. They
WILL change the coordinate information (for things
like the "size and values of grids", so your
description sounds exactly like what I would expect
to see.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
(978) 251-4242
-----Original Message-----
Sent: Wednesday, March 19, 2003 10:34 AM
Subject: RE: [Gdal-dev] saving GeoTiff
Now, after I saved several GeoTiff files using
"gdal_translate" source as a program to modify the
settings of Geo data, I don't know what is the value
of the geo data saved???
*I change the top left corner (longitude, lattitude)
*I change the pixel size
and when I open the image using different viewers, I
get the same image no matter what the values are,
the
only change I see is the size and values of grids of
lattitude and longitude lines.
But how the imaage looks, or the height data that
some
viewers show, are all unchanged.
Can you explain to me??
Post by Ed McNierney
Ayman -
Since you mention "latitude and longitude", I will
assume your data is
unprojected and in decimal degrees. If so, then
the
Post by Ed McNierney
"projection" is
usually called "unprojected" or "geographic" - you
need the datum and
the latitude and longitude to define a location.
If your data is in decimal degrees, then the units
of pixel size are in
decimal degrees. The values specified by the user
should be the size of
each pixel in degrees of latitude and degrees of
longitude. It is
unusual for raster data to be in decimal degrees,
so
Post by Ed McNierney
make sure that is
correct. Most raster data is projected.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
Phone: (978) 251-4242 Fax: (978) 251-1396
-----Original Message-----
Sent: Tuesday, March 18, 2003 10:42 AM
Subject: RE: [Gdal-dev] saving GeoTiff
1.
sorry sir if I was wrong when calling "NAD83",..
coordinate systems, but I referred to
http://gdal.velocet.ca/projects/opengis/ogrhtml/osr_tutorial.html
Post by Ed McNierney
Post by Ed McNierney
"The OGRSpatialReference has built in support for
a
Post by Ed McNierney
few well known coordinate systems, which include
"NAD27", "NAD83", "WGS72" and "WGS84....."
2. I changed the pixel size by changing the values
of
adfGeoTransform[1]//horizental pixel size
adfGeoTransform[5]//vertical pixel size
in "gdal_translate" code.
I am sure that the pixel size was changed, as I
opened
the images in other softwares and noticed that the
size of the grid cells has changed accordingly.
I want to show a dialog the user that contains the
parametes he/she must fill to be able to generate
a
Post by Ed McNierney
correct GeoTiff image,
-I figuered out that I will ask him/her to choose
one
of "NAD83","NAD27","WGS72","WGS84"
-Ask him/her about the latitude and longitude of
top
Post by Ed McNierney
left corner
-Ask him/her about pixel size, and I mention the
unit
of size, so what does DATUM mean, and if he
chooses
Post by Ed McNierney
any of the DATUMs, what will the unit be?
Post by Ed McNierney
Ayman -
1. The four mentioned "coordinate systems" are
datums, not coordinate
systems. The "units of the model system" depend
upon the specific map
projection you are using. For example, I live
in
Post by Ed McNierney
Post by Ed McNierney
Masschusetts, USA, and
locally we use the Massachusetts State Plane
coordinate system, which
can be implemented in either feet or meters.
The
Post by Ed McNierney
Post by Ed McNierney
majority of projected
coordinate systems use meters, but the correct
value
Post by Ed McNierney
will depend on the
specific system you are using.
2. The top left corner coordinates and pixel
size
Post by Ed McNierney
Post by Ed McNierney
are all floating-point
numbers and can accommodate any plausible
numbers
Post by Ed McNierney
Post by Ed McNierney
you might have.
3. I don't think you have given us enough
information here - can you
explain exactly how you changed the pixel size?
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
Phone: (978) 251-4242 Fax: (978) 251-1396
-----Original Message-----
Sent: Tuesday, March 18, 2003 10:03 AM
Subject: Re: [Gdal-dev] saving GeoTiff
ok sir, I figured out that the pixel size
decides
Post by Ed McNierney
Post by Ed McNierney
how
long does the pixel represent in actual model
system
Post by Ed McNierney
units, as the scale factor for geograpich maps,
1. Now I just want to know, for the 4 mentioned
coordinate systems
"NAD27", "NAD83", "WGS72", "WGS84" what are the
units
of the model system?? I want to ask the user to
explain this for the user.
2. What are the ranges for valid data the user
can
Post by Ed McNierney
Post by Ed McNierney
provide for the top left corner of image & for
=== message truncated ===


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
Ed McNierney
2007-11-21 11:48:48 UTC
Permalink
Ayman -

YOU need to take the time to understand the viewing software you are using. Read the documentation and understand what it is supposed to do. Then, if you find your images do not work as you expect, you can explain what the problem seems to be.

If you find that an image appears different using two different viewers, first take time to understand what those viewers do and how they display images. It is certainly possible that two different viewers will display the same image two different ways; that's not surprising at all, and probably has nothing to do with GDAL.

- Ed

-----Original Message-----
From: Ayman Kamal [mailto:***@yahoo.com]
Sent: Wednesday, March 19, 2003 10:50 AM
To: gdal-***@remotesensing.org
Subject: RE: [Gdal-dev] saving GeoTiff


Sir,
What I want to make sure about is, if I don't care
about showing a grid for coordinates(long,lat), then
If I just take the raster data out of the geotiff
file, this will be adequate?

If we say yes for the above question, then if I open a
geotiff file and just read the raster data, I should
get the same view I have when opening it using a
GeoTiff viewer,

BUT what I notices when I started search about

GeoTiff, when opening geotiff files with ordinary
image viwers(not supporting geotiff) they showed the
image differnt from it appears in geotiff viewrs.

Can you PLEASE explain to me?
Post by Ed McNierney
Ayman -
What do you expect to see? Many viewers will load
an image and display the entire image on the screen,
or display the upper-left portion at 100% zoom - one
pixel on the screen for each input pixel in the
image. Both of these views are independent of the
geographic coordinates or the pixel size, so
changing those values won't change the image. They
WILL change the coordinate information (for things
like the "size and values of grids", so your
description sounds exactly like what I would expect
to see.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
(978) 251-4242
-----Original Message-----
Sent: Wednesday, March 19, 2003 10:34 AM
Subject: RE: [Gdal-dev] saving GeoTiff
Now, after I saved several GeoTiff files using
"gdal_translate" source as a program to modify the
settings of Geo data, I don't know what is the value
of the geo data saved???
*I change the top left corner (longitude, lattitude)
*I change the pixel size
and when I open the image using different viewers, I
get the same image no matter what the values are,
the
only change I see is the size and values of grids of
lattitude and longitude lines.
But how the imaage looks, or the height data that
some
viewers show, are all unchanged.
Can you explain to me??
Post by Ed McNierney
Ayman -
Since you mention "latitude and longitude", I will
assume your data is
unprojected and in decimal degrees. If so, then
the
Post by Ed McNierney
"projection" is
usually called "unprojected" or "geographic" - you
need the datum and
the latitude and longitude to define a location.
If your data is in decimal degrees, then the units
of pixel size are in
decimal degrees. The values specified by the user
should be the size of
each pixel in degrees of latitude and degrees of
longitude. It is
unusual for raster data to be in decimal degrees,
so
Post by Ed McNierney
make sure that is
correct. Most raster data is projected.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
Phone: (978) 251-4242 Fax: (978) 251-1396
-----Original Message-----
Sent: Tuesday, March 18, 2003 10:42 AM
Subject: RE: [Gdal-dev] saving GeoTiff
1.
sorry sir if I was wrong when calling "NAD83",..
coordinate systems, but I referred to
http://gdal.velocet.ca/projects/opengis/ogrhtml/osr_tutorial.html
Post by Ed McNierney
Post by Ed McNierney
"The OGRSpatialReference has built in support for
a
Post by Ed McNierney
few well known coordinate systems, which include
"NAD27", "NAD83", "WGS72" and "WGS84....."
2. I changed the pixel size by changing the values
of
adfGeoTransform[1]//horizental pixel size
adfGeoTransform[5]//vertical pixel size
in "gdal_translate" code.
I am sure that the pixel size was changed, as I
opened
the images in other softwares and noticed that the
size of the grid cells has changed accordingly.
I want to show a dialog the user that contains the
parametes he/she must fill to be able to generate
a
Post by Ed McNierney
correct GeoTiff image,
-I figuered out that I will ask him/her to choose
one
of "NAD83","NAD27","WGS72","WGS84"
-Ask him/her about the latitude and longitude of
top
Post by Ed McNierney
left corner
-Ask him/her about pixel size, and I mention the
unit
of size, so what does DATUM mean, and if he
chooses
Post by Ed McNierney
any of the DATUMs, what will the unit be?
Post by Ed McNierney
Ayman -
1. The four mentioned "coordinate systems" are
datums, not coordinate
systems. The "units of the model system" depend
upon the specific map
projection you are using. For example, I live
in
Post by Ed McNierney
Post by Ed McNierney
Masschusetts, USA, and
locally we use the Massachusetts State Plane
coordinate system, which
can be implemented in either feet or meters.
The
Post by Ed McNierney
Post by Ed McNierney
majority of projected
coordinate systems use meters, but the correct
value
Post by Ed McNierney
will depend on the
specific system you are using.
2. The top left corner coordinates and pixel
size
Post by Ed McNierney
Post by Ed McNierney
are all floating-point
numbers and can accommodate any plausible
numbers
Post by Ed McNierney
Post by Ed McNierney
you might have.
3. I don't think you have given us enough
information here - can you
explain exactly how you changed the pixel size?
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
Phone: (978) 251-4242 Fax: (978) 251-1396
-----Original Message-----
Sent: Tuesday, March 18, 2003 10:03 AM
Subject: Re: [Gdal-dev] saving GeoTiff
ok sir, I figured out that the pixel size
decides
Post by Ed McNierney
Post by Ed McNierney
how
long does the pixel represent in actual model
system
Post by Ed McNierney
units, as the scale factor for geograpich maps,
1. Now I just want to know, for the 4 mentioned
coordinate systems
"NAD27", "NAD83", "WGS72", "WGS84" what are the
units
of the model system?? I want to ask the user to
explain this for the user.
2. What are the ranges for valid data the user
can
Post by Ed McNierney
Post by Ed McNierney
provide for the top left corner of image & for
=== message truncated ===


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
Ayman Kamal
2007-11-21 11:48:48 UTC
Permalink
Maybe I misleaded you with my words,
what I want to know clearly is the answer to this
question:

The data saved in the geotiff file (other than raster
data) is data that specifies the coordinate location,
and this can appear clearly in the grid lines of long
and lat that some viewers show,

BUT this coordinate data, doesn't affect by any means
the raster data or how it is viewed.

AND what is mentioned in the geotiff specification
about geo keys and geo data, is about the data that is
saved in the geotiff file which is extracted to show
the coordinate grids only.
Post by Ed McNierney
Ayman -
YOU need to take the time to understand the viewing
software you are using. Read the documentation and
understand what it is supposed to do. Then, if you
find your images do not work as you expect, you can
explain what the problem seems to be.
If you find that an image appears different using
two different viewers, first take time to understand
what those viewers do and how they display images.
It is certainly possible that two different viewers
will display the same image two different ways;
that's not surprising at all, and probably has
nothing to do with GDAL.
- Ed
-----Original Message-----
Sent: Wednesday, March 19, 2003 10:50 AM
Subject: RE: [Gdal-dev] saving GeoTiff
Sir,
What I want to make sure about is, if I don't care
about showing a grid for coordinates(long,lat), then
If I just take the raster data out of the geotiff
file, this will be adequate?
If we say yes for the above question, then if I open
a
geotiff file and just read the raster data, I should
get the same view I have when opening it using a
GeoTiff viewer,
BUT what I notices when I started search about
GeoTiff, when opening geotiff files with ordinary
image viwers(not supporting geotiff) they showed the
image differnt from it appears in geotiff viewrs.
Can you PLEASE explain to me?
Post by Ed McNierney
Ayman -
What do you expect to see? Many viewers will load
an image and display the entire image on the
screen,
Post by Ed McNierney
or display the upper-left portion at 100% zoom -
one
Post by Ed McNierney
pixel on the screen for each input pixel in the
image. Both of these views are independent of the
geographic coordinates or the pixel size, so
changing those values won't change the image.
They
Post by Ed McNierney
WILL change the coordinate information (for things
like the "size and values of grids", so your
description sounds exactly like what I would
expect
Post by Ed McNierney
to see.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
(978) 251-4242
-----Original Message-----
Sent: Wednesday, March 19, 2003 10:34 AM
Subject: RE: [Gdal-dev] saving GeoTiff
Now, after I saved several GeoTiff files using
"gdal_translate" source as a program to modify the
settings of Geo data, I don't know what is the
value
Post by Ed McNierney
of the geo data saved???
By changing the values of adfGeoTransform[]
*I change the top left corner (longitude,
lattitude)
Post by Ed McNierney
*I change the pixel size
and when I open the image using different viewers,
I
Post by Ed McNierney
get the same image no matter what the values are,
the
only change I see is the size and values of grids
of
Post by Ed McNierney
lattitude and longitude lines.
But how the imaage looks, or the height data that
some
viewers show, are all unchanged.
Can you explain to me??
Post by Ed McNierney
Ayman -
Since you mention "latitude and longitude", I
will
Post by Ed McNierney
Post by Ed McNierney
assume your data is
unprojected and in decimal degrees. If so, then
the
Post by Ed McNierney
"projection" is
usually called "unprojected" or "geographic" -
you
Post by Ed McNierney
Post by Ed McNierney
need the datum and
the latitude and longitude to define a location.
If your data is in decimal degrees, then the
units
Post by Ed McNierney
Post by Ed McNierney
of pixel size are in
decimal degrees. The values specified by the
user
Post by Ed McNierney
Post by Ed McNierney
should be the size of
each pixel in degrees of latitude and degrees of
longitude. It is
unusual for raster data to be in decimal
degrees,
Post by Ed McNierney
so
Post by Ed McNierney
make sure that is
correct. Most raster data is projected.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
Phone: (978) 251-4242 Fax: (978) 251-1396
-----Original Message-----
Sent: Tuesday, March 18, 2003 10:42 AM
Subject: RE: [Gdal-dev] saving GeoTiff
1.
sorry sir if I was wrong when calling "NAD83",..
coordinate systems, but I referred to
http://gdal.velocet.ca/projects/opengis/ogrhtml/osr_tutorial.html
Post by Ed McNierney
Post by Ed McNierney
Post by Ed McNierney
"The OGRSpatialReference has built in support
for
Post by Ed McNierney
a
Post by Ed McNierney
few well known coordinate systems, which include
"NAD27", "NAD83", "WGS72" and "WGS84....."
2. I changed the pixel size by changing the
values
Post by Ed McNierney
Post by Ed McNierney
of
adfGeoTransform[1]//horizental pixel size
adfGeoTransform[5]//vertical pixel size
in "gdal_translate" code.
I am sure that the pixel size was changed, as I
opened
the images in other softwares and noticed that
the
Post by Ed McNierney
Post by Ed McNierney
size of the grid cells has changed accordingly.
I want to show a dialog the user that contains
the
Post by Ed McNierney
Post by Ed McNierney
parametes he/she must fill to be able to
generate
Post by Ed McNierney
a
Post by Ed McNierney
correct GeoTiff image,
-I figuered out that I will ask him/her to
choose
Post by Ed McNierney
Post by Ed McNierney
one
of "NAD83","NAD27","WGS72","WGS84"
-Ask him/her about the latitude and longitude of
top
Post by Ed McNierney
left corner
-Ask him/her about pixel size, and I mention the
unit
of size, so what does DATUM mean, and if he
=== message truncated ===


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
Ayman Kamal
2007-11-21 11:48:49 UTC
Permalink
Please reply to my email, I need an answer ASAP,
is it correct what I mention below?
------------------------------------------------------
------------------------------------------------------
Post by Ayman Kamal
Maybe I misleaded you with my words,
what I want to know clearly is the answer to this
The data saved in the geotiff file (other than
raster
data) is data that specifies the coordinate
location,
and this can appear clearly in the grid lines of
long
and lat that some viewers show,
BUT this coordinate data, doesn't affect by any
means
the raster data or how it is viewed.
AND what is mentioned in the geotiff specification
about geo keys and geo data, is about the data that
is
saved in the geotiff file which is extracted to show
the coordinate grids only.
------------------------------------------------------
------------------------------------------------------
Post by Ayman Kamal
Post by Ed McNierney
Ayman -
YOU need to take the time to understand the
viewing
Post by Ed McNierney
software you are using. Read the documentation
and
Post by Ed McNierney
understand what it is supposed to do. Then, if
you
Post by Ed McNierney
find your images do not work as you expect, you
can
Post by Ed McNierney
explain what the problem seems to be.
If you find that an image appears different using
two different viewers, first take time to
understand
Post by Ed McNierney
what those viewers do and how they display images.
It is certainly possible that two different
viewers
Post by Ed McNierney
will display the same image two different ways;
that's not surprising at all, and probably has
nothing to do with GDAL.
- Ed
-----Original Message-----
Sent: Wednesday, March 19, 2003 10:50 AM
Subject: RE: [Gdal-dev] saving GeoTiff
Sir,
What I want to make sure about is, if I don't care
about showing a grid for coordinates(long,lat),
then
Post by Ed McNierney
If I just take the raster data out of the geotiff
file, this will be adequate?
If we say yes for the above question, then if I
open
Post by Ed McNierney
a
geotiff file and just read the raster data, I
should
Post by Ed McNierney
get the same view I have when opening it using a
GeoTiff viewer,
BUT what I notices when I started search about
GeoTiff, when opening geotiff files with ordinary
image viwers(not supporting geotiff) they showed
the
Post by Ed McNierney
image differnt from it appears in geotiff viewrs.
Can you PLEASE explain to me?
Post by Ed McNierney
Ayman -
What do you expect to see? Many viewers will
load
Post by Ed McNierney
Post by Ed McNierney
an image and display the entire image on the
screen,
Post by Ed McNierney
or display the upper-left portion at 100% zoom -
one
Post by Ed McNierney
pixel on the screen for each input pixel in the
image. Both of these views are independent of
the
Post by Ed McNierney
Post by Ed McNierney
geographic coordinates or the pixel size, so
changing those values won't change the image.
They
Post by Ed McNierney
WILL change the coordinate information (for
things
Post by Ed McNierney
Post by Ed McNierney
like the "size and values of grids", so your
description sounds exactly like what I would
expect
Post by Ed McNierney
to see.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
(978) 251-4242
-----Original Message-----
Sent: Wednesday, March 19, 2003 10:34 AM
Subject: RE: [Gdal-dev] saving GeoTiff
Now, after I saved several GeoTiff files using
"gdal_translate" source as a program to modify
the
Post by Ed McNierney
Post by Ed McNierney
settings of Geo data, I don't know what is the
value
Post by Ed McNierney
of the geo data saved???
By changing the values of adfGeoTransform[]
*I change the top left corner (longitude,
lattitude)
Post by Ed McNierney
*I change the pixel size
and when I open the image using different
viewers,
Post by Ed McNierney
I
Post by Ed McNierney
get the same image no matter what the values
are,
Post by Ed McNierney
Post by Ed McNierney
the
only change I see is the size and values of
grids
Post by Ed McNierney
of
Post by Ed McNierney
lattitude and longitude lines.
But how the imaage looks, or the height data
that
Post by Ed McNierney
Post by Ed McNierney
some
viewers show, are all unchanged.
Can you explain to me??
Post by Ed McNierney
Ayman -
Since you mention "latitude and longitude", I
will
Post by Ed McNierney
Post by Ed McNierney
assume your data is
unprojected and in decimal degrees. If so,
then
Post by Ed McNierney
Post by Ed McNierney
the
Post by Ed McNierney
"projection" is
usually called "unprojected" or "geographic" -
you
Post by Ed McNierney
Post by Ed McNierney
need the datum and
the latitude and longitude to define a
location.
Post by Ed McNierney
Post by Ed McNierney
Post by Ed McNierney
If your data is in decimal degrees, then the
units
Post by Ed McNierney
Post by Ed McNierney
of pixel size are in
decimal degrees. The values specified by the
user
Post by Ed McNierney
Post by Ed McNierney
should be the size of
each pixel in degrees of latitude and degrees
of
Post by Ed McNierney
Post by Ed McNierney
Post by Ed McNierney
longitude. It is
unusual for raster data to be in decimal
degrees,
Post by Ed McNierney
so
Post by Ed McNierney
make sure that is
correct. Most raster data is projected.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
Phone: (978) 251-4242 Fax: (978) 251-1396
-----Original Message-----
Sent: Tuesday, March 18, 2003 10:42 AM
Subject: RE: [Gdal-dev] saving GeoTiff
1.
=== message truncated ===


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
Ed McNierney
2007-11-21 11:48:49 UTC
Permalink
Ayman -

You should ask that question to the developer of the viewing program you are using. It's entirely up to that program to decide what data it uses or does not use when displaying an image.

- Ed

-----Original Message-----
From: Ayman Kamal [mailto:***@yahoo.com]
Sent: Wednesday, March 19, 2003 11:11 AM
To: gdal-***@remotesensing.org
Subject: RE: [Gdal-dev] saving GeoTiff


Maybe I misleaded you with my words,
what I want to know clearly is the answer to this
question:

The data saved in the geotiff file (other than raster
data) is data that specifies the coordinate location,
and this can appear clearly in the grid lines of long
and lat that some viewers show,

BUT this coordinate data, doesn't affect by any means
the raster data or how it is viewed.

AND what is mentioned in the geotiff specification
about geo keys and geo data, is about the data that is
saved in the geotiff file which is extracted to show
the coordinate grids only.
Post by Ed McNierney
Ayman -
YOU need to take the time to understand the viewing
software you are using. Read the documentation and
understand what it is supposed to do. Then, if you
find your images do not work as you expect, you can
explain what the problem seems to be.
If you find that an image appears different using
two different viewers, first take time to understand
what those viewers do and how they display images.
It is certainly possible that two different viewers
will display the same image two different ways;
that's not surprising at all, and probably has
nothing to do with GDAL.
- Ed
-----Original Message-----
Sent: Wednesday, March 19, 2003 10:50 AM
Subject: RE: [Gdal-dev] saving GeoTiff
Sir,
What I want to make sure about is, if I don't care
about showing a grid for coordinates(long,lat), then
If I just take the raster data out of the geotiff
file, this will be adequate?
If we say yes for the above question, then if I open
a
geotiff file and just read the raster data, I should
get the same view I have when opening it using a
GeoTiff viewer,
BUT what I notices when I started search about
GeoTiff, when opening geotiff files with ordinary
image viwers(not supporting geotiff) they showed the
image differnt from it appears in geotiff viewrs.
Can you PLEASE explain to me?
Post by Ed McNierney
Ayman -
What do you expect to see? Many viewers will load
an image and display the entire image on the
screen,
Post by Ed McNierney
or display the upper-left portion at 100% zoom -
one
Post by Ed McNierney
pixel on the screen for each input pixel in the
image. Both of these views are independent of the
geographic coordinates or the pixel size, so
changing those values won't change the image.
They
Post by Ed McNierney
WILL change the coordinate information (for things
like the "size and values of grids", so your
description sounds exactly like what I would
expect
Post by Ed McNierney
to see.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
(978) 251-4242
-----Original Message-----
Sent: Wednesday, March 19, 2003 10:34 AM
Subject: RE: [Gdal-dev] saving GeoTiff
Now, after I saved several GeoTiff files using
"gdal_translate" source as a program to modify the
settings of Geo data, I don't know what is the
value
Post by Ed McNierney
of the geo data saved???
By changing the values of adfGeoTransform[]
*I change the top left corner (longitude,
lattitude)
Post by Ed McNierney
*I change the pixel size
and when I open the image using different viewers,
I
Post by Ed McNierney
get the same image no matter what the values are,
the
only change I see is the size and values of grids
of
Post by Ed McNierney
lattitude and longitude lines.
But how the imaage looks, or the height data that
some
viewers show, are all unchanged.
Can you explain to me??
Post by Ed McNierney
Ayman -
Since you mention "latitude and longitude", I
will
Post by Ed McNierney
Post by Ed McNierney
assume your data is
unprojected and in decimal degrees. If so, then
the
Post by Ed McNierney
"projection" is
usually called "unprojected" or "geographic" -
you
Post by Ed McNierney
Post by Ed McNierney
need the datum and
the latitude and longitude to define a location.
If your data is in decimal degrees, then the
units
Post by Ed McNierney
Post by Ed McNierney
of pixel size are in
decimal degrees. The values specified by the
user
Post by Ed McNierney
Post by Ed McNierney
should be the size of
each pixel in degrees of latitude and degrees of
longitude. It is
unusual for raster data to be in decimal
degrees,
Post by Ed McNierney
so
Post by Ed McNierney
make sure that is
correct. Most raster data is projected.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
Phone: (978) 251-4242 Fax: (978) 251-1396
-----Original Message-----
Sent: Tuesday, March 18, 2003 10:42 AM
Subject: RE: [Gdal-dev] saving GeoTiff
1.
sorry sir if I was wrong when calling "NAD83",..
coordinate systems, but I referred to
http://gdal.velocet.ca/projects/opengis/ogrhtml/osr_tutorial.html
Post by Ed McNierney
Post by Ed McNierney
Post by Ed McNierney
"The OGRSpatialReference has built in support
for
Post by Ed McNierney
a
Post by Ed McNierney
few well known coordinate systems, which include
"NAD27", "NAD83", "WGS72" and "WGS84....."
2. I changed the pixel size by changing the
values
Post by Ed McNierney
Post by Ed McNierney
of
adfGeoTransform[1]//horizental pixel size
adfGeoTransform[5]//vertical pixel size
in "gdal_translate" code.
I am sure that the pixel size was changed, as I
opened
the images in other softwares and noticed that
the
Post by Ed McNierney
Post by Ed McNierney
size of the grid cells has changed accordingly.
I want to show a dialog the user that contains
the
Post by Ed McNierney
Post by Ed McNierney
parametes he/she must fill to be able to
generate
Post by Ed McNierney
a
Post by Ed McNierney
correct GeoTiff image,
-I figuered out that I will ask him/her to
choose
Post by Ed McNierney
Post by Ed McNierney
one
of "NAD83","NAD27","WGS72","WGS84"
-Ask him/her about the latitude and longitude of
top
Post by Ed McNierney
left corner
-Ask him/her about pixel size, and I mention the
unit
of size, so what does DATUM mean, and if he
=== message truncated ===


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
Ayman Kamal
2007-11-21 11:48:49 UTC
Permalink
Sorry, but your answer didn't help me.
What I wanted to know simply is
If I convert a GeoTiff file to a BMP file using
"gdal_translate"

Is the data that I will get in t the resulting BMP
file is just the raster data found in the GeoTiff
file, or does the geotiff data saved in the GeoTiff
file affect how the resulting BMP file will look like?
Post by Ed McNierney
Ayman -
You should ask that question to the developer of the
viewing program you are using. It's entirely up to
that program to decide what data it uses or does not
use when displaying an image.
- Ed
-----Original Message-----
Sent: Wednesday, March 19, 2003 11:11 AM
Subject: RE: [Gdal-dev] saving GeoTiff
Maybe I misleaded you with my words,
what I want to know clearly is the answer to this
The data saved in the geotiff file (other than
raster
data) is data that specifies the coordinate
location,
and this can appear clearly in the grid lines of
long
and lat that some viewers show,
BUT this coordinate data, doesn't affect by any
means
the raster data or how it is viewed.
AND what is mentioned in the geotiff specification
about geo keys and geo data, is about the data that
is
saved in the geotiff file which is extracted to show
the coordinate grids only.
Post by Ed McNierney
Ayman -
YOU need to take the time to understand the
viewing
Post by Ed McNierney
software you are using. Read the documentation
and
Post by Ed McNierney
understand what it is supposed to do. Then, if
you
Post by Ed McNierney
find your images do not work as you expect, you
can
Post by Ed McNierney
explain what the problem seems to be.
If you find that an image appears different using
two different viewers, first take time to
understand
Post by Ed McNierney
what those viewers do and how they display images.
It is certainly possible that two different
viewers
Post by Ed McNierney
will display the same image two different ways;
that's not surprising at all, and probably has
nothing to do with GDAL.
- Ed
-----Original Message-----
Sent: Wednesday, March 19, 2003 10:50 AM
Subject: RE: [Gdal-dev] saving GeoTiff
Sir,
What I want to make sure about is, if I don't care
about showing a grid for coordinates(long,lat),
then
Post by Ed McNierney
If I just take the raster data out of the geotiff
file, this will be adequate?
If we say yes for the above question, then if I
open
Post by Ed McNierney
a
geotiff file and just read the raster data, I
should
Post by Ed McNierney
get the same view I have when opening it using a
GeoTiff viewer,
BUT what I notices when I started search about
GeoTiff, when opening geotiff files with ordinary
image viwers(not supporting geotiff) they showed
the
Post by Ed McNierney
image differnt from it appears in geotiff viewrs.
Can you PLEASE explain to me?
Post by Ed McNierney
Ayman -
What do you expect to see? Many viewers will
load
Post by Ed McNierney
Post by Ed McNierney
an image and display the entire image on the
screen,
Post by Ed McNierney
or display the upper-left portion at 100% zoom -
one
Post by Ed McNierney
pixel on the screen for each input pixel in the
image. Both of these views are independent of
the
Post by Ed McNierney
Post by Ed McNierney
geographic coordinates or the pixel size, so
changing those values won't change the image.
They
Post by Ed McNierney
WILL change the coordinate information (for
things
Post by Ed McNierney
Post by Ed McNierney
like the "size and values of grids", so your
description sounds exactly like what I would
expect
Post by Ed McNierney
to see.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
(978) 251-4242
-----Original Message-----
Sent: Wednesday, March 19, 2003 10:34 AM
Subject: RE: [Gdal-dev] saving GeoTiff
Now, after I saved several GeoTiff files using
"gdal_translate" source as a program to modify
the
Post by Ed McNierney
Post by Ed McNierney
settings of Geo data, I don't know what is the
value
Post by Ed McNierney
of the geo data saved???
By changing the values of adfGeoTransform[]
*I change the top left corner (longitude,
lattitude)
Post by Ed McNierney
*I change the pixel size
and when I open the image using different
viewers,
Post by Ed McNierney
I
Post by Ed McNierney
get the same image no matter what the values
are,
Post by Ed McNierney
Post by Ed McNierney
the
only change I see is the size and values of
grids
Post by Ed McNierney
of
Post by Ed McNierney
lattitude and longitude lines.
But how the imaage looks, or the height data
that
Post by Ed McNierney
Post by Ed McNierney
some
viewers show, are all unchanged.
Can you explain to me??
Post by Ed McNierney
Ayman -
Since you mention "latitude and longitude", I
will
Post by Ed McNierney
Post by Ed McNierney
assume your data is
unprojected and in decimal degrees. If so,
then
Post by Ed McNierney
Post by Ed McNierney
the
Post by Ed McNierney
"projection" is
usually called "unprojected" or "geographic" -
you
Post by Ed McNierney
Post by Ed McNierney
need the datum and
the latitude and longitude to define a
location.
Post by Ed McNierney
Post by Ed McNierney
Post by Ed McNierney
If your data is in decimal degrees, then the
units
Post by Ed McNierney
Post by Ed McNierney
of pixel size are in
decimal degrees. The values specified by the
user
Post by Ed McNierney
Post by Ed McNierney
should be the size of
each pixel in degrees of latitude and degrees
of
Post by Ed McNierney
Post by Ed McNierney
Post by Ed McNierney
longitude. It is
unusual for raster data to be in decimal
degrees,
Post by Ed McNierney
so
Post by Ed McNierney
make sure that is
correct. Most raster data is projected.
- Ed
=== message truncated ===


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
Simon Perkins
2007-11-21 11:48:49 UTC
Permalink
Post by Ayman Kamal
Sorry, but your answer didn't help me.
What I wanted to know simply is
If I convert a GeoTiff file to a BMP file using
"gdal_translate"
Is the data that I will get in t the resulting BMP
file is just the raster data found in the GeoTiff
file, or does the geotiff data saved in the GeoTiff
file affect how the resulting BMP file will look like?
Ayman,

It might help to clarify a few basic concepts:

- Image formats that support geo-referenced data (e.g. GeoTIFF, HFA,
etc) contain two pieces of information:

* A "raster" containing one or more rectangular bands of image pixels.

* Geo-reference data specifying such things as location of the corners
of the image in some specified coordinate frame.

- Image formats that don't generally support geo-referenced information
(e.g. GIF, JPEG, TIFF) contain just the raster data.

- A GeoTIFF file is simply a regular TIFF file, with additional special
keywords that indicate geo-referencing information. These keywords are
ignored by applications that understand TIFF files, but don't have any
special knowledge of GeoTIFF.

- In general mage viewing software may, or may not, make use of any
geo-referencing data (if present), when deciding how to display the
raster of pixels in an image file. So a geo-referenced GeoTIFF file may
look different in different viewers.

- If you convert from a geo-referenced format (e.g. GeoTIFF) to a format
that does not support geo-referencing (e.g. GIF) then you may well just
be copying the raster data from one file to another, and the
geo-referencing information will not change the raster information at
all. This is the default behavior for gdal_translate, but I think you
can do some image-reprojection with appropriate options.

- I believe that the BMP format under GDAL supports geo-referencing only
through the creation of a separate worldfile (but I could be way off
target here).


Your questions to date seem to reflect a misunderstanding of one or more
of the above points, so please try to reformulate your question in the
above terms, and there might be chance that someone can help you.

Cheers,

Sy
Ed McNierney
2007-11-21 11:48:49 UTC
Permalink
Ayman -

It seems from your earlier emails that you already have done this and you know the answer to your question. You have reported that changing only the georeference data in the GeoTIFF does not change the appearance of the BMP file, correct?

You're being a little confusing in saying "the raster data" when it seems that you mean "the BMP file generated by gdal_translate". There's raster data in the GeoTIFF file, and when you ask "does changing the georeference data modify the raster data", I assume you're talking about the raster data inside the GeoTIFF file.

- Ed

-----Original Message-----
From: Ayman Kamal [mailto:***@yahoo.com]
Sent: Thursday, March 20, 2003 11:06 AM
To: gdal-***@remotesensing.org
Subject: RE: [Gdal-dev] saving GeoTiff


Sorry, but your answer didn't help me.
What I wanted to know simply is
If I convert a GeoTiff file to a BMP file using
"gdal_translate"

Is the data that I will get in t the resulting BMP
file is just the raster data found in the GeoTiff
file, or does the geotiff data saved in the GeoTiff
file affect how the resulting BMP file will look like?
Post by Ed McNierney
Ayman -
You should ask that question to the developer of the
viewing program you are using. It's entirely up to
that program to decide what data it uses or does not
use when displaying an image.
- Ed
-----Original Message-----
Sent: Wednesday, March 19, 2003 11:11 AM
Subject: RE: [Gdal-dev] saving GeoTiff
Maybe I misleaded you with my words,
what I want to know clearly is the answer to this
The data saved in the geotiff file (other than
raster
data) is data that specifies the coordinate
location,
and this can appear clearly in the grid lines of
long
and lat that some viewers show,
BUT this coordinate data, doesn't affect by any
means
the raster data or how it is viewed.
AND what is mentioned in the geotiff specification
about geo keys and geo data, is about the data that
is
saved in the geotiff file which is extracted to show
the coordinate grids only.
Post by Ed McNierney
Ayman -
YOU need to take the time to understand the
viewing
Post by Ed McNierney
software you are using. Read the documentation
and
Post by Ed McNierney
understand what it is supposed to do. Then, if
you
Post by Ed McNierney
find your images do not work as you expect, you
can
Post by Ed McNierney
explain what the problem seems to be.
If you find that an image appears different using
two different viewers, first take time to
understand
Post by Ed McNierney
what those viewers do and how they display images.
It is certainly possible that two different
viewers
Post by Ed McNierney
will display the same image two different ways;
that's not surprising at all, and probably has
nothing to do with GDAL.
- Ed
-----Original Message-----
Sent: Wednesday, March 19, 2003 10:50 AM
Subject: RE: [Gdal-dev] saving GeoTiff
Sir,
What I want to make sure about is, if I don't care
about showing a grid for coordinates(long,lat),
then
Post by Ed McNierney
If I just take the raster data out of the geotiff
file, this will be adequate?
If we say yes for the above question, then if I
open
Post by Ed McNierney
a
geotiff file and just read the raster data, I
should
Post by Ed McNierney
get the same view I have when opening it using a
GeoTiff viewer,
BUT what I notices when I started search about
GeoTiff, when opening geotiff files with ordinary
image viwers(not supporting geotiff) they showed
the
Post by Ed McNierney
image differnt from it appears in geotiff viewrs.
Can you PLEASE explain to me?
Post by Ed McNierney
Ayman -
What do you expect to see? Many viewers will
load
Post by Ed McNierney
Post by Ed McNierney
an image and display the entire image on the
screen,
Post by Ed McNierney
or display the upper-left portion at 100% zoom -
one
Post by Ed McNierney
pixel on the screen for each input pixel in the
image. Both of these views are independent of
the
Post by Ed McNierney
Post by Ed McNierney
geographic coordinates or the pixel size, so
changing those values won't change the image.
They
Post by Ed McNierney
WILL change the coordinate information (for
things
Post by Ed McNierney
Post by Ed McNierney
like the "size and values of grids", so your
description sounds exactly like what I would
expect
Post by Ed McNierney
to see.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
(978) 251-4242
-----Original Message-----
Sent: Wednesday, March 19, 2003 10:34 AM
Subject: RE: [Gdal-dev] saving GeoTiff
Now, after I saved several GeoTiff files using
"gdal_translate" source as a program to modify
the
Post by Ed McNierney
Post by Ed McNierney
settings of Geo data, I don't know what is the
value
Post by Ed McNierney
of the geo data saved???
By changing the values of adfGeoTransform[]
*I change the top left corner (longitude,
lattitude)
Post by Ed McNierney
*I change the pixel size
and when I open the image using different
viewers,
Post by Ed McNierney
I
Post by Ed McNierney
get the same image no matter what the values
are,
Post by Ed McNierney
Post by Ed McNierney
the
only change I see is the size and values of
grids
Post by Ed McNierney
of
Post by Ed McNierney
lattitude and longitude lines.
But how the imaage looks, or the height data
that
Post by Ed McNierney
Post by Ed McNierney
some
viewers show, are all unchanged.
Can you explain to me??
Post by Ed McNierney
Ayman -
Since you mention "latitude and longitude", I
will
Post by Ed McNierney
Post by Ed McNierney
assume your data is
unprojected and in decimal degrees. If so,
then
Post by Ed McNierney
Post by Ed McNierney
the
Post by Ed McNierney
"projection" is
usually called "unprojected" or "geographic" -
you
Post by Ed McNierney
Post by Ed McNierney
need the datum and
the latitude and longitude to define a
location.
Post by Ed McNierney
Post by Ed McNierney
Post by Ed McNierney
If your data is in decimal degrees, then the
units
Post by Ed McNierney
Post by Ed McNierney
of pixel size are in
decimal degrees. The values specified by the
user
Post by Ed McNierney
Post by Ed McNierney
should be the size of
each pixel in degrees of latitude and degrees
of
Post by Ed McNierney
Post by Ed McNierney
Post by Ed McNierney
longitude. It is
unusual for raster data to be in decimal
degrees,
Post by Ed McNierney
so
Post by Ed McNierney
make sure that is
correct. Most raster data is projected.
- Ed
=== message truncated ===


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
David.Hildebrand at gov.ab.ca ()
2007-11-21 11:48:57 UTC
Permalink
I have been trying to use gdal_translate with an HDF MODIS file. How do I
specify a specific SDS from the file? Do I specify it with the band
parameter or as part of the filename? In the example below I want to
extract the first band from the "EV_1KM_RefSB" SDS and create aTIF file.

gdal_translate -ot UInt16 -b 2:1
Z:\modis\MOD021KM.A2003169.1845.004.2003170123719.hdf test
Input file contains subdatasets. Please, select one of them for reading.

Any help would certainly be appreciated.

Till later,
-----------------------------------------------
David V. Hildebrand
Conservation and Development Branch
Alberta Agriculture, Food and Rural Development
(780) 427-3558

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20031022/94d35064/attachment.html
Andrey Kiselev
2007-11-21 11:48:57 UTC
Permalink
Post by David.Hildebrand at gov.ab.ca ()
I have been trying to use gdal_translate with an HDF MODIS file. How do I
specify a specific SDS from the file? Do I specify it with the band
parameter or as part of the filename? In the example below I want to
extract the first band from the "EV_1KM_RefSB" SDS and create aTIF file.
gdal_translate -ot UInt16 -b 2:1
Z:\modis\MOD021KM.A2003169.1845.004.2003170123719.hdf test
Input file contains subdatasets. Please, select one of them for reading.
HDF files may contain several differently sized subdatasets. So you
should select one of them to proceed. First, use gdalinfo to get a list
of subdatasets with names and properties:

$ gdalinfo MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf
Driver: HDF4/Hierarchical Data Format Release 4
Size is 512, 512
Coordinate System is `'
Metadata:
HDFEOSVersion=HDFEOS_V2.6
LOCALGRANULEID=MOD021KM.A2001140.0715.002.2001144040827.hdf
PRODUCTIONDATETIME=2001-05-24T04:08:27.000Z
DAYNIGHTFLAG=Day

... skipped ...

Subdatasets:
SUBDATASET_1_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":2
SUBDATASET_1_DESC=[15x408x271] EV_1KM_RefSB (16-bit unsigned integer)
SUBDATASET_2_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":3
SUBDATASET_2_DESC=[15x408x271] EV_1KM_RefSB_Uncert_Indexes (8-bit unsigned integer)
SUBDATASET_3_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":4
SUBDATASET_3_DESC=[16x408x271] EV_1KM_Emissive (16-bit unsigned integer)
SUBDATASET_4_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":5
SUBDATASET_4_DESC=[16x408x271] EV_1KM_Emissive_Uncert_Indexes (8-bit unsigned integer)
SUBDATASET_5_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":6
SUBDATASET_5_DESC=[2x408x271] EV_250_Aggr1km_RefSB (16-bit unsigned integer)
SUBDATASET_6_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":7
SUBDATASET_6_DESC=[2x408x271] EV_250_Aggr1km_RefSB_Uncert_Indexes (8-bit unsigned integer)
SUBDATASET_7_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":8
SUBDATASET_7_DESC=[2x408x271] EV_250_Aggr1km_RefSB_Samples_Used (8-bit integer)
SUBDATASET_8_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":9
SUBDATASET_8_DESC=[5x408x271] EV_500_Aggr1km_RefSB (16-bit unsigned integer)
SUBDATASET_9_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":10
SUBDATASET_9_DESC=[5x408x271] EV_500_Aggr1km_RefSB_Uncert_Indexes (8-bit unsigned integer)
SUBDATASET_10_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":11
SUBDATASET_10_DESC=[5x408x271] EV_500_Aggr1km_RefSB_Samples_Used (8-bit integer)
SUBDATASET_11_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":19
SUBDATASET_11_DESC=[408x271] EV_Band26 (16-bit unsigned integer)
SUBDATASET_12_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":20
SUBDATASET_12_DESC=[408x271] EV_Band26_Uncert_Indexes (8-bit unsigned integer)
Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 512.0)
Upper Right ( 512.0, 0.0)
Lower Right ( 512.0, 512.0)
Center ( 256.0, 256.0)

Corner coordinates are just a placeholders, don't pay attention on them.
Now you see how much GDAL supported subdatasets could be extracted from
the file and you can select the one. For example, take the first one,
described as "[15x408x271] EV_1KM_RefSB (16-bit unsigned integer)":

$ gdal_translate HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":2 out.tif

Note, that resulting TIFF will have 15 bands and size 271x408.
Slightly complicated, but it is the only way to use non-interactive
tools.

Regards,
Andrey
--
Andrey V. Kiselev
Home phone: +7 812 5274898 ICQ# 26871517
David.Hildebrand at gov.ab.ca ()
2007-11-21 11:48:57 UTC
Permalink
Skipped content of type multipart/alternative-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdalinfo.log
Type: application/octet-stream
Size: 34633 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20031023/4f933242/gdalinfo.obj
Andrey Kiselev
2007-11-21 11:48:57 UTC
Permalink
I have done all the right things (I think) and yet I get no error message
Z:\modis>X:\downloads\gdal\openev_fw\bin\gdal_translate.exe -b 1
HDF4_SDS:MODIS_L1B:"MOD021KM.A2003169.1845.004.2003170123719.hdf":2
out.tif
I am in the directory of the HDF file. The executable is in another
directory. I want to extract the first band from the MODIS file. The
output from gdalinfo is attached.
Looks as all going right... I can't realize whats wrong. Try to set
environmental variable CPL_DEBUG=ON before gdal_translate. It will
enable additional debug output. And gdalinfo results on requested
subdataset (i.e.
HDF4_SDS:MODIS_L1B:"MOD021KM.A2003169.1845.004.2003170123719.hdf":2)
will be good as well.

Andrey
--
Andrey V. Kiselev
Home phone: +7 812 5274898 ICQ# 26871517
Continue reading on narkive:
Loading...