Skip to content

Commit 7ab5cde

Browse files
committed
merge conflicts
1 parent 484de6d commit 7ab5cde

15 files changed

+1521
-27
lines changed

CoordsysTool.mb

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ Sub GetTableCoordSys 'Blockstart
2222

2323
' Find the projection
2424
TheProjection = TableInfo(TableName, TAB_INFO_COORDSYS_CLAUSE)
25-
26-
Note "The coordinate system for " + TableName + " is:" & CoordSysName$(TheProjection) & Chr$(10) & Chr$(10) & "See the print window for more information."
2725

28-
Print "The coordinate system for " + TableName + " is:" & CoordSysName$(TheProjection) & Chr$(10) & Chr$(10) & "Full MapInfo coord string: " & Chr$(10) & TheProjection & Chr$(10) & Chr$(10) & "EPSG: " & CoordSysStringToEPSG(TheProjection) & Chr$(10) & "PRJ: " & CoordSysStringToPRJ$(TheProjection) & Chr$(10) & "WKT: " & CoordSysStringToWKT$(TheProjection) & Chr$(10)
29-
26+
Call ShowCoordsys(TheProjection)
27+
3028
End Sub 'Blockend
3129

3230
Sub GetWindowCoordSys 'Blockstart
@@ -46,19 +44,17 @@ Sub GetWindowCoordSys 'Blockstart
4644

4745
If WindowType = WIN_MAPPER Then
4846
TheProjection = MapperInfo(TheWindowID, MAPPER_INFO_COORDSYS_CLAUSE)
49-
Note "The projection is:" & Chr$(10) & CoordSysName$(TheProjection) & Chr$(10) & Chr$(10) & "See the print window for more information."
50-
51-
Print "The coordinate system is:" & CoordSysName$(TheProjection) & Chr$(10) & Chr$(10) & "Full MapInfo coord string: " & Chr$(10) & TheProjection & Chr$(10) & Chr$(10) & "EPSG: " & CoordSysStringToEPSG(TheProjection) & Chr$(10) & "PRJ: " & CoordSysStringToPRJ$(TheProjection) & Chr$(10) & "WKT: " & CoordSysStringToWKT$(TheProjection) & Chr$(10)
47+
48+
Call ShowCoordsys(TheProjection)
5249

5350
ElseIf WindowType = WIN_BROWSER Then
54-
Dim TableName as String
51+
'Dim TableName as String
5552

56-
TableName = WindowInfo(TheWindowId, WIN_INFO_TABLE)
57-
TheProjection = TableInfo(TableName, TAB_INFO_COORDSYS_CLAUSE)
53+
'TableName = WindowInfo(TheWindowId, WIN_INFO_TABLE)
54+
'TheProjection = TableInfo(TableName, TAB_INFO_COORDSYS_CLAUSE)
55+
TheProjection = TableInfo(WindowInfo(TheWindowId, WIN_INFO_TABLE), TAB_INFO_COORDSYS_CLAUSE)
5856

59-
Note "The projection is:" & Chr$(10) & CoordSysName$(TheProjection) & Chr$(10) & Chr$(10) & "See the print window for more information."
60-
61-
Print "The coordinate system is:" & CoordSysName$(TheProjection) & Chr$(10) & Chr$(10) & "Full MapInfo coord string: " & Chr$(10) & TheProjection & Chr$(10) & Chr$(10) & "EPSG: " & CoordSysStringToEPSG(TheProjection) & Chr$(10) & "PRJ: " & CoordSysStringToPRJ$(TheProjection) & Chr$(10) & "WKT: " & CoordSysStringToWKT$(TheProjection) & Chr$(10)
57+
Call ShowCoordsys(TheProjection)
6258
Else
6359
Note "Can't get the projection for that window."
6460
End If
@@ -67,3 +63,15 @@ Sub GetWindowCoordSys 'Blockstart
6763
Borked:
6864
Note "Error: "+ Error$()
6965
End Sub 'Blockend
66+
67+
Sub ShowCoordsys(proj as string) 'Blockstart
68+
Note "The coordinate system is: " & CoordSysName$(proj) & Chr$(10) & Chr$(10) &
69+
"See the print window for more information."
70+
71+
Print "The coordinate system is:" &
72+
CoordSysName$(proj) & Chr$(10) & Chr$(10) &
73+
"Full MapInfo coord string: " & Chr$(10) & proj & Chr$(10) & Chr$(10) &
74+
"EPSG: " & CoordSysStringToEPSG(proj) & Chr$(10) &
75+
"PRJ: " & CoordSysStringToPRJ$(proj) & Chr$(10) &
76+
"WKT: " & CoordSysStringToWKT$(proj) & Chr$(10)
77+
End Sub 'Blockend

CoordsysTool.mb.bak

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
'****************************************************************
2+
'* Jake's Amazing Toolbar - Coordsys Module *
3+
'* 2009-2011 All Rights Reserved *
4+
'* Source available at github.com/mrchimp/JakesMapbasicToolbars *
5+
'****************************************************************
6+
7+
Include "icons.def"
8+
Include "mapbasic.def"
9+
Include "globals.def"
10+
11+
Sub GetTableCoordSys 'Blockstart
12+
Dim TableName as String
13+
Dim TheProjection as String
14+
15+
If NumTables() < 1 Then Exit Sub End If
16+
17+
' Pick a table
18+
TableName = ChooseTable()
19+
If TableName = "" Then ' check user didn't press cancel
20+
Exit Sub
21+
End If
22+
23+
' Find the projection
24+
TheProjection = TableInfo(TableName, TAB_INFO_COORDSYS_CLAUSE)
25+
26+
Call ShowCoordsys(TheProjection)
27+
28+
End Sub 'Blockend
29+
30+
Sub GetWindowCoordSys 'Blockstart
31+
OnError Goto Borked
32+
33+
If NumWindows() < 1 Then Exit Sub End If
34+
35+
Dim TheProjection as String ' projection string in MapInfo format
36+
Dim WindowType as Integer ' mapper/layout etc
37+
Dim WindowNum as Integer ' Not quite sure what the difference is
38+
Dim TheWindowID as integer ' between these two. It makes no sense!
39+
' But it works so I guess it's ok.
40+
41+
WindowNum = FrontWindow()
42+
WindowType = WindowInfo(WindowNum, WIN_INFO_TYPE)
43+
TheWindowID = WindowID(WindowNum)
44+
45+
If WindowType = WIN_MAPPER Then
46+
TheProjection = MapperInfo(TheWindowID, MAPPER_INFO_COORDSYS_CLAUSE)
47+
48+
Call ShowCoordsys(TheProjection)
49+
50+
ElseIf WindowType = WIN_BROWSER Then
51+
'Dim TableName as String
52+
53+
<<<<<<< HEAD
54+
'TableName = WindowInfo(TheWindowId, WIN_INFO_TABLE)
55+
'TheProjection = TableInfo(TableName, TAB_INFO_COORDSYS_CLAUSE)
56+
TheProjection = TableInfo(WindowInfo(TheWindowId, WIN_INFO_TABLE), TAB_INFO_COORDSYS_CLAUSE)
57+
58+
Call ShowCoordsys(TheProjection)
59+
=======
60+
Note "The projection is:" & Chr$(10) & CoordSysName$(TheProjection) & Chr$(10) & Chr$(10) & "See the print window for more information."
61+
62+
Print "The coordinate system is:" & CoordSysName$(TheProjection) & Chr$(10) & Chr$(10) & "Full MapInfo coord string: " & Chr$(10) & TheProjection & Chr$(10) & Chr$(10) & "EPSG: " & CoordSysStringToEPSG(TheProjection) & Chr$(10) & "PRJ: " & CoordSysStringToPRJ$(TheProjection) & Chr$(10) & "WKT: " & CoordSysStringToWKT$(TheProjection) & Chr$(10)
63+
>>>>>>> 484de6d56056ffec401578b262efea7156acab12
64+
Else
65+
Note "Can't get the projection for that window."
66+
End If
67+
68+
Exit Sub
69+
Borked:
70+
Note "Error: "+ Error$()
71+
End Sub 'Blockend

0 commit comments

Comments
 (0)