[Gdal-dev] Gdal_translate. Scaling, sizing, georeferencing

Sampson, David dsampson at NRCan.gc.ca
Tue Nov 21 10:01:06 EST 2006


Hey Folks,

Synopsis.
---------------
 I am using gdal_translate within a VB application to georeference
photos. The X Y are grabbed by user input and Long Lat is grabbed from a
database. The outcome is pretty close to what I need but a few
behaviours I did not expect.

1. When I am using outsize I was hoping that this would decrease my
resolution and keep a georefed image, but it seems to make the photos
smaller (which makes sense I guess)
2. It appears as though I am maintaining my resoltuion, which I want to
drop without affecting geo-referencing
3. Whether I use a factor of 1 (100%), 1.5 (66%) or 4 (25%) I would
expect that all three geo-referenced images would accupy the same space,
but different resolutions.
4. The goal is to have a near perfect overlap with images that were
created using an old script that I hope to replace with gdal.

I have provided some info bellow.

What other bits of info do I need.

Thanks

The Command line so far:
-------------------------------------
gdal_translate -gcp 394.15 212.23 -76.777261  45.67899 -gcp 6001.45
272.87 -76.744739  45.678655 -gcp 5888.83 7561.67 -76.745361  45.649344
-gcp 285.87 7488.04 -76.777866  45.649679 -scale  -ot byte  -outsize
25% 25% -a_srs WGS84  -mo "Area_or_Point = Area "  A38_001.tif
oA38_001.tif

Disection:
--------------
 four control points
Scaling to keep 8 bit histogram 0 to 255
Output Type as byte (moving from 16 bit to 8 bit)
Outsize, either 25% or 66%, based on scaling factor of 4 or 1.5
respectively
Defining projection with generic WGS84 (a small assumption right now,
but I believe this is what the long lat is based on in the DB)
A single metadata tag
Source and destination images

Images:

These are aerial images with aprox 60 percent overlap

(Screen captures removed, Available upon request in a direct mail)

In the screen captures (if they came through) it shows what should be
geo-reffed photos. The large overlapping ones were created in an old
script that I'm trying to replace using gdal_translate

Gdal_info
---------------

Old Script (66%)
============
Driver: GTiff/GeoTIFF
Size is 4162, 5238
Coordinate System is:
GEOGCS["unnamed",
    DATUM["unknown",
        SPHEROID["unretrievable - using WGS84",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4201"]]
Origin = (-76.779526,45.680473)
Pixel Size = (0.00000878,-0.00000624)
Metadata:
  AREA_OR_POINT=Area
Corner Coordinates:
Upper Left  ( -76.7795258,  45.6804733) ( 76d46'46.29"W, 45d40'49.70"N)
Lower Left  ( -76.7795258,  45.6477890) ( 76d46'46.29"W, 45d38'52.04"N)
Upper Right ( -76.7429962,  45.6804733) ( 76d44'34.79"W, 45d40'49.70"N)
Lower Right ( -76.7429962,  45.6477890) ( 76d44'34.79"W, 45d38'52.04"N)
Center      ( -76.7612610,  45.6641312) ( 76d45'40.54"W, 45d39'50.87"N)
Band 1 Block=4162x1 Type=Byte, ColorInterp=Gray

New script (66%)
==============
Driver: GTiff/GeoTIFF
Size is 4183, 5264
Coordinate System is `'
GCP Projection = GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS
84",6378137,298.2572235630016,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG"
,"6326"]],PRIM
EM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","43
26"]]
GCP[  0]: Id=1, Info=
          (394.15,212.23) -> (-76.7773,45.679,0)
GCP[  1]: Id=2, Info=
          (6001.45,272.87) -> (-76.7447,45.6787,0)
GCP[  2]: Id=3, Info=
          (5888.83,7561.67) -> (-76.7454,45.6493,0)
GCP[  3]: Id=4, Info=
          (285.87,7488.04) -> (-76.7779,45.6497,0)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_XRESOLUTION=800
  TIFFTAG_YRESOLUTION=800
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  Area_or_Point =Area
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 5264.0)
Upper Right ( 4183.0,    0.0)
Lower Right ( 4183.0, 5264.0)
Center      ( 2091.5, 2632.0)
Band 1 Block=4183x1 Type=Byte, ColorInterp=Gray


Problems:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20061121/c5eef88b/attachment.html


More information about the Gdal-dev mailing list