<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear GDAL Development Team,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>First let me tell you that I ultimately want to
paint NITF's (and later other georeferenced images) on a map pixel by
pixel.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>In the attached message I saw that you addressed
issues on how to rotate GeoTiffs. My question: Is a plan in the
works to support this with NITF's?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I took a look at the existing source code in
<STRONG>nitfdataset.cpp, line 547:</STRONG>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT size=3>
<DIV></FONT><FONT size=2><FONT face=Arial><FONT color=#0000ff>if</FONT>(
psImage->dfULX == psImage->dfLLX</FONT> </FONT></DIV>
<DIV><FONT face=Arial size=2>&& psImage->dfURX ==
psImage->dfLRX</FONT></DIV>
<DIV><FONT face=Arial size=2>&& psImage->dfULY ==
psImage->dfURY</FONT></DIV>
<DIV><FONT face=Arial size=2>&& psImage->dfLLY ==
psImage->dfLRY</FONT></DIV>
<DIV><FONT face=Arial size=2>&& psImage->dfULX !=
psImage->dfLRX</FONT></DIV>
<DIV><FONT face=Arial size=2>&& psImage->dfULY != psImage->dfLRY
)</FONT></DIV>
<DIV><FONT face=Arial size=2>{</FONT></DIV>
<DIV><FONT face=Arial size=2> poDS->bGotGeoTransform =
TRUE;</FONT></DIV>
<DIV><FONT face=Arial size=2> poDS->adfGeoTransform[<FONT
color=#000080>0</FONT>] = psImage->dfULX;</FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>
poDS->adfGeoTransform[<FONT color=#000080>1</FONT>] =</FONT> </FONT></DIV>
<DIV><FONT face=Arial size=2> (psImage->dfLRX -
psImage->dfULX) / poDS->nRasterXSize;</FONT></DIV>
<DIV><FONT face=Arial size=2> poDS->adfGeoTransform[<FONT
color=#000080>2</FONT>] = <FONT color=#000080>0.0</FONT>;</FONT></DIV>
<DIV><FONT face=Arial size=2> poDS->adfGeoTransform[<FONT
color=#000080>3</FONT>] = psImage->dfULY;</FONT></DIV>
<DIV><FONT face=Arial size=2> poDS->adfGeoTransform[<FONT
color=#000080>4</FONT>] = <FONT color=#000080>0.0</FONT>;</FONT></DIV>
<DIV><FONT size=2><FONT face=Arial>
poDS->adfGeoTransform[<FONT color=#000080>5</FONT>] =</FONT> </FONT></DIV>
<DIV><FONT face=Arial size=2> (psImage->dfLRY -
psImage->dfULY) / poDS->nRasterYSize;</FONT></DIV>
<DIV><FONT face=Arial size=2>}</FONT><FONT size=3></DIV>
<DIV><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT></FONT></FONT><FONT
face=Arial size=2></FONT> </DIV></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I see that any NITF that does not have a 180 degree
rotation we will not be able to get any coordinate information back. Even
if it is 180 degrees how are we supposed to know if Col 0 Row 0 is the
"northwest", or the "southeast" corner? I assume this is a temporary
implementation, due to the fact that when I try to set a Geotransform it says
"GeoTransform not supported for NITF's" yet. I'm also
assuming that adfGeoTransform[<FONT color=#000080>2</FONT>] and <FONT
face=Arial size=2>adfGeoTransform[<FONT color=#000080>4</FONT>] will be
used in the future to help me determine the orientation of the image to paint on
the map correctly with North Up.</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>We have code for NITF's that currently
does this, but I think the implementation is a little different compared to the
way you've done it with other image formats. Our
implementation first calculates the rotation angle then finds the Maximum
Bounding Rectangle (MBR). From this we rescale, rotate then paint it
on the surface using the MBR as a reference point. This works for us
however we wanted to use the GDAL library since it supports multiple image
formats.<FONT face=Arial size=2> NITF's are more of a priority for us
currently though.</FONT></FONT><FONT face=Arial size=2></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks,<BR>Jason R. Hughes</FONT></DIV>
<DIV><FONT face=Arial size=2><BR>Elantech, Inc. <BR>6411 Ivy Lane, Suite
300<BR>Greenbelt, MD 20770<BR>Phone: 301-486-0600<BR><A
href="mailto:jason.hughes@elantech-inc.com">jason.hughes@elantech-inc.com</A></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT size=3>
<DIV><FONT face=Arial size=2>--- Frank Warmerdam <warmerdam@pobox.com>
wrote:</FONT></DIV>
<DIV><FONT face=Arial size=2>> Ayman Kamal wrote:</FONT></DIV>
<DIV><FONT face=Arial size=2>> > 1.</FONT></DIV>
<DIV><FONT face=Arial size=2>> > You mentioned that</FONT></DIV>
<DIV><FONT face=Arial size=2>> > adfGeoTransform[0] = /* top left x
*/</FONT></DIV>
<DIV><FONT face=Arial size=2>> > adfGeoTransform[3] = /* top left y
*/</FONT></DIV>
<DIV><FONT face=Arial size=2>> ></FONT> </DIV>
<DIV><FONT face=Arial size=2>> > -Does top left x mean the value of
longitude for</FONT></DIV>
<DIV><FONT face=Arial size=2>> top</FONT></DIV>
<DIV><FONT face=Arial size=2>> > left corner?</FONT></DIV>
<DIV><FONT face=Arial size=2>> > -Does top left y mean the value of
lattitude for</FONT></DIV>
<DIV><FONT face=Arial size=2>> top</FONT></DIV>
<DIV><FONT face=Arial size=2>> > left corner?</FONT></DIV>
<DIV><FONT face=Arial size=2>></FONT> </DIV>
<DIV><FONT face=Arial size=2>> Ayman,</FONT></DIV>
<DIV><FONT face=Arial size=2>></FONT> </DIV>
<DIV><FONT face=Arial size=2>> Yes, if the coordinate system of the image
is</FONT></DIV>
<DIV><FONT face=Arial size=2>> lat/long.</FONT></DIV>
<DIV><FONT face=Arial size=2>></FONT> </DIV>
<DIV><FONT face=Arial size=2>> > 2.</FONT></DIV>
<DIV><FONT face=Arial size=2>> > What does horizental, vertical pixel size
mean?</FONT></DIV>
<DIV><FONT face=Arial size=2>></FONT> </DIV>
<DIV><FONT face=Arial size=2>> The width of a pixel is the coordinate system
being</FONT></DIV>
<DIV><FONT face=Arial size=2>> used.</FONT></DIV>
<DIV><FONT face=Arial size=2>></FONT> </DIV>
<DIV><FONT face=Arial size=2>> > 3.</FONT></DIV>
<DIV><FONT face=Arial size=2>> > Are adfGeoTransform[2],adfGeoTransform[4]
always</FONT></DIV>
<DIV><FONT face=Arial size=2>> 0?</FONT></DIV>
<DIV><FONT face=Arial size=2>></FONT> </DIV>
<DIV><FONT face=Arial size=2>> No. If the image is not "north up", that is
the</FONT></DIV>
<DIV><FONT face=Arial size=2>> image is</FONT></DIV>
<DIV><FONT face=Arial size=2>> rotated or sheared from the normal map
orientation</FONT></DIV>
<DIV><FONT face=Arial size=2>> these will</FONT></DIV>
<DIV><FONT face=Arial size=2>> be non-zero and then the interpretation of the
pixel</FONT></DIV>
<DIV><FONT face=Arial size=2>> size is</FONT></DIV>
<DIV><FONT face=Arial size=2>> more complicated.</FONT></DIV>
<DIV><FONT face=Arial size=2>></FONT> </DIV>
<DIV><FONT face=Arial size=2>> In common use these values will be
zero.</FONT></DIV>
<DIV><FONT face=Arial size=2>></FONT> </DIV>
<DIV><FONT face=Arial size=2>> > 4.</FONT></DIV>
<DIV><FONT face=Arial size=2>> > If the user doesn't give me any of these
data, and</FONT></DIV>
<DIV><FONT face=Arial size=2>> > still wants me to generate a GeoTiff file
out of</FONT></DIV>
<DIV><FONT face=Arial size=2>> his</FONT></DIV>
<DIV><FONT face=Arial size=2>> > faces' images for example,</FONT> </DIV>
<DIV><FONT face=Arial size=2>> > are there default values that I can
supply to</FONT></DIV>
<DIV><FONT face=Arial size=2>> generate</FONT></DIV>
<DIV><FONT face=Arial size=2>> > a valid GeoTiff file?</FONT></DIV>
<DIV><FONT face=Arial size=2>></FONT> </DIV>
<DIV><FONT face=Arial size=2>> It is pointless to create a "Geo" TIFF file
without</FONT></DIV>
<DIV><FONT face=Arial size=2>> knowing anything</FONT></DIV>
<DIV><FONT face=Arial size=2>> about a meaningful coordinate system. If you
feel</FONT></DIV>
<DIV><FONT face=Arial size=2>> the need to do so pick</FONT></DIV>
<DIV><FONT face=Arial size=2>> any random values you feel like.</FONT></DIV>
<DIV><FONT face=Arial size=2>></FONT> </DIV>
<DIV><FONT face=Arial size=2>> Best regards,</FONT></DIV>
<DIV><FONT face=Arial size=2>> --</FONT> </DIV>
<DIV><FONT face=Arial size=2>></FONT></DIV>
<DIV><FONT face=Arial
size=2>---------------------------------------+--------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2>> I set the clouds in motion - turn up |
Frank</FONT></DIV>
<DIV><FONT face=Arial size=2>> Warmerdam, warmerdam@pobox.com</FONT></DIV>
<DIV><FONT face=Arial size=2>> light and sound - activate the windows
|</FONT></DIV>
<DIV><FONT face=Arial size=2>> http://pobox.com/~warmerdam</FONT></DIV>
<DIV><FONT face=Arial size=2>> and watch the world go round - Rush |
Geospatial</FONT></DIV>
<DIV><FONT face=Arial size=2>> Programmer for Rent</FONT></DIV>
<DIV><FONT face=Arial size=2>></FONT> </DIV>
<DIV><FONT face=Arial size=2>></FONT> </DIV>
<DIV><FONT face=Arial size=2>>
_______________________________________________</FONT></DIV>
<DIV><FONT face=Arial size=2>> Gdal-dev mailing list</FONT></DIV>
<DIV><FONT face=Arial size=2>> Gdal-dev@remotesensing.org</FONT></DIV>
<DIV><FONT face=Arial size=2>>
http://remotesensing.org/mailman/listinfo/gdal-dev</FONT></DIV></FONT></BODY></HTML>