[Gdal-dev] pct2rgb.py

Curt, WE7U archer at eskimo.com
Thu Oct 14 14:05:22 EDT 2004


OGR questions:  Since OGR is part of GDAL, this list ok for these
questions too?

Code snippet.  Using the C API:


  if (transformH == NULL) fprintf(stderr,"T2=0\n");

  // Loop through all of the features in the layer.
  //
  while ( (featureH = OGR_L_GetNextFeature( layerH )) != NULL) {
    OGRGeometryH geometryH;
    int num = 0;

  // Just before this we lose the handle to our transform
  if (transformH == NULL) fprintf(stderr,"T3=0\n");



Results:
T3=0


By this point in the code I've already got a transform and a reverse
transform computed and ready for use.

1) Why does OGR_L_GetNextFeature() waste my transform?

2) How do I preserve transformH and reverse_transformH in this case?

3) These transforms are computed at the start of each layer loop.
Overkill?  Can I get away with just once per dataset, or might there
be different spatial references on each layer in some datasets?

--
Curt, WE7U			         http://www.eskimo.com/~archer
"Lotto:    A tax on people who are bad at math." -- unknown
"Windows:  Microsoft's tax on computer illiterates." -- WE7U
"The world DOES revolve around me:  I picked the coordinate system!"



More information about the Gdal-dev mailing list