A aviation & planes forum. AviationBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » AviationBanter forum » rec.aviation newsgroups » General Aviation
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Georeferencing Maps [was GPS and airspace]



 
 
Thread Tools Display Modes
  #1  
Old July 1st 04, 04:44 AM
John Clonts
external usenet poster
 
Posts: n/a
Default


"John Clonts" wrote in message
om...

Kyler,

This is the input I got from J.G. on the OziUsers list, regarding the
above:

begin quote
I took a look at the goetiff tags for the two images and I think I
see the problem. The full image is specifying a key:

ProjNatOriginLongGeoKey (Double,1): -100

While the smaller image does not even have that key. Somehow, the
smaller image is using the tag:

ProjFalseOriginLongGeoKey (Double,1): -100.583333

These can't both be right. I'd say the full image is the right one,
since it loads fine in not just Ozi, but other programs too, while
the smaller image does not work in other programs. I'm pretty
certain that the ProjNatOriginLongGeoKey is only supposed to be used
in cases where the prime meridian is not the familiar 0 degrees
longitude value. Technically, the math may work, to subvert the
function of that tag and then specify the ProjFalseOriginLongGeoKey
as 0.0, but it's highly irregular. Listgeo is able to deal with it,
by translating the natorigin key to it's equivalent falseorigin key,
but programs generating geotiff files should not rely on geotiff
readers to do this.

All that said, you can fix these keys. If you redirect the output of
the listgeo program to a file, you can edit that file with any
ordinary text editor and reinstall it into the geotiff file, using
the geotifcp program, which is part of the zip file I referred to
previously.

J.G.
end quote


Hello Kyler,

FYI, I patched the tags in my test file (from
https://aviationtoolbox.org/Members/...ul_Y=-676347.0)
with geotifcp per J.G.'s instructions, and Oziexplorer is happy with that
image now. Do you know if changing your generation code would be
appropriate, and/or cause other problems with other software?

Cheers,
John


  #2  
Old July 1st 04, 04:08 PM
Kyler Laird
external usenet poster
 
Posts: n/a
Default

"John Clonts" writes:

FYI, I patched the tags in my test file (from
https://aviationtoolbox.org/Members/...ul_Y=-676347.0)
with geotifcp per J.G.'s instructions, and Oziexplorer is happy with that
image now. Do you know if changing your generation code would be
appropriate, and/or cause other problems with other software?


It's appropriate and I want to do it. If it causes any problems, I'll
work through them. I want these things to be correct.

Yesterday I distilled the code to a few lines that demonstrate the
problem and sent a report to the GDAL developer mailing list.
http://remotesensing.org/mailman/listinfo/gdal-dev/
It hasn't appeared in the archives yet.

I welcome more reports to the list. My trivial example is below.

Thank you.

--kyler

================================================== ========================
#!/usr/bin/env python

import gdal

a = gdal.Open('a.tif')

b = gdal.GetDriverByName('GTiff').Create(
'b.tif',
a.RasterXSize, a.RasterYSize,
3, gdal.GDT_Byte,
[ 'TILED=YES' ]
)

b.SetProjection(a.GetProjection())
b.SetGeoTransform(a.GetGeoTransform())
  #3  
Old July 2nd 04, 06:53 AM
John Clonts
external usenet poster
 
Posts: n/a
Default


"Kyler Laird" wrote in message
...
"John Clonts" writes:

FYI, I patched the tags in my test file (from


https://aviationtoolbox.org/Members/...le=50&image_fo

rmat=GeoTIFF&lr_Y=-753147.0&lr_X=318457.0&ul_X=216057.0&ul_Y=-676347.0)
with geotifcp per J.G.'s instructions, and Oziexplorer is happy with that
image now. Do you know if changing your generation code would be
appropriate, and/or cause other problems with other software?


It's appropriate and I want to do it. If it causes any problems, I'll
work through them. I want these things to be correct.

Yesterday I distilled the code to a few lines that demonstrate the
problem and sent a report to the GDAL developer mailing list.
http://remotesensing.org/mailman/listinfo/gdal-dev/
It hasn't appeared in the archives yet.


Hello Kyler,

Well, I haven't seen your inquiry show up there yet-- nor at the nntp site
news.gmane.org/gmane.comp.gis.gdal.devel.

But in the mean time I did some digging, and determined a fix that seems to
work for it, in gdal-1.2.1\frmts\gtiff\gt_wkt_srs.cpp, line 1419:

else if( EQUAL(pszProjection,SRS_PT_LAMBERT_CONFORMAL_CONIC _2SP) )
{
GTIFKeySet(psGTIF, GTModelTypeGeoKey, TYPE_SHORT, 1,
ModelTypeProjected);
GTIFKeySet(psGTIF, ProjectedCSTypeGeoKey, TYPE_SHORT, 1,
KvUserDefined );
GTIFKeySet(psGTIF, ProjectionGeoKey, TYPE_SHORT, 1,
KvUserDefined );

GTIFKeySet(psGTIF, ProjCoordTransGeoKey, TYPE_SHORT, 1,
CT_LambertConfConic_2SP );

GTIFKeySet(psGTIF, ProjFalseOriginLatGeoKey, TYPE_DOUBLE, 1,
poSRS-GetProjParm( SRS_PP_LATITUDE_OF_ORIGIN, 0.0 ) );

/* jcc 7/2/04 changed from ProjFalseOriginLongGeoKey */
GTIFKeySet(psGTIF, ProjNatOriginLongGeoKey, TYPE_DOUBLE, 1, //
line 1419
poSRS-GetProjParm( SRS_PP_CENTRAL_MERIDIAN, 0.0 ) );

GTIFKeySet(psGTIF, ProjStdParallel1GeoKey, TYPE_DOUBLE, 1,
poSRS-GetProjParm( SRS_PP_STANDARD_PARALLEL_1, 0.0 ) );

I tried to post to the nntp server on the devel list but it did not accept
my posting... perhaps you have better connections into that group.

I will post my new pymod\_gdal.dll and bin\gdal12.dll on
alt.binaries.pictures.aviation if you would like to test them...

Cheers,
John


  #4  
Old July 2nd 04, 04:08 PM
Kyler Laird
external usenet poster
 
Posts: n/a
Default

"John Clonts" writes:

/* jcc 7/2/04 changed from ProjFalseOriginLongGeoKey */
GTIFKeySet(psGTIF, ProjNatOriginLongGeoKey, TYPE_DOUBLE, 1, //


I had considered doing that too. I hesitated because I just don't know
enough about it. If it works for you, however, I'm happy to do it.

Please try the GeoTIFFs now. Do they work the way you expect?

If not, please take a look at the TIFFs in these directories.
http://aviationtoolbox.org/munge/data/masked/
http://aviationtoolbox.org/munge/data/warped/
I'm regenerating the whole set with the modified GDAL.

Thank you!

--kyler
  #5  
Old July 3rd 04, 12:57 AM
John Clonts
external usenet poster
 
Posts: n/a
Default


"Kyler Laird" wrote in message
...
"John Clonts" writes:

/* jcc 7/2/04 changed from ProjFalseOriginLongGeoKey */
GTIFKeySet(psGTIF, ProjNatOriginLongGeoKey, TYPE_DOUBLE, 1, //


I had considered doing that too. I hesitated because I just don't know
enough about it. If it works for you, however, I'm happy to do it.


Well, you probably know more about it than I do-- I hope it doesn't screw
somebody else up I notice that Frank W the main GDAL guy is on vacation
until next week


Please try the GeoTIFFs now. Do they work the way you expect?

It works the same as before, and I see that it still has the "FalseOrigin"
instead of the "NatOrigin" key. (I.e. from
https://aviationtoolbox.org/Members/...s/map_explorer).


If not, please take a look at the TIFFs in these directories.
http://aviationtoolbox.org/munge/data/masked/
http://aviationtoolbox.org/munge/data/warped/


Ok, but these are 200Mb files?

I'm regenerating the whole set with the modified GDAL.

Thank you!



Thank you!

John


  #6  
Old July 4th 04, 02:08 PM
Kyler Laird
external usenet poster
 
Posts: n/a
Default

I've completely regenerated all of the images from the base (FAA) set
using the modifified GDAL. Please verify that the GeoTIFFs are now as
they need to be.
https://aviationtoolbox.org/Members/...s/map_explorer

I now see tags such as this.
ProjNatOriginLongGeoKey (Double,1): -100.583333

Thank you.

--kyler
  #7  
Old July 5th 04, 04:59 PM
John Clonts
external usenet poster
 
Posts: n/a
Default


"Kyler Laird" wrote in message
...
I've completely regenerated all of the images from the base (FAA) set
using the modifified GDAL. Please verify that the GeoTIFFs are now as
they need to be.
https://aviationtoolbox.org/Members/...s/map_explorer

I now see tags such as this.
ProjNatOriginLongGeoKey (Double,1): -100.583333

Thank you.

--kyler\


Seems to work perfectly for me now...

Thank you!!

John


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:28 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 AviationBanter.
The comments are property of their posters.