Revision 8500
trunk/libraries/libJCRS/src/org/gvsig/crs/EpsgConnection.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
public void setConnectionEPSG() { |
21 | 21 |
try { |
22 |
connect = DriverManager.getConnection("jdbc:hsqldb:gvSIG/extensiones/org.gvsig.crs/db_epsg", "sa", ""); |
|
22 |
connect = DriverManager.getConnection("jdbc:hsqldb:file:gvSIG/extensiones/org.gvsig.crs/db_epsg", "sa", "");
|
|
23 | 23 |
} catch (SQLException e1) { |
24 | 24 |
e1.printStackTrace(); |
25 | 25 |
} |
... | ... | |
27 | 27 |
|
28 | 28 |
public void setConnectionIAU2000() { |
29 | 29 |
try { |
30 |
connect = DriverManager.getConnection("jdbc:hsqldb:gvSIG/extensiones/org.gvsig.crs/db_iau2000", "sa", ""); |
|
30 |
connect = DriverManager.getConnection("jdbc:hsqldb:file:gvSIG/extensiones/org.gvsig.crs/db_iau2000", "sa", "");
|
|
31 | 31 |
} catch (SQLException e1) { |
32 | 32 |
e1.printStackTrace(); |
33 | 33 |
} |
trunk/libraries/libJCRS/src/org/gvsig/crs/repository/EpsgRepository.java | ||
---|---|---|
59 | 59 |
*/ |
60 | 60 |
public class EpsgRepository implements ICrsRepository { |
61 | 61 |
|
62 |
public EpsgConnection connect = null; |
|
62 |
public EpsgConnection connection = null;
|
|
63 | 63 |
|
64 | 64 |
public EpsgRepository() { |
65 |
connect = new EpsgConnection(); |
|
66 |
connect.setConnectionEPSG(); |
|
65 |
connection = new EpsgConnection(); |
|
67 | 66 |
} |
68 | 67 |
|
69 | 68 |
/** |
... | ... | |
90 | 89 |
+ "FROM epsg_coordinatereferencesystem " |
91 | 90 |
+ "WHERE coord_ref_sys_code = " + code; |
92 | 91 |
|
93 |
result = Query.select(sentence,connect.getConnection()); |
|
92 |
connection.setConnectionEPSG(); |
|
93 |
result = Query.select(sentence,connection.getConnection()); |
|
94 | 94 |
|
95 |
/*try { |
|
96 |
connection.shutdown(); |
|
97 |
} catch (SQLException e) { |
|
98 |
// TODO Auto-generated catch block |
|
99 |
e.printStackTrace(); |
|
100 |
}*/ |
|
101 |
|
|
95 | 102 |
try { |
96 | 103 |
result.next(); |
97 | 104 |
source_cod = result.getInt("source_geogcrs_code"); |
... | ... | |
104 | 111 |
|
105 | 112 |
if (datum_code != 0){ |
106 | 113 |
source_yn = true; |
107 |
GetCRSepsg ep = new GetCRSepsg(epsg_code, source_yn, source_cod, projection_conv_code, connect); |
|
114 |
GetCRSepsg ep = new GetCRSepsg(epsg_code, source_yn, source_cod, projection_conv_code, connection);
|
|
108 | 115 |
ep.Getepsgdata(); |
109 | 116 |
} |
110 | 117 |
else if (source_cod != 0){ |
... | ... | |
112 | 119 |
} |
113 | 120 |
else source_yn = true; |
114 | 121 |
|
115 |
GetCRSepsg ep = new GetCRSepsg(epsg_code, source_yn, source_cod, projection_conv_code, connect); |
|
122 |
GetCRSepsg ep = new GetCRSepsg(epsg_code, source_yn, source_cod, projection_conv_code, connection);
|
|
116 | 123 |
ep.Getepsgdata(); |
117 | 124 |
|
118 | 125 |
if (crs_kind.equals("geographic 2D") || crs_kind.equals("geographic 3D")){ |
... | ... | |
134 | 141 |
// TODO Auto-generated catch block |
135 | 142 |
e.printStackTrace(); |
136 | 143 |
} |
137 |
|
|
138 | 144 |
return crs; |
139 | 145 |
} |
140 | 146 |
|
trunk/libraries/libJCRS/src/org/gvsig/crs/repository/Iau2000Repository.java | ||
---|---|---|
58 | 58 |
*/ |
59 | 59 |
public class Iau2000Repository implements ICrsRepository { |
60 | 60 |
|
61 |
EpsgConnection connect = null; |
|
61 |
EpsgConnection connection = null;
|
|
62 | 62 |
|
63 | 63 |
public Iau2000Repository() { |
64 |
connect = new EpsgConnection(); |
|
65 |
connect.setConnectionIAU2000(); |
|
64 |
connection = new EpsgConnection(); |
|
66 | 65 |
} |
67 | 66 |
|
68 | 67 |
/** |
... | ... | |
79 | 78 |
"FROM IAU2000 " + |
80 | 79 |
"WHERE iau_code = " + code; |
81 | 80 |
|
82 |
ResultSet result = Query.select(sentence,connect.getConnection()); |
|
81 |
connection.setConnectionIAU2000(); |
|
82 |
ResultSet result = Query.select(sentence,connection.getConnection()); |
|
83 | 83 |
try { |
84 |
connect.shutdown(); |
|
84 |
connection.shutdown();
|
|
85 | 85 |
} catch (SQLException e) { |
86 | 86 |
// TODO Auto-generated catch block |
87 | 87 |
e.printStackTrace(); |
trunk/extensions/extJCRS/src/org/gvsig/crs/JCrsExtension.java | ||
---|---|---|
43 | 43 |
|
44 | 44 |
import org.gvsig.crs.gui.panels.ProjChooserPanel; |
45 | 45 |
import org.gvsig.crs.persistence.RecentCRSsPersistence; |
46 |
|
|
47 | 46 |
import com.iver.andami.PluginServices; |
48 | 47 |
import com.iver.andami.plugins.Extension; |
49 | 48 |
import com.iver.cit.gvsig.fmap.crs.CRSFactory; |
... | ... | |
57 | 56 |
private static final String FACTORY_DEFAULT_PROJECTION = "EPSG:23030"; |
58 | 57 |
|
59 | 58 |
public void initialize() { |
59 |
|
|
60 | 60 |
CRSFactory.cp = new CrsFactory(); |
61 | 61 |
CRSSelectPanel.registerPanelClass(ProjChooserPanel.class); |
62 | 62 |
|
63 | 63 |
// Default Projection |
64 | 64 |
PluginServices ps = PluginServices.getPluginServices("com.iver.cit.gvsig"); |
65 | 65 |
XMLEntity xml = ps.getPersistentXML(); |
66 |
|
|
67 | 66 |
String projCode = null; |
68 | 67 |
if (xml.contains(DEFAULT_PROJECTION_KEY_NAME)) { |
69 | 68 |
projCode = xml.getStringProperty(DEFAULT_PROJECTION_KEY_NAME); |
Also available in: Unified diff