5 |
# This program is free software under the GPL (>=v2) |
# This program is free software under the GPL (>=v2) |
6 |
# Read the file COPYING coming with Thuban for details. |
# Read the file COPYING coming with Thuban for details. |
7 |
|
|
8 |
import os, sys |
import os, sys, math |
9 |
from wxPython.wx import * |
from wxPython.wx import * |
10 |
|
|
11 |
from Thuban import _ |
from Thuban import _ |
156 |
WriteProjFile(projfile) |
WriteProjFile(projfile) |
157 |
except IOError, (errno, errstr): |
except IOError, (errno, errstr): |
158 |
self.__ShowError(projfile.GetFilename(), errstr) |
self.__ShowError(projfile.GetFilename(), errstr) |
159 |
self.availprojs.SetClientData([newproj, projfile]) |
self.availprojs.SetClientData(sel[0], [newproj, projfile]) |
160 |
|
|
161 |
def _OnAddToList(self, event): |
def _OnAddToList(self, event): |
162 |
|
|
612 |
panelSizer = wxBoxSizer(wxVERTICAL) |
panelSizer = wxBoxSizer(wxVERTICAL) |
613 |
|
|
614 |
if childPanel is not None: |
if childPanel is not None: |
615 |
panelSizer.Add(childPanel, 0, wxALL|wxEXPAND, 4) |
panelSizer.Add(childPanel, 0, wxEXPAND, 0) |
616 |
|
|
617 |
sizer = wxBoxSizer(wxHORIZONTAL) |
sizer = wxBoxSizer(wxHORIZONTAL) |
618 |
sizer.Add(wxStaticText(self, -1, _("Ellipsoid:")), 0, wxALL, 4) |
sizer.Add(wxStaticText(self, -1, _("Ellipsoid:")), 0, wxALL, 4) |
874 |
|
|
875 |
def __init__(self, parent, receiver): |
def __init__(self, parent, receiver): |
876 |
ProjPanel.__init__(self, parent) |
ProjPanel.__init__(self, parent) |
877 |
ProjPanel._DoLayout(self, None) |
|
878 |
|
self.__choices = [(_("Radians"), "1"), |
879 |
|
(_("Degrees"), "0.017453")] |
880 |
|
|
881 |
|
self.__scale = wxChoice(self, -1) |
882 |
|
for choice, value in self.__choices: |
883 |
|
self.__scale.Append(choice, value) |
884 |
|
|
885 |
|
self._DoLayout() |
886 |
|
|
887 |
def GetProjName(self): |
def GetProjName(self): |
888 |
return _("Geographic") |
return _("Geographic") |
889 |
|
|
890 |
def SetProjection(self, proj): |
def SetProjection(self, proj): |
891 |
|
value = proj.GetParameter("to_meter") |
892 |
|
for i in range(len(self.__choices)): |
893 |
|
choice, data = self.__choices[i] |
894 |
|
if value == data: |
895 |
|
self.__scale.SetSelection(i) |
896 |
ProjPanel.SetProjection(self, proj) |
ProjPanel.SetProjection(self, proj) |
897 |
|
|
898 |
def GetParameters(self): |
def GetParameters(self): |
899 |
params = ["proj=latlong"] |
params = ["proj=latlong", |
900 |
|
"to_meter=%s" % self.__scale.GetClientData( |
901 |
|
self.__scale.GetSelection())] |
902 |
|
|
903 |
params.extend(ProjPanel.GetParameters(self)) |
params.extend(ProjPanel.GetParameters(self)) |
904 |
return params |
return params |
905 |
|
|
906 |
def Clear(self): |
def Clear(self): |
907 |
ProjPanel.Clear(self) |
ProjPanel.Clear(self) |
908 |
|
|
909 |
|
def _DoLayout(self): |
910 |
|
sizer = wxBoxSizer(wxHORIZONTAL) |
911 |
|
|
912 |
|
sizer.Add(wxStaticText(self, -1, _("Source Data is in: ")), |
913 |
|
0, wxALL, 4) |
914 |
|
sizer.Add(self.__scale, 1, wxEXPAND|wxALL, 4) |
915 |
|
|
916 |
|
self.__scale.SetSelection(0) |
917 |
|
|
918 |
|
ProjPanel._DoLayout(self, sizer) |
919 |
|
|
920 |
|
|
921 |
ID_UTM_PROPOSE_ZONE_DIALOG_TAKE = 4001 |
ID_UTM_PROPOSE_ZONE_DIALOG_TAKE = 4001 |
922 |
ID_UTM_PROPOSE_ZONE_DIALOG_CANCEL = 4002 |
ID_UTM_PROPOSE_ZONE_DIALOG_CANCEL = 4002 |