<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:st="" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40"
xmlns:ns1="http://schemas.microsoft.com/sharepoint/soap/workflow/"
xmlns:ns2="http://schemas.microsoft.com/office/2006/digsig-setup"
xmlns:ns3="http://schemas.microsoft.com/office/2006/digsig"
xmlns:ns4="http://schemas.openxmlformats.org/package/2006/digital-signature"
xmlns:ns5="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ns6="http://schemas.microsoft.com/office/2004/12/omml"
xmlns:ns7="http://schemas.openxmlformats.org/package/2006/relationships"
xmlns:ns8="http://microsoft.com/sharepoint/webpartpages"
xmlns:ns9="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:ns10="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:ns11="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/"
xmlns:ns12="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService"
xmlns:ns13="urn:schemas-microsoft-com:"
xmlns:ns0="urn:schemas-microsoft-com:office:smarttags">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--a:link
        {mso-style-priority:99;}
span.MSOHYPERLINK
        {mso-style-priority:99;}
a:visited
        {mso-style-priority:99;}
span.MSOHYPERLINKFOLLOWED
        {mso-style-priority:99;}
p.MSOPLAINTEXT
        {mso-style-priority:99;}
li.MSOPLAINTEXT
        {mso-style-priority:99;}
div.MSOPLAINTEXT
        {mso-style-priority:99;}
p.MSOLISTPARAGRAPH
        {mso-style-priority:34;}
li.MSOLISTPARAGRAPH
        {mso-style-priority:34;}
div.MSOLISTPARAGRAPH
        {mso-style-priority:34;}
span.PLAINTEXTCHAR
        {mso-style-priority:99;}
span.PLAINTEXTCHAR0
        {mso-style-priority:99;}
span.PLAINTEXTCHAR00
        {mso-style-priority:99;}
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.msolistparagraph, li.msolistparagraph, div.msolistparagraph
        {margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.plaintextchar
        {font-family:Consolas;}
span.plaintextchar0
        {font-family:Consolas;}
span.plaintextchar00
        {font-family:Consolas;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:Calibri;
        color:#1F497D;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle24
        {mso-style-type:personal;
        font-family:Calibri;
        color:#1F497D;}
span.EmailStyle25
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle26
        {mso-style-type:personal;
        font-family:Calibri;
        color:#1F497D;}
span.EmailStyle27
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle28
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 69.6pt 72.0pt 69.6pt;}
div.Section1
        {page:Section1;}
/* List Definitions */
@list l0
        {mso-list-id:922564647;
        mso-list-type:hybrid;
        mso-list-template-ids:-1329198066 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1
        {mso-list-id:1927835445;
        mso-list-type:hybrid;
        mso-list-template-ids:-306839458 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-GB link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I am still having problems using the geo-transformation
utilities in GDAL.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I don’t suppose anyone managed to
identify why the following code always refuses to create a </span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>OGRCoordinateTransformation</span></font><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'> for me? <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The code below is an excerpt from code I
use to open geotiffs and extract geocoords. However, although I can
extract geocoords as Eastings/Northings, I cannot then convert them to WGS84
lat/long (essential for my purpose). I am running this on linux SUSE-10
SP2.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Can anyone help?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>// g++ -Wno-deprecated -m64 -g -o georef georef.c++ -lgdal -lm<br>
<br>
#include "/usr/local/src/FWTools-2.0.6/include/gdal.h"<br>
#include "/usr/local/src/FWTools-2.0.6/include/gdal_priv.h"<br>
#include "/usr/local/src/FWTools-2.0.6/include/ogr_spatialref.h"<br>
/*<i><span style='font-style:italic'> <b><span style='font-weight:bold'>Following
output is from the MapServer tutorial ...data/raster/shdrlfi020l_ugl.tif
file. This file opens<br>
fine in 'openev' and gives easting/northing readouts OK.<br>
</span></b></span></i>Driver: GTiff/GeoTIFF<br>
Projection is `'<br>
Origin = (176371.000000,548761.000000)<br>
Pixel Size = (1000.000000,-1000.000000)<br>
<b><span style='font-weight:bold'>ERROR 1: No PROJ.4 translation for source
SRS, coordinate<br>
transformation initialization has failed.<br>
</span></b>!!!Cannot create transform from input file georef space to WGS84<br>
*/<br>
/* Following <b><span style='font-weight:bold'>output is from a geotiff
file that also works fine with 'openev'.</span></b><br>
Driver: GTiff/GeoTIFF<br>
Projection is
`PROJCS["TM
D-01",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"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-124.5],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]]]'<br>
Origin = (138586.280052,3768995.081326)<br>
Pixel Size = (50.000000,-50.000000)<br>
<b><span style='font-weight:bold'>ERROR 1: No PROJ.4 translation for source
SRS, coordinate<br>
transformation initialization has failed.<br>
</span></b>!!!Cannot create transform from input file georef space to WGS84<br>
*/<br>
int main(int argc, char **argv)<br>
{<br>
GDALDataset *poDataset;<br>
<br>
GDALAllRegister();<br>
<br>
poDataset = (GDALDataset *) GDALOpen( argv[1], GA_ReadOnly );<br>
if( poDataset == NULL )<br>
{<br>
fprintf(stderr, "!!!poDataset was NULL\n");<br>
exit(-1);<br>
}<br>
double adfGeoTransform[6];<br>
<br>
printf( "Driver: %s/%s\n",<br>
poDataset->GetDriver()->GetDescription(), <br>
poDataset->GetDriver()->GetMetadataItem( GDAL_DMD_LONGNAME ) );<br>
<br>
if( poDataset->GetProjectionRef() != NULL )<br>
printf( "Projection is `%s'\n",
poDataset->GetProjectionRef() );<br>
<br>
if( poDataset->GetGeoTransform( adfGeoTransform ) == CE_None )<br>
{<br>
printf( "Origin =
(%.6f,%.6f)\n",<br>
adfGeoTransform[0],
adfGeoTransform[3] );<br>
<br>
printf( "Pixel Size =
(%.6f,%.6f)\n",<br>
adfGeoTransform[1], adfGeoTransform[5] );<br>
}<br>
<br>
// We have to convert from native input file <br>
// geospace to our standard WGS84 space so create a transform here.<br>
<br>
// First create a spatial reference in the input space<br>
OGRSpatialReference iref;<br>
const char *proj_ref = poDataset->GetProjectionRef();<br>
char *tmp = NULL;<br>
if (proj_ref)<br>
{<br>
tmp = (char *)malloc(strlen(proj_ref)+1);<br>
iref.importFromWkt(&tmp);<br>
<br>
// Create a spatial reference in WGS88 lat/long space
and<br>
// create a transform object betseen input and output
space<br>
OGRSpatialReference oref;<br>
oref.SetWellKnownGeogCS("WGS84");<br>
OGRCoordinateTransformation *coord_transform<br>
= OGRCreateCoordinateTransformation(&iref,
&oref);<br>
if (!coord_transform)<br>
{<br>
fprintf(stderr, "!!!FAILED! Cannot create
transform from input file "<br>
"georef space to WGS84\n");<br>
<br>
} // end case default<br>
free(tmp);<br>
<br>
} // end if got projection ref<br>
<br>
} // end main<br>
</span></font><font color=navy face=Arial><span style='font-family:Arial;
color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div>
<p class=MsoNormal><st1:City w:st="on"><st1:place w:st="on"><b><i><font size=2
color=purple face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:purple;font-weight:bold;font-style:italic'>Gary</span></font></i></b></st1:place></st1:City><b><i><font
size=2 color=purple face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:purple;font-weight:bold;font-style:italic'> </span></font><font
color=navy><span style='color:navy'><o:p></o:p></span></font></i></b></p>
</div>
</div>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
Smart, Gary <br>
<b><span style='font-weight:bold'>Sent:</span></b> 21 July 2009 08:46<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">'gdal-dev@lists.osgeo.org'</st1:PersonName><br>
<b><span style='font-weight:bold'>Cc:</span></b> 'Martin Chapman'<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [gdal-dev] Converting
raster pixel space to geospace</span></font><span lang=EN-US><o:p></o:p></span></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Yes I have the gdalinfo – it seems
happy enough with the files I am experimenting with. I’m not sure
what ‘proj’ is supposed to do and can’t find any info on it
– but it is in my path and runs?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I have attached a small extract from my
ever failing code – it compiles and runs. Perhaps someone could
tell me what’s wrong. It seems to fail to set up a coord transform
for any file, even though openev happily deals with them. I can’t
help feeling that there is something decidedly dodgy about the way I prime the
transform with the ‘importFromWkt call. Perhaps the transform is
never getting the transform string at all?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I also noticed that one of the map tif
files from the mapserver tutorial doesn’t return any projection info fro
mthe getProjectionRef call – will this cause problems when trying to set
up a transformation in future.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The files I used, and the response they
give, are included in the attachment as comments.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><st1:place w:st="on"><st1:City w:st="on"><b><i><font size=2
color=purple face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:purple;font-weight:bold;font-style:italic'>Gary</span></font></i></b></st1:City></st1:place><b><i><font
size=2 color=purple face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:purple;font-weight:bold;font-style:italic'> </span></font><font
color=navy><span style='color:navy'><o:p></o:p></span></font></i></b></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
Martin Chapman [mailto:chapmanm@pixia.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> 20 July 2009 22:46<br>
<b><span style='font-weight:bold'>To:</span></b> Smart, Gary<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [gdal-dev] Converting
raster pixel space to geospace</span></font><span lang=EN-US><o:p></o:p></span></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><st1:place w:st="on"><st1:City w:st="on"><font size=2
color="#1f497d" face=Calibri><span lang=EN-US style='font-size:11.0pt;
font-family:Calibri;color:#1F497D'>Gary</span></font></st1:City></st1:place><font
size=2 color="#1f497d" face=Calibri><span lang=EN-US style='font-size:11.0pt;
font-family:Calibri;color:#1F497D'>,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'>I tried the
projection string in some of my code and it worked fine. I stepped
through the gdal code and proj4 loaded the transform object ok too which means
the projection string is fine and that your environment suffers from one of the
following:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p> </o:p></span></font></p>
<p class=msolistparagraph style='text-indent:-18.0pt;mso-list:l1 level1 lfo2'><![if !supportLists]><font
size=2 color="#1f497d" face=Calibri><span lang=EN-US style='font-size:11.0pt;
font-family:Calibri;color:#1F497D'><span style='mso-list:Ignore'>1.<font
size=1 face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><font size=2 color="#1f497d"
face=Calibri><span lang=EN-US style='font-size:11.0pt;font-family:Calibri;
color:#1F497D'> Proj.dll cannot be found in the path on your machine or is
not in the same directory as gdal.dll and is failing when gdal calls
LoadLibrary() on “proj.dll”.<o:p></o:p></span></font></p>
<p class=msolistparagraph style='text-indent:-18.0pt;mso-list:l1 level1 lfo2'><![if !supportLists]><font
size=2 color="#1f497d" face=Calibri><span lang=EN-US style='font-size:11.0pt;
font-family:Calibri;color:#1F497D'><span style='mso-list:Ignore'>2.<font
size=1 face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><font size=2 color="#1f497d"
face=Calibri><span lang=EN-US style='font-size:11.0pt;font-family:Calibri;
color:#1F497D'>The proj.dll can be found but a dependency like the nad shift
files or gdal data cannot be found.<o:p></o:p></span></font></p>
<p class=msolistparagraph><font size=2 color="#1f497d" face=Calibri><span
lang=EN-US style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'>I would try the
following:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p> </o:p></span></font></p>
<p class=msolistparagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo4'><![if !supportLists]><font
size=2 color="#1f497d" face=Calibri><span lang=EN-US style='font-size:11.0pt;
font-family:Calibri;color:#1F497D'><span style='mso-list:Ignore'>1.<font
size=1 face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><font size=2 color="#1f497d"
face=Calibri><span lang=EN-US style='font-size:11.0pt;font-family:Calibri;
color:#1F497D'>Use gdalinfo.exe that should come with fwtools or can be
downloaded from gdal.org and run the command gdalinfo.exe – formats and or
ogrinfo.exe –formats.<o:p></o:p></span></font></p>
<p class=msolistparagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo4'><![if !supportLists]><font
size=2 color="#1f497d" face=Calibri><span lang=EN-US style='font-size:11.0pt;
font-family:Calibri;color:#1F497D'><span style='mso-list:Ignore'>2.<font
size=1 face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><font size=2 color="#1f497d"
face=Calibri><span lang=EN-US style='font-size:11.0pt;font-family:Calibri;
color:#1F497D'>See if the output from that command gives any useful information
on why proj is failing.<o:p></o:p></span></font></p>
<p class=msolistparagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo4'><![if !supportLists]><font
size=2 color="#1f497d" face=Calibri><span lang=EN-US style='font-size:11.0pt;
font-family:Calibri;color:#1F497D'><span style='mso-list:Ignore'>3.<font
size=1 face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>
</span></font></span></span></font><![endif]><font size=2 color="#1f497d"
face=Calibri><span lang=EN-US style='font-size:11.0pt;font-family:Calibri;
color:#1F497D'>From the command line type in proj.exe and see if the proj util
can be found in your path. If it can be found then maybe it will give
some useful info.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'>Sorry I am not more
help than that but the projection string is valid.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'>Martin<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p> </o:p></span></font></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
gdal-dev-bounces@lists.osgeo.org [mailto:gdal-dev-bounces@lists.osgeo.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Smart, Gary<br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, July 20, 2009 8:50
AM<br>
<b><span style='font-weight:bold'>To:</span></b> gdal-dev@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [gdal-dev] Converting
raster pixel space to geospace<o:p></o:p></span></font></p>
</div>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks Martin, but now to the next
problem…<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I downloaded PRROJ.4 which seemed to
configure and compile OK.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Having set the PROJ_LIB as you proposed, I
now get:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>ERROR 1: No PROJ.4 translation for source
SRS, coordinate transformation initialization has failed.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I guess I am still missing
comething. The failure came from the same geotiff file as below.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I also couldn’t find a ‘data
dir’ in the GDAL source and therefore GDAL_DATA env var remained
unset. We installed everything from the FWTools download for our Linux
SUSE10 system. Should there be a ‘data’ directory under the
FWTools directory somewhere? There is no GDAL source in this directory
– just include files and libraries. I presumed this was all that
was needed to use GDAL? <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>
<hr size=2 width="100%" align=center>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
Martin Chapman [mailto:chapmanm@pixia.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> 20 July 2009 14:49<br>
<b><span style='font-weight:bold'>To:</span></b> Smart, Gary;
gdal-dev@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [gdal-dev] Converting
raster pixel space to geospace</span></font><span lang=EN-US><o:p></o:p></span></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><st1:place w:st="on"><st1:City w:st="on"><font size=2
color="#1f497d" face=Calibri><span lang=EN-US style='font-size:11.0pt;
font-family:Calibri;color:#1F497D'>Gary</span></font></st1:City></st1:place><font
size=2 color="#1f497d" face=Calibri><span lang=EN-US style='font-size:11.0pt;
font-family:Calibri;color:#1F497D'>,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'>Set your paths like
such on startup or as an environment variable:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#a31515" face="Courier New"><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#A31515'>GDAL_DATA
points at the data dir that comes with gdal source.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#a31515" face="Courier New"><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#A31515'>PROJ_LIB
point to the nad directory that you download from proj4 website.</span></font><font
size=2 color="#1f497d" face=Calibri><span lang=EN-US style='font-size:11.0pt;
font-family:Calibri;color:#1F497D'><o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>string env =
string(<font color="#a31515"><span style='color:#A31515'>"GDAL_DATA="</span></font>)
+ dataPath;<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>_putenv(env.c_str());<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>env = string(<font
color="#a31515"><span style='color:#A31515'>"PROJ_LIB="</span></font>)
+ nadPath;<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>_putenv(env.c_str());<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>and / or<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>CPLSetConfigOption(<font
color="#a31515"><span style='color:#A31515'>"GDAL_DATA"</span></font>,
dataPath.c_str());<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>CPLSetConfigOption(<font
color="#a31515"><span style='color:#A31515'>"PROJ_LIB"</span></font>,
nadPath.c_str());<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'>Martin<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color="#1f497d" face=Calibri><span lang=EN-US
style='font-size:11.0pt;font-family:Calibri;color:#1F497D'><o:p> </o:p></span></font></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
gdal-dev-bounces@lists.osgeo.org [mailto:gdal-dev-bounces@lists.osgeo.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Smart, Gary<br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, July 20, 2009 7:38
AM<br>
<b><span style='font-weight:bold'>To:</span></b> gdal-dev@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [gdal-dev] Converting
raster pixel space to geospace<o:p></o:p></span></font></p>
</div>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>OK - I can get it to compile and not crash instantly (bonanza!)<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>However, when I try to create the OGR transform using importFromWkt, <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>I get the following:<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>ERROR 6: Unable to load PROJ.4 library (libproj.so), creation of<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>OGRCoordinateTransformation failed.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>Does anyone know what this means? Is there some part of OGR/GDAL I
have yet to install?<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>
</div>
</div>
</div>
</div>
</body>
</html>