Archive

Archive for the ‘GDAL/OGR’ Category

Using GDALWARP to reproject raster that will fit with Google Satellite

July 29th, 2008 rupert No comments

Just a couple of notes to onself using gdal: Use gdalwarp to reproject your GeoTIFF files! I wanted to use my own satellite images acquired from GeoEye, however, on some areas I wanted to use google sat images as well since I don’t have the coverage. In order to do so, I need to reproject the sat images to 900913. Note you need to specify this in your epsg file in my previous post.

rupert:beijing_900913_satellite rupert$ gdalinfo Mosaic_RGB.tif
Driver: GTiff/GeoTIFF
Files: Mosaic_RGB.tif
Size is 4248, 4553
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.2572235630016,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (116.291476140000000,40.025198500000002)
Pixel Size = (0.000046860000000,-0.000035970000000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_XRESOLUTION=100
  TIFFTAG_YRESOLUTION=100
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( 116.2914761,  40.0251985) (116d17'29.31"E, 40d 1'30.71"N)
Lower Left  ( 116.2914761,  39.8614271) (116d17'29.31"E, 39d51'41.14"N)
Upper Right ( 116.4905374,  40.0251985) (116d29'25.93"E, 40d 1'30.71"N)
Lower Right ( 116.4905374,  39.8614271) (116d29'25.93"E, 39d51'41.14"N)
Center      ( 116.3910068,  39.9433128) (116d23'27.62"E, 39d56'35.93"N)
Band 1 Block=4248x1 Type=Byte, ColorInterp=Red
Band 2 Block=4248x1 Type=Byte, ColorInterp=Green
Band 3 Block=4248x1 Type=Byte, ColorInterp=Blue
rupert:beijing_900913_satellite rupert$ gdalwarp -s_srs epsg:4326 -t_srs epsg:900913 Mosaic_RGB.tif sat_4m_rgb.tif
Creating output file that is 4245P x 4556L.
Processing input file Mosaic_RGB.tif.
0...10...20...30...40...50...60...70...80...90...100 - done.
rupert:beijing_900913_satellite rupert$ gdalinfo sat_4m_rgb.tif
Driver: GTiff/GeoTIFF
Files: sat_4m_rgb.tif
Size is 4245, 4556
Coordinate System is:
PROJCS["Google Maps Global Mercator",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.2572235630016,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Mercator_1SP"],
    PARAMETER["central_meridian",0],
    PARAMETER["scale_factor",1],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (12945507.907502911984921,4869604.732793668285012)
Pixel Size = (5.219801430503303,-5.219801430503303)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (12945507.908, 4869604.733) (116d17'29.31"E, 40d12'53.10"N)
Lower Left  (12945507.908, 4845823.317) (116d17'29.31"E, 40d 3'2.78"N)
Upper Right (12967665.965, 4869604.733) (116d29'25.89"E, 40d12'53.10"N)
Lower Right (12967665.965, 4845823.317) (116d29'25.89"E, 40d 3'2.78"N)
Center      (12956586.936, 4857714.025) (116d23'27.60"E, 40d 7'58.12"N)
Band 1 Block=4245x1 Type=Byte, ColorInterp=Red
Band 2 Block=4245x1 Type=Byte, ColorInterp=Green
Band 3 Block=4245x1 Type=Byte, ColorInterp=Blue

OGR Quick Reference

July 10th, 2007 rupert No comments

Here is a list of the most widely used OGR commands I use..

OGR2OGR
1. POSTGRES -> MAPINFO

$ ogr2ogr -f "Mapinfo File" busline_buffer10m.tab PG:"host=localhost user=postgres dbname=cybersoftbj" -sql "select * from table_name" -a_srs WGS84 -nln layer_name -nlt MULTIPOLYGON

2. MAPINFO -> POSTGRES

ogr2ogr -f "PostgreSQL" PG:"host=127.0.0.1 user=rupert dbname=australia password=*****" AUS_ROAD.TAB -nln AUS_ROAD -a_srs EPSG:4269 -t_srs EPSG:3857 -skip-failures
 
ogr2ogr -f "PostgreSQL" PG:"host=myhost user=myloginname dbname=mydbname password=mypassword" mytabfile.tab -nln newtablename -select columnName

Note: If you have Chinese characters, might as well do MAPINFO -> SHAPE -> POSTGRES
http://222.128.19.19/wordpress/?p=108

3. SHAPE -> POSTGRES

shp2pgsql -W "gbk" -s 4326 lbjrdnt_small_polyline roads > roads.sql

4. POSTGRES -> SHAPE

pgsql2shp -h 127.0.0.1 -u lbs -P tracking -f roads.shp databasename tablename

4. MAPINFO TO ORACLE

ogr2ogr -f OCI OCI:username/password@orcl C:\path_to_tabfile\EMPLOYEES.TAB -nln employees

Note: This assumes you already have Oracle 10g Client installed and “orcl” is defined as an instance in tnsnames.ora. OGR2OGR automatically updates USER_SDO_GEOM_METADATA and creates a spatial index.

5. MAPINFO to MAPINFO but different projection. From EPSG:4326 to EPSG:3857

 ogr2ogr -f "MapInfo File" BaseMaps_3857/AUS_CITIES_3857.TAB BaseMaps/AUS_CITIES.TAB -a_srs "EPSG:4326" -t_srs "EPSG:3857"
Categories: GDAL/OGR Tags: , , ,

Where on earth is Beijing, China?

July 4th, 2007 rupert 1 comment

Beijing China is located in EPSG:32650, UTM ZONE 50N on WGS84. UTM ZONE of the WORLD.

UTM WORLD

List of EPSG Codes

EPSG:4267 NAD27
EPSG:26710 NAD27 / UTM zone 10N
EPSG:26711 NAD27 / UTM zone 11N
EPSG:26712 NAD27 / UTM zone 12N
EPSG:26713 NAD27 / UTM zone 13N
EPSG:26714 NAD27 / UTM zone 14N
EPSG:26715 NAD27 / UTM zone 15N
EPSG:26716 NAD27 / UTM zone 16N
EPSG:26717 NAD27 / UTM zone 17N
EPSG:26718 NAD27 / UTM zone 18N
EPSG:26719 NAD27 / UTM zone 19N
EPSG:26720 NAD27 / UTM zone 20N
EPSG:26721 NAD27 / UTM zone 21N
EPSG:26722 NAD27 / UTM zone 22N
EPSG:26703 NAD27 / UTM zone 3N
EPSG:26704 NAD27 / UTM zone 4N
EPSG:26705 NAD27 / UTM zone 5N
EPSG:26706 NAD27 / UTM zone 6N
EPSG:26707 NAD27 / UTM zone 7N
EPSG:26708 NAD27 / UTM zone 8N
EPSG:26709 NAD27 / UTM zone 9N
EPSG:4269 NAD83
EPSG:26930 NAD83 / Alabama West
EPSG:26987 NAD83 / Massachusetts Island
EPSG:26986 NAD83 / Massachusetts Mainland
EPSG:32118 NAD83 / New York Long Island
EPSG:32128 NAD83 / Pennsylvania North
EPSG:32129 NAD83 / Pennsylvania South
EPSG:26910 NAD83 / UTM zone 10N
EPSG:26911 NAD83 / UTM zone 11N
EPSG:26912 NAD83 / UTM zone 12N
EPSG:26913 NAD83 / UTM zone 13N
EPSG:26914 NAD83 / UTM zone 14N
EPSG:26915 NAD83 / UTM zone 15N
EPSG:26916 NAD83 / UTM zone 16N
EPSG:26917 NAD83 / UTM zone 17N
EPSG:26918 NAD83 / UTM zone 18N
EPSG:26919 NAD83 / UTM zone 19N
EPSG:26920 NAD83 / UTM zone 20N
EPSG:26920 NAD83 / UTM zone 20N
EPSG:26921 NAD83 / UTM zone 21N
EPSG:26922 NAD83 / UTM zone 22N
EPSG:26923 NAD83 / UTM zone 23N
EPSG:26903 NAD83 / UTM zone 3N
EPSG:26904 NAD83 / UTM zone 4N
EPSG:26905 NAD83 / UTM zone 5N
EPSG:26906 NAD83 / UTM zone 6N
EPSG:26907 NAD83 / UTM zone 7N
EPSG:26908 NAD83 / UTM zone 8N
EPSG:26909 NAD83 / UTM zone 9N
EPSG:27582 NTF (Paris) / France II
EPSG:27700 OSGB 1936 / British National Grid
EPSG:4326 WGS 84
EPSG:32610 WGS 84 / UTM zone 10N
EPSG:32710 WGS 84 / UTM zone 10S
EPSG:32611 WGS 84 / UTM zone 11N
EPSG:32711 WGS 84 / UTM zone 11S
EPSG:32612 WGS 84 / UTM zone 12N
EPSG:32712 WGS 84 / UTM zone 12S
EPSG:32613 WGS 84 / UTM zone 13N
EPSG:32713 WGS 84 / UTM zone 13S
EPSG:32614 WGS 84 / UTM zone 14N
EPSG:32714 WGS 84 / UTM zone 14S
EPSG:32615 WGS 84 / UTM zone 15N
EPSG:32715 WGS 84 / UTM zone 15S
EPSG:32616 WGS 84 / UTM zone 16N
EPSG:32716 WGS 84 / UTM zone 16S
EPSG:32617 WGS 84 / UTM zone 17N
EPSG:32717 WGS 84 / UTM zone 17S
EPSG:32618 WGS 84 / UTM zone 18N
EPSG:32718 WGS 84 / UTM zone 18S
EPSG:32619 WGS 84 / UTM zone 19N
EPSG:32719 WGS 84 / UTM zone 19S
EPSG:32601 WGS 84 / UTM zone 1N
EPSG:32701 WGS 84 / UTM zone 1S
EPSG:32620 WGS 84 / UTM zone 20N
EPSG:32720 WGS 84 / UTM zone 20S
EPSG:32621 WGS 84 / UTM zone 21N
EPSG:32721 WGS 84 / UTM zone 21S
EPSG:32622 WGS 84 / UTM zone 22N
EPSG:32722 WGS 84 / UTM zone 22S
EPSG:32623 WGS 84 / UTM zone 23N
EPSG:32723 WGS 84 / UTM zone 23S
EPSG:32624 WGS 84 / UTM zone 24N
EPSG:32724 WGS 84 / UTM zone 24S
EPSG:32625 WGS 84 / UTM zone 25N
EPSG:32725 WGS 84 / UTM zone 25S
EPSG:32626 WGS 84 / UTM zone 26N
EPSG:32726 WGS 84 / UTM zone 26S
EPSG:32627 WGS 84 / UTM zone 27N
EPSG:32727 WGS 84 / UTM zone 27S
EPSG:32628 WGS 84 / UTM zone 28N
EPSG:32728 WGS 84 / UTM zone 28S
EPSG:32629 WGS 84 / UTM zone 29N
EPSG:32729 WGS 84 / UTM zone 29S
EPSG:32602 WGS 84 / UTM zone 2N
EPSG:32702 WGS 84 / UTM zone 2S
EPSG:32630 WGS 84 / UTM zone 30N
EPSG:32730 WGS 84 / UTM zone 30S
EPSG:32631 WGS 84 / UTM zone 31N
EPSG:32731 WGS 84 / UTM zone 31S
EPSG:32632 WGS 84 / UTM zone 32N
EPSG:32732 WGS 84 / UTM zone 32S
EPSG:32633 WGS 84 / UTM zone 33N
EPSG:32733 WGS 84 / UTM zone 33S
EPSG:32634 WGS 84 / UTM zone 34N
EPSG:32734 WGS 84 / UTM zone 34S
EPSG:32635 WGS 84 / UTM zone 35N
EPSG:32735 WGS 84 / UTM zone 35S
EPSG:32636 WGS 84 / UTM zone 36N
EPSG:32736 WGS 84 / UTM zone 36S
EPSG:32637 WGS 84 / UTM zone 37N
EPSG:32737 WGS 84 / UTM zone 37S
EPSG:32638 WGS 84 / UTM zone 38N
EPSG:32738 WGS 84 / UTM zone 38S
EPSG:32639 WGS 84 / UTM zone 39N
EPSG:32739 WGS 84 / UTM zone 39S
EPSG:32603 WGS 84 / UTM zone 3N
EPSG:32703 WGS 84 / UTM zone 3S
EPSG:32640 WGS 84 / UTM zone 40N
EPSG:32740 WGS 84 / UTM zone 40S
EPSG:32641 WGS 84 / UTM zone 41N
EPSG:32741 WGS 84 / UTM zone 41S
EPSG:32642 WGS 84 / UTM zone 42N
EPSG:32742 WGS 84 / UTM zone 42S
EPSG:32643 WGS 84 / UTM zone 43N
EPSG:32743 WGS 84 / UTM zone 43S
EPSG:32644 WGS 84 / UTM zone 44N
EPSG:32744 WGS 84 / UTM zone 44S
EPSG:32645 WGS 84 / UTM zone 45N
EPSG:32745 WGS 84 / UTM zone 45S
EPSG:32646 WGS 84 / UTM zone 46N
EPSG:32746 WGS 84 / UTM zone 46S
EPSG:32647 WGS 84 / UTM zone 47N
EPSG:32747 WGS 84 / UTM zone 47S
EPSG:32648 WGS 84 / UTM zone 48N
EPSG:32748 WGS 84 / UTM zone 48S
EPSG:32649 WGS 84 / UTM zone 49N
EPSG:32749 WGS 84 / UTM zone 49S
EPSG:32604 WGS 84 / UTM zone 4N
EPSG:32704 WGS 84 / UTM zone 4S
EPSG:32650 WGS 84 / UTM zone 50N
EPSG:32750 WGS 84 / UTM zone 50S
EPSG:32651 WGS 84 / UTM zone 51N
EPSG:32751 WGS 84 / UTM zone 51S
EPSG:32652 WGS 84 / UTM zone 52N
EPSG:32752 WGS 84 / UTM zone 52S
EPSG:32653 WGS 84 / UTM zone 53N
EPSG:32753 WGS 84 / UTM zone 53S
EPSG:32654 WGS 84 / UTM zone 54N
EPSG:32754 WGS 84 / UTM zone 54S
EPSG:32655 WGS 84 / UTM zone 55N
EPSG:32755 WGS 84 / UTM zone 55S
EPSG:32656 WGS 84 / UTM zone 56N
EPSG:32756 WGS 84 / UTM zone 56S
EPSG:32657 WGS 84 / UTM zone 57N
EPSG:32757 WGS 84 / UTM zone 57S
EPSG:32658 WGS 84 / UTM zone 58N
EPSG:32758 WGS 84 / UTM zone 58S
EPSG:32659 WGS 84 / UTM zone 59N
EPSG:32759 WGS 84 / UTM zone 59S
EPSG:32605 WGS 84 / UTM zone 5N
EPSG:32705 WGS 84 / UTM zone 5S
EPSG:32660 WGS 84 / UTM zone 60N
EPSG:32760 WGS 84 / UTM zone 60S
EPSG:32606 WGS 84 / UTM zone 6N
EPSG:32706 WGS 84 / UTM zone 6S
EPSG:32607 WGS 84 / UTM zone 7N
EPSG:32707 WGS 84 / UTM zone 7S
EPSG:32608 WGS 84 / UTM zone 8N
EPSG:32708 WGS 84 / UTM zone 8S
EPSG:32609 WGS 84 / UTM zone 9N
EPSG:32709 WGS 84 / UTM zone 9S
Categories: GDAL/OGR Tags:

Mapinfo Utility for gdal_translate.

June 21st, 2007 rupert Comments off

I made a small perl utility to automate the gcp’s from Mapinfo Raster TABS to gdal_translate command line. Currently your tabfile would have:

!table
!version 300
!charset WindowsLatin1
 
Definition Table
  File "beijing_6th_1.jpg"
  Type "RASTER"
  (116.522865,40.016316) (347,184) Label "Pt 1",
  (116.681215,40.015286) (7729,243) Label "Pt 2",
  (116.679777,39.777904) (7666,14674) Label "Pt 3",
  (116.523827,39.779108) (397,14606) Label "Pt 4"
  CoordSys Earth Projection 1, 104
  Units "degree"
  RasterStyle 4 1
  RasterStyle 7 1677695

How to use
gdal_mapinfo

1. ls *.TAB > init.sh

2. vi init.sh to reflect the ff:

perl gdal_mapinfo.pl Beijing_6th_1.TAB >> final.bat
perl gdal_mapinfo.pl Beijing_6th_10.TAB >> final.bat
perl gdal_mapinfo.pl Beijing_6th_11.TAB >> final.bat
perl gdal_mapinfo.pl Beijing_6th_12.TAB >> final.bat
perl gdal_mapinfo.pl Beijing_6th_13.TAB >> final.bat
perl gdal_mapinfo.pl Beijing_6th_2.TAB >> final.bat
perl gdal_mapinfo.pl Beijing_6th_3.TAB >> final.bat
perl gdal_mapinfo.pl Beijing_6th_4.TAB >> final.bat
perl gdal_mapinfo.pl Beijing_6th_5.TAB >> final.bat
perl gdal_mapinfo.pl Beijing_6th_6.TAB >> final.bat
perl gdal_mapinfo.pl Beijing_6th_7.TAB >> final.bat
perl gdal_mapinfo.pl Beijing_6th_8.TAB >> final.bat
perl gdal_mapinfo.pl Beijing_6th_9.TAB >> final.bat

3. The resulting final.bat should have the ff:
gdal_translate -gcp 347 184 116.522865 40.016316 -gcp 7729 243 116.681215 40.015286 -gcp 7666 14674 116.679777 39.777904 -gcp 397 14606 116.523827 39.779108 -of GTiff Beijing_6th_1.jpg I:\\satimages\translated\Beijing_6th_1_translated.tif

gdalwarp -s_srs epsg:4326 -t_srs epsg:4326 I:\\satimages\translated\Beijing_6th_1_translated.tif
I:\\satimages\warped\Beijing_6th_1.tif

Categories: GDAL/OGR Tags: , , , ,

Processing Mapinfo Raster JPEG Images using GDAL

June 14th, 2007 rupert Comments off

I have a couple of sat images (raw jpegs) from Google that I want to use with Openlayers/Mapserver. The raw jpegs were registered using Mapinfo via GCP (Ground Control Points).

Mapinfo Raster JPEG Images example:

rupert@rupert-winxp /e/home/map/beijing/new/satimages$ ll
-rw-r–r– 1 rupert None 358 Jan 30 03:23 2NE1.TAB
-rw-r–r– 1 rupert None 7.1M Jan 30 02:38 2NE1.jpg
-rw-r–r– 1 rupert None 356 Feb 1 18:56 2NE2a.TAB
-rw-r–r– 1 rupert None 3.8M Feb 1 08:57 2NE2a.jpg

You cannot fully reference 2NE1.TAB as a Mapserver Layer. I tried to use 2NE1.jpg, but the problem its not georeferenced.

rupert@rupert-winxp /e/home/map/beijing/new/satimages
$ gdalinfo 2NE1.jpg
Driver: JPEG/JPEG JFIF
Size is 8650, 6744
Coordinate System is `'
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 6744.0)
Upper Right ( 8650.0,    0.0)
Lower Right ( 8650.0, 6744.0)
Center      ( 4325.0, 3372.0)
Band 1 Block=8650x1 Type=Byte, ColorInterp=Red
Band 2 Block=8650x1 Type=Byte, ColorInterp=Green
Band 3 Block=8650x1 Type=Byte, ColorInterp=Blue

The georeference coordinates of 2NE1.jpg, just like an ESRI World File, is found in 2NE1.TAB…

rupert@rupert-winxp /e/home/map/beijing/new/satimages
$ cat 2NE1.TAB
!table
!version 300
!charset WindowsLatin1
 
Definition Table
  File "2ne1.jpg"
  Type "RASTER"
  (116.38575,39.906105) (349,6619) Label "Pt 1",
  (116.390072,39.93201) (1160,317) Label "Pt 2",
  (116.42786,39.932296) (8210,253) Label "Pt 3",
  (116.4295878,39.90722318) (8522,6358) Label "Pt 4"
  CoordSys Earth Projection 1, 0
  Units "degree"

I found hurting myself in trying to create an ESRI world file from the current MAPINFO Raster TABS. So, I decided to go for GeoTIFF since its native in Mapserver. Using GDAL utilities my only problem is how to put a coordinate system and reference to the raster.

On windows, you could use Frank’s FWTools. For Linux, compile GDAL by source with python would be extremely helpful later on. For installation of GDAL on Linux, we can use Mapserver’s Verbose Installation in Linux Guide.

GDAL – the saviour!.

GDAL utilities is extremely helpful in reprojection, scaling, image mosaics, etc. For now, we will use gdal_translate and gdal_warp. Please RTFM the utilities.

1. Using gdal_translate to specify the gcp’s registered in Mapinfo.

gdal_translate -gcp pixel line easting northing
Add the indicated ground control point to the output dataset. This option may be provided multiple times to provide a set of GCPs.



$ gdal_translate -gcp 349 6619 116.38575 39.906105 -gcp 1160 317 116.390072 39.93201 -gcp 8210 253 116.42786 39.932296 -gcp 8522 6358 116.4295878 39.90722318 -of GTiff 2NE1.jpg 2NE1translated.tif

Input file size is 8650, 6744
0...10...20...30...40...50...60...70...80...90...100 - done.

Note: even if we specify the gcp’s, gdal_translate would not specify the corner coordinates of the tiff.

rupert@rupert-winxp /e/home/map/beijing/new/satimages
$ gdalinfo 2NE1translated.tif
Driver: GTiff/GeoTIFF
Size is 8650, 6744
Coordinate System is `'
GCP Projection =
GCP[  0]: Id=1, Info=
          (349,6619) -> (116.38575,39.906105,0)
GCP[  1]: Id=2, Info=
          (1160,317) -> (116.390072,39.93201,0)
GCP[  2]: Id=3, Info=
          (8210,253) -> (116.42786,39.932296,0)
GCP[  3]: Id=4, Info=
          (8522,6358) -> (116.4295878,39.90722318,0)
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 6744.0)
Upper Right ( 8650.0,    0.0)
Lower Right ( 8650.0, 6744.0)
Center      ( 4325.0, 3372.0)
Band 1 Block=8650x1 Type=Byte, ColorInterp=Red
Band 2 Block=8650x1 Type=Byte, ColorInterp=Green
Band 3 Block=8650x1 Type=Byte, ColorInterp=Blue

2. Use gdalwarp to reproject using the gcp and specify the coordinates.

The gdalwarp utility is an image mosaicing, reprojection and warping utility. The program can reproject to any supported projection, and can also apply GCPs stored with the image if the image is “raw” with control information.


$ gdalwarp -s_srs epsg:4326 -t_srs epsg:4326 2NE1translated.tif warped.tif
Creating output file that is 9422P x 5631L.
Processing input file 2NE1translated.tif.
:0...10...20...30...40...5050...60...70...80...90...

Let’s check after gdalwarp using gdalinfo…

$ gdalinfo warped.tif
Driver: GTiff/GeoTIFF
Size is 9422, 5631
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.2572235630016,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (116.383841930499160,39.933342296341991)
Pixel Size = (0.000004927579869,-0.000004927579869)
Metadata:
  AREA_OR_POINT=Area
Corner Coordinates:
Upper Left  ( 116.3838419,  39.9333423) (116d23'1.83"E, 39d56'0.03"N)
Lower Left  ( 116.3838419,  39.9055951) (116d23'1.83"E, 39d54'20.14"N)
Upper Right ( 116.4302696,  39.9333423) (116d25'48.97"E, 39d56'0.03"N)
Lower Right ( 116.4302696,  39.9055951) (116d25'48.97"E, 39d54'20.14"N)
Center      ( 116.4070558,  39.9194687) (116d24'25.40"E, 39d55'10.09"N)
Band 1 Block=9422x1 Type=Byte, ColorInterp=Red
Band 2 Block=9422x1 Type=Byte, ColorInterp=Green
Band 3 Block=9422x1 Type=Byte, ColorInterp=Blue

Sweet. Now, all we need to do is display the raster images in Mapserver/OpenLayers.

Specifying a raster image in Mapserver

LAYER
NAME “2NE1″
DATA “satimages/2NE1.tif”
TYPE RASTER
STATUS DEFAULT
END

LAYER
NAME “2NE2″
DATA “satimages/2NE2a.tif”
TYPE RASTER
STATUS DEFAULT
END

Here is the end result…
.

Lessons learned, I tried to specify coordinate extents using gdal_translate -a_ullr ulx uly lrx lry. Specifying the coordinates was subjective by just looking at the cursor location of the registered image in Mapinfo. It is still best to use the GCP’s. Simply put, we need to be accurate in specifying corner coordinates in raster images to project them accurately.

.