On Fri, 4 Mar 2005, Charles Kane wrote:
> Does anyone know of a program or the code that will allow me to open
> files in batch and specify the projection? How about code to open all of
> the files that are in the same directory without knowing the names?
I believe there's MapBasic code at Jacques Paris' web site that shows you
how to use the FindFirst and FindNext Windows API calls from MapBasic to
get lists of files from directories.
As to registering the TIF files, you'll need to know their extents to
register them. Years ago, Dimitry Bogdanov posted some code to MapInfo-L
that showed where to get the pixel width and heights of various raster
formats. Here's the bit for TIFF files:
Open File FileName$ For Binary Access Read As #1
Get #1, 1, iByteOrder
If iByteOrder = 19789 Then 'MM
Close File #1
Open File FileName$ For Binary Access Read As #1 ByteOrder HIGHLOW
End If
Get #1, 5, Offset
Offset = Offset + 1
Get #1, Offset, NumTags
For i = 0 To NumTags - 1
Get #1, 2 + Offset + i * 12, Val
Do Case Val
Case 256
Get #1, 10 + Offset + i * 12, siWidth
Case 257
Get #1, 10 + Offset + i * 12, siHeight
Exit For
End Case
Next
Width = siWidth
Height = siHeight
So if no one has any ready-to-use solution, this should give you something
to start with!
- Bill Thoen
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 15533