Hi Jay,

I did dig this up from a source file of mine:

'**********************************************************************************************''
'Returns the name of the raster file af tab file refers to 
'**********************************************************************************************''
Function GetRasterFileFromTabFile$(ByVal szTabFile As String) As String

Dim     szLine, szPath, szFile As String,
        i, j As Integer

OnError GoTo ErrorOccured

GetRasterFileFromTabFile$ = ""

        If not FileExists(szTabFile) Then
                Exit Function
        End If

        Open File szTabFile
                For Input Access Read
                As #9
                CharSet SystemInfo(SYS_INFO_CHARSET)

        Line Input #9, szLine
        Do Until EOF(9)
                If Left$(LTrim$(szLine),4) = "File" Then
                        i = InStr(1, szLine, """")
                        j = InStr(i + 1, szLine, """")
                        If i > 0 and j > 0 Then
                                szFile = Mid$(szLine, i + 1, j - i - 1)
                                Exit Do
                        End If
                End If
                Line Input #9,szLine
        Loop

        Close File #9

        If szFile <> "" Then
                szPath = PathToDirectory$(szTabFile)
                szFile = GetFileNameAbsolutePath$(szFile, szPath)
        End If

        GetRasterFileFromTabFile$ = szFile

        Exit Function
'-------------------------
ErrorOccured:
        Note "Some error occured: " & Error$()

End Function
'************************************************************************

I hope it can be of some help for you,

Peter Horsb�ll M�ller
GIS Developer
Geographical Information & IT
 
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
 
Tel     +45 6311 4900
Direct  +45 6311 4908
Mob     +45 5156 1045
Fax     +45 6311 4949
E-mail  [EMAIL PROTECTED]
http://www.cowi.dk/gis


-----Original Message-----
From: Jakob Lanstorp [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 21, 2004 9:27 PM
To: Jay C Russell
Cc: [EMAIL PROTECTED]
Subject: RE: MI-L Path to raster from TAB file?


I guess you in MapInfo when you are trying to pull the raster path. There you can run 
a 
print tableinfo("MYTABLE",19) this returns only the tab path not the raster path. If 
you know the raster type you can swap the tab extension to sid or what ever type of 
your raster. If you donsen't know the raster extension you will just have to try all 
raster extension with a FileExists function in MapBasic or some place else.
 
Mvh. | Regards

Jakob Lanstorp
Senior Consultant
Geographical Information & IT

COWI A/S
Odensevej 95
DK-5260 Odense S
 
Tel       +45 63 11 49 00
Direct   +45 63 11 48 62
Fax      +45 63 11 49 49
Email     [EMAIL PROTECTED]
http://www.cowi.dk 

________________________________

From: Jay C Russell [mailto:[EMAIL PROTECTED]
Sent: Thu 10/21/2004 20:39
To: [EMAIL PROTECTED]
Subject: MI-L Path to raster from TAB file?







Is there any way to pull out the actual path to a raster file from its associated TAB 
file? Here is an example of the TAB file format, but I would like to avoid having to 
parse this file to get the path setting.

!Table:
!Version 300
!Charset WindowsLatin1

Definition Table
  File "\\gistest\Aerials\2002 AERIALS\77xx\7757.SID"
  Type "RASTER"
  (3453298.2761889999 ,721699.24370300001)  (0,0) Label "Pt 1.1" ,
  (3453299.2761889999 ,721699.24370300001)  (1,0) Label "Pt 1.2" ,
  (3453298.2761889999 ,721698.24370300001)  (0,1) Label "Pt 1.3" ,
  (3453398.2761889999 ,721599.24370300001)  (100,100) Label "Pt 2.1" ,
  (3453398.2761889999 ,721699.24370300001)  (100,0) Label "Pt 2.2" ,
  (3453298.2761889999 ,721599.24370300001)  (0,100) Label "Pt 2.3" ,
  (3453498.2761889999 ,721499.24370300001)  (200,200) Label "Pt 3.1" ,
  (3453498.2761889999 ,721699.24370300001)  (200,0) Label "Pt 3.2" ,
  (3453298.2761889999 ,721499.24370300001)  (0,200) Label "Pt 3.3"
  CoordSys Earth Projection 3, 62, "survey ft", -99, 27.8333333333, 28.3833333333, 
30.2833333333, 2000000, 0 Bounds (-221554461.125,
-185747019.928) (225554461.125, 261361902.322)
  Units "survey ft"


Thanks in advance,
Jay Russell



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, 
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 13802





---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 13805

Reply via email to