1

I have a TIFF image file and I need to extract the latitude and longitude values (in decimal degrees) for each pixel's corners. I have the latitude and longitude values for the top right, top left , bottom right and bottom left corners. Along with this, I also have the pixel values for each pixel in the image.

How do I perform this task in ENVI or in IDL?

Do I need to some information about the TIFF file in order to proceed?

Vince
  • 20,017
  • 15
  • 45
  • 64
Dark_Knight
  • 199
  • 1
  • 3
  • 14
  • Have you actually tried to do this in either ENVI or IDL? If so, which do you want to ask about in this question, and where did you get stuck when you tried to do it? – PolyGeo Dec 14 '16 at 08:30
  • I am new to both envi and idl. I am not much familiar with their environment so I couldn't do anything on that. However, suggestion for any other platform is also appreciated. – Dark_Knight Dec 14 '16 at 08:33
  • 1
    I recommend not thinking about GIS SE as being some sort of online GIS tutor. For your questions to be answered here they should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. – PolyGeo Dec 14 '16 at 08:39
  • @PolyGeo Will keep in mind. – Dark_Knight Dec 14 '16 at 08:42
  • @nmtoken Isn't that a program for finding pixel values? I already have that. – Dark_Knight Dec 14 '16 at 08:47
  • Raster formats exist to prevent the need for associating each pixel with an explict geolocation. It is simple enough to do with the right interface, but requires a huge increase in storage size (12x-50x increase), and thetefore shouldn't be done (which is why some tools may not make it easy). – Vince Dec 14 '16 at 12:15
  • @Vince When you say each pixel is associated with an explicit geolocation, do you mean that geolocation is at the centers of the corresponding pixel or all the 4 corners of the pixels are given a unique explicit geolocation ? – Dark_Knight Dec 14 '16 at 12:44
  • The "geo" part of GeoTIFF means that the upper-left and lower-right corners are known, which means that all four corners, and the five centers, of all pixels is known as well (it's just math). – Vince Dec 14 '16 at 13:38

1 Answers1

3

Do I need to some information about the tiff file in order to proceed?

You'll need to know the size of the pixels for a start, and you could use GDAL for that, see:

How do I find out the resolution in (centimeters per pixel) of a TIF?

I am new to both ENVI and IDL. I am not much familiar with their environment so I couldn't do anything on that. However, suggestion for any other platform is also appreciated.

As far as using IDL to call GDAL, though, it doesn't look like it's possible; there is a discussion on the gdal-dev mailing list about this point. With a conclusion to just use Python.

Apparently:

IDL and Python Numeric have a similar syntax and perhaps you would find it easiest to just write your routines in Python

This page is a summary of the mapping between IDL and numarray commands

http://www.johnny-lin.com/cdat_tips/tips_array/idl2num.html

Reference: http://marc.info/?l=gdal-dev&m=121322983508766&w=2

There are quite a few questions on gis.stackexchange that deal with GDAL+Python+Tiff, so you should be able to get enough of a hint to progress.

nmtoken
  • 13,355
  • 5
  • 38
  • 87
  • Is there any way to convert the pixel values to latitude and longitude? If yes then will this lat-long co-ordinate will be at the center of each pixel? – Dark_Knight Dec 14 '16 at 09:56