Re: [gdal-dev] geotiff projection not showing up

2013-11-14 Thread Trent Piepho
On Nov 10, 2013 1:44 AM, Even Rouault even.roua...@mines-paris.org
wrote:

 Le dimanche 10 novembre 2013 00:14:42, Trent Piepho a écrit :
  I've found that unless you call SetGeoTransform() and give an affine
  transform, most apps, including listgeo and gdalsrsinfo, aren't
  entirely happy with the georeferencing.  GDAL has a function that
  computes a transform from GCPs, but it needs to be part of the GDAL
  code for the dataset driver.  GDAL doesn't automatically do it when a
  user of GDAL wants an affine transform from a dataset.

 True. This is (I think) a design decision, as generally GDAL tries to
expose
 information as close as possible to what is in the dataset. GCPs alone
don't
 provide an unambiguous way of transforming image pixel coordinates into
real-
 world coordinates. You have to specify which extrapolation method you
want to
 use : polynomial at which order, thin plate spline, ..

From what I've seen many apps just want to translate between pixel,line and
geographic coordinates.  The method to do this appears to be to get the SRS
from the dataset, use one of it's methods to transform between geographic
coordinates and projected coordinates, then get the geotransform
coefficients and preform the affine transform with them.

With no geotransform, this doesn't work.  Instead one is supposed toI
don't know.  I don't see any OGR or dataset function that will do the
coordinate transform.  I've looked at other apps, and none of them can
handle this.   So you end up with the only way to georeference a dataset,
and have anything work, is to use a affine transform.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] geotiff projection not showing up

2013-11-11 Thread Norman Goldstein

Frank and Trent,

I have created a proper GeoTIFF file with the code
listed, below.  There is still one oddity:
The code sets the   line/sample -- x/y   affine transformation
using an array of 6 doubles.  The code contains a conditional
compilation that chooses between two different arrays of
6 doubles.

The #if 1 array produces a full listgeo dump.
The #else listgeo dump is missing the corner coordinates.

The difference between the two arrays is
-- The false northing for #if 1 is  0.001 .
-- The false northing for #else  is  0

Is this a quirk of GDAL?  of listeo?  Or, should map x,y
always be set up to take on only positive values?


/// full source code ///
#include iostream
#include ogr_spatialref.h
#include gdal_priv.h

int main( int argc, char* argv[] )
{
  using namespace std;

  GDALAllRegister();
  GDALDriverManager* dmgr = GetGDALDriverManager();

  GDALDriver* drv =
dmgr-GetDriverByName( GTiff );

  if( nullptr == drv )
  {
cerr  Error from GetDriverByName  endl;
return -3;
  }

  GDALDataset* dataset = drv-Create( dem.tif,
  300,
  200,
  1, // Num bands
  GDT_Float32,
  nullptr );
  if( nullptr == dataset )
  {
cerr  Error from Create  endl;
return -4;
  }

  OGRSpatialReference oSRS;
  oSRS.SetProjCS( NoWhere );
  oSRS.SetWellKnownGeogCS( WGS84 );
  oSRS.SetEquirectangular( 0.0,// Centre lat
   0.0,// Centre lon
   0.0,   // False Easting
   0.0 ); // False Northing

  char* wkt = nullptr;

  if( OGRERR_NONE != oSRS.exportToWkt( wkt ) )
  {
cerr  Error from exportToWkt  endl;
return -5;
  }

  cout  WKT=   wkt  endl;

#if 1
  double coeffs[] = { 0.0, 1.0, 0.0,
  0.001, 0.0, -1.0 };
#else
  double coeffs[] = { 0.0, 1.0, 0.0,
  0.0, 0.0, -1.0 };
#endif

  if( CE_None != dataset-SetGeoTransform( coeffs ) )
  {
cerr  Error from SetGeoTransform  endl;
return -6;
  }

  if( CE_None != dataset-SetProjection( wkt ) )
  {
cerr  Error from SetProjection  endl;
return -7;
  }

  OGRFree( wkt );
  wkt = nullptr;

  GDALClose( dataset );
  dataset = nullptr;
}// main
///

# full listgeo dump ###
Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
  ModelTiepointTag (2,3):
 000
 00.0010
  ModelPixelScaleTag (1,3):
 110
  End_Of_Tags.
   Keyed_Information:
  GTModelTypeGeoKey (Short,1): ModelTypeProjected
  GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
  GTCitationGeoKey (Ascii,8): NoWhere
  GeographicTypeGeoKey (Short,1): GCS_WGS_84
  GeogCitationGeoKey (Ascii,7): WGS 84
  GeogAngularUnitsGeoKey (Short,1): Angular_Degree
  GeogSemiMajorAxisGeoKey (Double,1): 6378137
  GeogInvFlatteningGeoKey (Double,1): 298.257224
  ProjectedCSTypeGeoKey (Short,1): User-Defined
  ProjectionGeoKey (Short,1): User-Defined
  ProjCoordTransGeoKey (Short,1): CT_Equirectangular
  ProjLinearUnitsGeoKey (Short,1): Linear_Meter
  ProjStdParallel1GeoKey (Double,1): 0
  ProjFalseEastingGeoKey (Double,1): 0
  ProjFalseNorthingGeoKey (Double,1): 0
  ProjCenterLongGeoKey (Double,1): 0
  ProjCenterLatGeoKey (Double,1): 0
  End_Of_Keys.
   End_Of_Geotiff.

Projection Method: CT_Equirectangular
   ProjCenterLatGeoKey: 0.00 (  0d 0' 0.00N)
   ProjCenterLongGeoKey: 0.00 (  0d 0' 0.00E)
   ProjFalseEastingGeoKey: 0.00 m
   ProjFalseNorthingGeoKey: 0.00 m
GCS: 4326/WGS 84
Datum: 6326/World Geodetic System 1984
Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
Prime Meridian: 8901/Greenwich (0.00/  0d 0' 0.00E)
Projection Linear Units: 9001/metre (1.00m)

Corner Coordinates:
Upper Left(   0.000,   0.001)  (  0d 0' 0.00E,  0d 0' 0.00N)
Lower Left(   0.000,-199.999)  (  0d 0' 0.00E,  0d 0' 6.47S)
Upper Right   ( 300.000,   0.001)  (  0d 0' 9.70E,  0d 0' 0.00N)
Lower Right   ( 300.000,-199.999)  (  0d 0' 9.70E,  0d 0' 6.47S)
Center( 150.000, -99.999)  (  0d 0' 4.85E,  0d 0' 3.23S)



On 11/09/2013 03:14 PM, Trent Piepho wrote:

On Sat, Nov 9, 2013 at 1:07 PM, Norman Goldstein norm...@telus.net wrote:

Things are better, now, but not quite there for me.
Still not able to transform pixel/line to PCS space.
(the listgeo dump is, below)

I think the problem is that there is no definition of the

ModelPixelScaleTag

It seems that this tag, together with the ModelTiepointTag,
is how an affine transformation is inferred.  Or by directly
setting

ModelTransformationTag

which I could do with GDALDataset's SetGeoTransform()
method (for defining 2D affine 

Re: [gdal-dev] geotiff projection not showing up

2013-11-11 Thread Even Rouault
Le lundi 11 novembre 2013 20:46:47, Norman Goldstein a écrit :
 Frank and Trent,
 
 I have created a proper GeoTIFF file with the code
 listed, below.  There is still one oddity:
 The code sets the   line/sample -- x/y   affine transformation
 using an array of 6 doubles.  The code contains a conditional
 compilation that chooses between two different arrays of
 6 doubles.
 
 The #if 1 array produces a full listgeo dump.
 The #else listgeo dump is missing the corner coordinates.
 
 The difference between the two arrays is
 -- The false northing for #if 1 is  0.001 .
 -- The false northing for #else  is  0
 
 Is this a quirk of GDAL?  of listeo?  Or, should map x,y
 always be set up to take on only positive values?

The GDAL GTiff driver considers that the  {0.0, 1.0, 0.0, 0.0, 0.0, -1.0} 
geotransform as indicating that the image is not georeferenced (identity 
geotransform). This is not something that you are likely to use in real-world 
situations.

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] geotiff projection not showing up

2013-11-10 Thread Even Rouault
Le dimanche 10 novembre 2013 00:14:42, Trent Piepho a écrit :
 On Sat, Nov 9, 2013 at 1:07 PM, Norman Goldstein norm...@telus.net wrote:
  Things are better, now, but not quite there for me.
  Still not able to transform pixel/line to PCS space.
  (the listgeo dump is, below)
  
  I think the problem is that there is no definition of the
  
  ModelPixelScaleTag
  
  It seems that this tag, together with the ModelTiepointTag,
  is how an affine transformation is inferred.  Or by directly
  setting
  
  ModelTransformationTag
  
  which I could do with GDALDataset's SetGeoTransform()
  method (for defining 2D affine transformations).
 
 I've found that unless you call SetGeoTransform() and give an affine
 transform, most apps, including listgeo and gdalsrsinfo, aren't
 entirely happy with the georeferencing.  GDAL has a function that
 computes a transform from GCPs, but it needs to be part of the GDAL
 code for the dataset driver.  GDAL doesn't automatically do it when a
 user of GDAL wants an affine transform from a dataset.

True. This is (I think) a design decision, as generally GDAL tries to expose 
information as close as possible to what is in the dataset. GCPs alone don't 
provide an unambiguous way of transforming image pixel coordinates into real-
world coordinates. You have to specify which extrapolation method you want to 
use : polynomial at which order, thin plate spline, .. 

Of course with 3 points, you can (but not necessarily must) compute an affine 
transform in an unambiguous way, but in that case you'd rather define the 6 
coefficient geotransform directly.

And I've worked with a mapping authority that forbids from implicitly using 
the tiepoints from a GeoTIFF to compute a geotransform.

Depending on the cases, GDAL drivers might choose to compute an approximate 
geotransform from the GCPs, but GDAL core will not make that behind their 
back.

 
 It seems like most code that tries to find corner coordinates and/or
 the pixel size of a raster expects an affine transform plus a
 projection.  If there are a set of GCPs, then that code won't work.
 The information may well be there, like your three GCP points, but the
 GDAL user needs totally different code make use of it.  It's the same
 reason most of NOAA's nautical charts don't work with apps that use
 GDAL or GDAL created GeoTIFFs.  I've just started looking at the GDAL
 code, but it doesn't seem like GDAL abstracts this enough to have
 broad compatibility.
 ___
 gdal-dev mailing list
 gdal-dev@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] geotiff projection not showing up

2013-11-09 Thread Norman Goldstein

Frank,

Things are better, now, but not quite there for me.
Still not able to transform pixel/line to PCS space.
(the listgeo dump is, below)

I think the problem is that there is no definition of the

ModelPixelScaleTag

It seems that this tag, together with the ModelTiepointTag,
is how an affine transformation is inferred.  Or by directly
setting

ModelTransformationTag

which I could do with GDALDataset's SetGeoTransform()
method (for defining 2D affine transformations).

The GTiffDataset class is hidden from users of GDAL,
being defined in the cpp file frmts/gtiff/geotiff.cpp .
Is there a way to directly set the tags of a GeoTIFF
GDAL Dataset?  Or, would this break GDAL's useful
ability of uniformly dealing with the many different
dataset formats?




I changed the call to SetGCPs, as you suggested:

dataset-SetGCPs( 3,
  gcps,
  wkt )

where wkt is the equirectangular projection defined
below, in an earlier email.  Here is the listgeo dump:

// listgeo dump /
Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
  ModelTiepointTag (6,3):
 0249  0
 000
 399  249  0
 1000 00
 000
 02000 0
  End_Of_Tags.
   Keyed_Information:
  GTModelTypeGeoKey (Short,1): ModelTypeProjected
  GTRasterTypeGeoKey (Short,1): RasterPixelIsPoint
  GTCitationGeoKey (Ascii,8): NoWhere
  GeographicTypeGeoKey (Short,1): GCS_WGS_84
  GeogCitationGeoKey (Ascii,7): WGS 84
  GeogAngularUnitsGeoKey (Short,1): Angular_Degree
  GeogSemiMajorAxisGeoKey (Double,1): 6378137
  GeogInvFlatteningGeoKey (Double,1): 298.257224
  ProjectedCSTypeGeoKey (Short,1): User-Defined
  ProjectionGeoKey (Short,1): User-Defined
  ProjCoordTransGeoKey (Short,1): CT_Equirectangular
  ProjLinearUnitsGeoKey (Short,1): Linear_Meter
  ProjStdParallel1GeoKey (Double,1): 0
  ProjFalseEastingGeoKey (Double,1): 0
  ProjFalseNorthingGeoKey (Double,1): 0
  ProjCenterLongGeoKey (Double,1): 0
  ProjCenterLatGeoKey (Double,1): 0
  End_Of_Keys.
   End_Of_Geotiff.

Projection Method: CT_Equirectangular
   ProjCenterLatGeoKey: 0.00 (  0d 0' 0.00N)
   ProjCenterLongGeoKey: 0.00 (  0d 0' 0.00E)
   ProjFalseEastingGeoKey: 0.00 m
   ProjFalseNorthingGeoKey: 0.00 m
GCS: 4326/WGS 84
Datum: 6326/World Geodetic System 1984
Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)
Prime Meridian: 8901/Greenwich (0.00/  0d 0' 0.00E)
Projection Linear Units: 9001/metre (1.00m)

Corner Coordinates:
 ... unable to transform points between pixel/line and PCS space


This is much better, but, still missing the pixel/line -- PCS
transformation (as noted, above).


On 11/07/2013 07:32 AM, Frank Warmerdam wrote:

Norman,

My apologies.  The GCP projection is actually supposed to be passed as 
the third value in the SetGCPs call - where you have passed the string 
Richmond.  Instead pass the whole WKT strings for the coordinate system.


Best regards,
Frank


On Wed, Nov 6, 2013 at 4:00 PM, Norman Goldstein norm...@telus.net 
mailto:norm...@telus.net wrote:


Frank,

I am using GDAL
Version : 1.9.2

so maybe that is why I do not see the method SetGCPProjection().

I think you have convinced me, though, to calculate the 6
coefficients directly,
and then call SetGeoTransform().  Will let you guys know how this
works out
for me.

Thank you,
Norm



On 11/06/2013 01:51 PM, Frank Warmerdam wrote:

Norman,

I believe you want to call SetGCPProjection() instead of
SetProjection() when using GCPs instead of an affine transform.

Best regards,
Frank



On Wed, Nov 6, 2013 at 1:23 PM, Norman Goldstein
norm...@telus.net mailto:norm...@telus.net wrote:

I have created a geotiff file using the GTiff driver, and
have successfully set options for it to be a strips file with
no compression.  Also, successfully called the functions

dataset-SetMetadataItem( AREA_OR_POINT,
Point,
 nullptr ) )

and

dataset-SetGCPs( 3,
   gcps,
   Richmond )

Here is the listgeo dump:

# listgeo dump ##
Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
  ModelTiepointTag (6,3):
 0249  0
 000
 399  249  0
 1000 00
 0   

Re: [gdal-dev] geotiff projection not showing up

2013-11-09 Thread Trent Piepho
On Sat, Nov 9, 2013 at 1:07 PM, Norman Goldstein norm...@telus.net wrote:
 Things are better, now, but not quite there for me.
 Still not able to transform pixel/line to PCS space.
 (the listgeo dump is, below)

 I think the problem is that there is no definition of the

 ModelPixelScaleTag

 It seems that this tag, together with the ModelTiepointTag,
 is how an affine transformation is inferred.  Or by directly
 setting

 ModelTransformationTag

 which I could do with GDALDataset's SetGeoTransform()
 method (for defining 2D affine transformations).

I've found that unless you call SetGeoTransform() and give an affine
transform, most apps, including listgeo and gdalsrsinfo, aren't
entirely happy with the georeferencing.  GDAL has a function that
computes a transform from GCPs, but it needs to be part of the GDAL
code for the dataset driver.  GDAL doesn't automatically do it when a
user of GDAL wants an affine transform from a dataset.

It seems like most code that tries to find corner coordinates and/or
the pixel size of a raster expects an affine transform plus a
projection.  If there are a set of GCPs, then that code won't work.
The information may well be there, like your three GCP points, but the
GDAL user needs totally different code make use of it.  It's the same
reason most of NOAA's nautical charts don't work with apps that use
GDAL or GDAL created GeoTIFFs.  I've just started looking at the GDAL
code, but it doesn't seem like GDAL abstracts this enough to have
broad compatibility.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] geotiff projection not showing up

2013-11-07 Thread Frank Warmerdam
Norman,

My apologies.  The GCP projection is actually supposed to be passed as the
third value in the SetGCPs call - where you have passed the string
Richmond.  Instead pass the whole WKT strings for the coordinate system.

Best regards,
Frank


On Wed, Nov 6, 2013 at 4:00 PM, Norman Goldstein norm...@telus.net wrote:

  Frank,

 I am using GDAL
 Version : 1.9.2

 so maybe that is why I do not see the method SetGCPProjection().

 I think you have convinced me, though, to calculate the 6 coefficients
 directly,
 and then call SetGeoTransform().  Will let you guys know how this works out
 for me.

 Thank you,
 Norm



 On 11/06/2013 01:51 PM, Frank Warmerdam wrote:

 Norman,

  I believe you want to call SetGCPProjection() instead of SetProjection()
 when using GCPs instead of an affine transform.

  Best regards,
 Frank



 On Wed, Nov 6, 2013 at 1:23 PM, Norman Goldstein norm...@telus.netwrote:

 I have created a geotiff file using the GTiff driver, and have
 successfully set options for it to be a strips file with no compression.
  Also, successfully called the functions

 dataset-SetMetadataItem( AREA_OR_POINT,
 Point,
  nullptr ) )

 and

 dataset-SetGCPs( 3,
gcps,
Richmond )

 Here is the listgeo dump:

 # listgeo dump ##
 Geotiff_Information:
Version: 1
Key_Revision: 1.0
Tagged_Information:
   ModelTiepointTag (6,3):
  0249  0
  000
  399  249  0
  1000 00
  000
  02000 0
   End_Of_Tags.
Keyed_Information:
   GTRasterTypeGeoKey (Short,1): RasterPixelIsPoint
   End_Of_Keys.
End_Of_Geotiff.


 Corner Coordinates:
  ... unable to transform points between pixel/line and PCS space
 #

 I also set the reference system using the following code:

 /// c++ code 
   OGRSpatialReference oSRS;
   oSRS.SetProjCS( NoWhere );
   oSRS.SetWellKnownGeogCS( WGS84 );
   oSRS.SetEquirectangular( 0.0,// Centre lat
0.0,// Centre lon
0.0,   // False Easting
0.0 ); // False Northing

   char* wkt = nullptr;

   if( OGRERR_NONE != oSRS.exportToPrettyWkt( wkt ) )
   {
  error...
   }

   if( CE_Failure == dataset-SetProjection( wkt ) )
   {
error...
   }
 ///

 So, why is listgeo not able to transform points between pixel/line and
 PCS space?

 I am happy to upload a full working example if needed.

 Thank you.












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




  --

 ---+--
 I set the clouds in motion - turn up   | Frank Warmerdam,
 warmer...@pobox.com
 light and sound - activate the windows | http://pobox.com/~warmerdam
 and watch the world go round - Rush| Geospatial Software Developer



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




-- 
---+--
I set the clouds in motion - turn up   | Frank Warmerdam,
warmer...@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush| Geospatial Software Developer
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] geotiff projection not showing up

2013-11-06 Thread Norman Goldstein
I have created a geotiff file using the GTiff driver, and have 
successfully set options for it to be a strips file with no 
compression.  Also, successfully called the functions


dataset-SetMetadataItem( AREA_OR_POINT,
Point,
 nullptr ) )

and

dataset-SetGCPs( 3,
   gcps,
   Richmond )

Here is the listgeo dump:

# listgeo dump ##
Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
  ModelTiepointTag (6,3):
 0249  0
 000
 399  249  0
 1000 00
 000
 02000 0
  End_Of_Tags.
   Keyed_Information:
  GTRasterTypeGeoKey (Short,1): RasterPixelIsPoint
  End_Of_Keys.
   End_Of_Geotiff.


Corner Coordinates:
 ... unable to transform points between pixel/line and PCS space
#

I also set the reference system using the following code:

/// c++ code 
  OGRSpatialReference oSRS;
  oSRS.SetProjCS( NoWhere );
  oSRS.SetWellKnownGeogCS( WGS84 );
  oSRS.SetEquirectangular( 0.0,// Centre lat
   0.0,// Centre lon
   0.0,   // False Easting
   0.0 ); // False Northing

  char* wkt = nullptr;

  if( OGRERR_NONE != oSRS.exportToPrettyWkt( wkt ) )
  {
 error...
  }

  if( CE_Failure == dataset-SetProjection( wkt ) )
  {
   error...
  }
///

So, why is listgeo not able to transform points between pixel/line and 
PCS space?


I am happy to upload a full working example if needed.

Thank you.













smime.p7s
Description: S/MIME Cryptographic Signature
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] geotiff projection not showing up

2013-11-06 Thread Frank Warmerdam
Norman,

I believe you want to call SetGCPProjection() instead of SetProjection()
when using GCPs instead of an affine transform.

Best regards,
Frank



On Wed, Nov 6, 2013 at 1:23 PM, Norman Goldstein norm...@telus.net wrote:

 I have created a geotiff file using the GTiff driver, and have
 successfully set options for it to be a strips file with no compression.
  Also, successfully called the functions

 dataset-SetMetadataItem( AREA_OR_POINT,
 Point,
  nullptr ) )

 and

 dataset-SetGCPs( 3,
gcps,
Richmond )

 Here is the listgeo dump:

 # listgeo dump ##
 Geotiff_Information:
Version: 1
Key_Revision: 1.0
Tagged_Information:
   ModelTiepointTag (6,3):
  0249  0
  000
  399  249  0
  1000 00
  000
  02000 0
   End_Of_Tags.
Keyed_Information:
   GTRasterTypeGeoKey (Short,1): RasterPixelIsPoint
   End_Of_Keys.
End_Of_Geotiff.


 Corner Coordinates:
  ... unable to transform points between pixel/line and PCS space
 #

 I also set the reference system using the following code:

 /// c++ code 
   OGRSpatialReference oSRS;
   oSRS.SetProjCS( NoWhere );
   oSRS.SetWellKnownGeogCS( WGS84 );
   oSRS.SetEquirectangular( 0.0,// Centre lat
0.0,// Centre lon
0.0,   // False Easting
0.0 ); // False Northing

   char* wkt = nullptr;

   if( OGRERR_NONE != oSRS.exportToPrettyWkt( wkt ) )
   {
  error...
   }

   if( CE_Failure == dataset-SetProjection( wkt ) )
   {
error...
   }
 ///

 So, why is listgeo not able to transform points between pixel/line and PCS
 space?

 I am happy to upload a full working example if needed.

 Thank you.












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




-- 
---+--
I set the clouds in motion - turn up   | Frank Warmerdam,
warmer...@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush| Geospatial Software Developer
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] geotiff projection not showing up

2013-11-06 Thread Norman Goldstein

Frank,

I am using GDAL
Version : 1.9.2

so maybe that is why I do not see the method SetGCPProjection().

I think you have convinced me, though, to calculate the 6 coefficients 
directly,

and then call SetGeoTransform().  Will let you guys know how this works out
for me.

Thank you,
Norm


On 11/06/2013 01:51 PM, Frank Warmerdam wrote:

Norman,

I believe you want to call SetGCPProjection() instead of 
SetProjection() when using GCPs instead of an affine transform.


Best regards,
Frank



On Wed, Nov 6, 2013 at 1:23 PM, Norman Goldstein norm...@telus.net 
mailto:norm...@telus.net wrote:


I have created a geotiff file using the GTiff driver, and have
successfully set options for it to be a strips file with no
compression.  Also, successfully called the functions

dataset-SetMetadataItem( AREA_OR_POINT,
Point,
 nullptr ) )

and

dataset-SetGCPs( 3,
   gcps,
   Richmond )

Here is the listgeo dump:

# listgeo dump ##
Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
  ModelTiepointTag (6,3):
 0249  0
 000
 399  249  0
 1000 00
 000
 02000 0
  End_Of_Tags.
   Keyed_Information:
  GTRasterTypeGeoKey (Short,1): RasterPixelIsPoint
  End_Of_Keys.
   End_Of_Geotiff.


Corner Coordinates:
 ... unable to transform points between pixel/line and PCS space
#

I also set the reference system using the following code:

/// c++ code 
  OGRSpatialReference oSRS;
  oSRS.SetProjCS( NoWhere );
  oSRS.SetWellKnownGeogCS( WGS84 );
  oSRS.SetEquirectangular( 0.0,// Centre lat
   0.0,// Centre lon
   0.0,   // False Easting
   0.0 ); // False Northing

  char* wkt = nullptr;

  if( OGRERR_NONE != oSRS.exportToPrettyWkt( wkt ) )
  {
 error...
  }

  if( CE_Failure == dataset-SetProjection( wkt ) )
  {
   error...
  }
///

So, why is listgeo not able to transform points between pixel/line
and PCS space?

I am happy to upload a full working example if needed.

Thank you.












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




--
---+--
I set the clouds in motion - turn up   | Frank Warmerdam, 
warmer...@pobox.com mailto:warmer...@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam 
http://pobox.com/%7Ewarmerdam

and watch the world go round - Rush| Geospatial Software Developer




smime.p7s
Description: S/MIME Cryptographic Signature
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev