| 121 |
121 |
setAuthorityTarget(authority_target[0]);
|
| 122 |
122 |
int target = Integer.parseInt(authority_target[1]);
|
| 123 |
123 |
real_target = target;
|
| 124 |
|
String sentence = "SELECT source_geogcrs_code, coord_ref_sys_kind " +
|
| 125 |
|
"FROM epsg_coordinatereferencesystem " +
|
| 126 |
|
"WHERE coord_ref_sys_code = "+ target ;
|
|
124 |
String sentence = "SELECT source_geogcrs_code, coord_ref_sys_kind "
|
|
125 |
+ "FROM epsg_coordinatereferencesystem "
|
|
126 |
+ "WHERE coord_ref_sys_code = " + target;
|
| 127 |
127 |
ResultSet result = Query.select(sentence,connect.getConnection());
|
| 128 |
128 |
try {
|
| 129 |
129 |
result.next();
|
| ... | ... | |
| 132 |
132 |
target = result.getInt("source_geogcrs_code");
|
| 133 |
133 |
} catch (SQLException e1) {
|
| 134 |
134 |
logger.info("Can't get values from resulset, sentence="+sentence+".",e1);
|
| 135 |
|
}
|
|
135 |
}
|
| 136 |
136 |
crs_target = target;
|
| 137 |
137 |
initialize();
|
| 138 |
138 |
}
|
| ... | ... | |
| 142 |
142 |
setBorder(
|
| 143 |
143 |
BorderFactory.createCompoundBorder(
|
| 144 |
144 |
BorderFactory.createCompoundBorder(
|
| 145 |
|
BorderFactory.createTitledBorder("Transformacion EPSG"),
|
|
145 |
BorderFactory.createTitledBorder(
|
|
146 |
PluginServices.getText(this,"EPSG_transformation")),
|
| 146 |
147 |
BorderFactory.createEmptyBorder(12,2,80,2)),
|
| 147 |
148 |
getBorder()));
|
| 148 |
149 |
add(getJScrollPane(),BorderLayout.CENTER);
|
| ... | ... | |
| 219 |
220 |
jScrollPane.setBorder(
|
| 220 |
221 |
BorderFactory.createCompoundBorder(
|
| 221 |
222 |
BorderFactory.createCompoundBorder(
|
| 222 |
|
BorderFactory.createTitledBorder(PluginServices.getText(this,"transformations")),
|
|
223 |
BorderFactory.createTitledBorder(
|
|
224 |
PluginServices.getText(this,"transformations")),
|
| 223 |
225 |
BorderFactory.createEmptyBorder(5,5,5,5)),
|
| 224 |
226 |
jScrollPane.getBorder()));
|
| 225 |
227 |
jScrollPane.setViewportView(getJTable());
|
| ... | ... | |
| 234 |
236 |
*/
|
| 235 |
237 |
private void callTransformation(int _crsCode){
|
| 236 |
238 |
|
| 237 |
|
int crsCode = _crsCode;
|
| 238 |
|
|
| 239 |
|
String sentence = "SELECT source_geogcrs_code " +
|
| 240 |
|
"FROM epsg_coordinatereferencesystem " +
|
| 241 |
|
"WHERE coord_ref_sys_code = "+ crsCode ;
|
|
239 |
int crsCode = _crsCode;
|
|
240 |
String sentence = "SELECT source_geogcrs_code, coord_ref_sys_kind "
|
|
241 |
+ "FROM epsg_coordinatereferencesystem "
|
|
242 |
+ "WHERE coord_ref_sys_code = " + crsCode;
|
| 242 |
243 |
ResultSet result = Query.select(sentence,connect.getConnection());
|
| 243 |
244 |
int source = 0;
|
| 244 |
245 |
try {
|
| 245 |
246 |
result.next();
|
| 246 |
|
source = result.getInt("source_geogcrs_code");
|
|
247 |
String kind = result.getString("coord_ref_sys_kind");
|
|
248 |
if (kind.equals("projected"))
|
|
249 |
source = result.getInt("source_geogcrs_code");
|
|
250 |
else if (kind.equals("geographic 2D"))
|
|
251 |
source = crsCode;
|
| 247 |
252 |
} catch (SQLException e1) {
|
| 248 |
253 |
logger.info("Can't get values from resulset, sentence="+sentence+".",e1);
|
| 249 |
254 |
}
|
| ... | ... | |
| 251 |
256 |
ResultSet result2 = null;
|
| 252 |
257 |
ResultSet result3 = null;
|
| 253 |
258 |
if (source != 0){
|
| 254 |
|
crsCode = source;
|
|
259 |
crsCode = source;
|
| 255 |
260 |
}
|
| 256 |
261 |
|
| 257 |
262 |
ArrayList codecs = new ArrayList();
|
| 258 |
263 |
codecs.add(String.valueOf(crsCode));
|
| 259 |
264 |
|
| 260 |
265 |
for (int j=0; j< codecs.size(); j++){
|
| 261 |
|
sentence = "SELECT coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, area_of_use_code, coord_op_method_code " +
|
| 262 |
|
"FROM epsg_coordoperation " +
|
| 263 |
|
"WHERE source_crs_code = " + codecs.get(j) + "AND target_crs_code = " + crs_target;
|
|
266 |
sentence = "SELECT coord_op_code, coord_op_name, coord_op_type, source_crs_code, "
|
|
267 |
+ "target_crs_code, area_of_use_code, coord_op_method_code "
|
|
268 |
+ "FROM epsg_coordoperation WHERE source_crs_code = "
|
|
269 |
+ codecs.get(j) + " AND target_crs_code = " + crs_target;
|
| 264 |
270 |
|
| 265 |
|
result = Query.select(sentence,connect.getConnection());
|
|
271 |
result = Query.select(sentence,connect.getConnection());
|
| 266 |
272 |
|
| 267 |
273 |
try {
|
| 268 |
274 |
while(result.next()) {
|
| ... | ... | |
| 277 |
283 |
|
| 278 |
284 |
int aouc = Integer.parseInt(result.getString("area_of_use_code"));
|
| 279 |
285 |
|
| 280 |
|
sentence = "SELECT area_of_use FROM epsg_area " +
|
| 281 |
|
"WHERE area_code = "+ aouc ;
|
|
286 |
sentence = "SELECT area_of_use FROM epsg_area "
|
|
287 |
+ "WHERE area_code = " + aouc;
|
| 282 |
288 |
|
| 283 |
289 |
result2 = Query.select(sentence,connect.getConnection());
|
| 284 |
290 |
while (result2.next())
|
| ... | ... | |
| 286 |
292 |
|
| 287 |
293 |
String coord_op_method = result.getString("coord_op_method_code");
|
| 288 |
294 |
|
| 289 |
|
sentence = "SELECT reverse_op FROM epsg_coordoperationmethod "+
|
| 290 |
|
"WHERE coord_op_method_code LIKE " + coord_op_method;
|
|
295 |
sentence = "SELECT reverse_op FROM epsg_coordoperationmethod "
|
|
296 |
+ "WHERE coord_op_method_code LIKE " + coord_op_method;
|
| 291 |
297 |
result3 = Query.select(sentence,connect.getConnection());
|
| 292 |
298 |
|
| 293 |
299 |
while(result3.next()){
|
| 294 |
|
if (Integer.parseInt(result3.getString("reverse_op")) == 1){
|
|
300 |
if (result3.getInt("reverse_op") == 1){
|
| 295 |
301 |
for (int i=0; i< transformations.length; i++){
|
| 296 |
302 |
if (coord_op_method.equals(transformations[i])){
|
| 297 |
303 |
dtm.addRow(data);
|
| ... | ... | |
| 338 |
344 |
*/
|
| 339 |
345 |
private void callInverseTransformation(int _crsCode){
|
| 340 |
346 |
|
| 341 |
|
int crsCode = _crsCode;
|
| 342 |
|
//inverseTranformation = true;
|
| 343 |
|
|
| 344 |
|
String sentence = "SELECT source_geogcrs_code " +
|
| 345 |
|
"FROM epsg_coordinatereferencesystem " +
|
| 346 |
|
"WHERE coord_ref_sys_code = "+ crsCode ;
|
|
347 |
int crsCode = _crsCode;
|
|
348 |
String sentence = "SELECT source_geogcrs_code, coord_ref_sys_kind "
|
|
349 |
+ "FROM epsg_coordinatereferencesystem "
|
|
350 |
+ "WHERE coord_ref_sys_code = " + crsCode;
|
| 347 |
351 |
ResultSet result = Query.select(sentence,connect.getConnection());
|
| 348 |
352 |
int source = 0;
|
| 349 |
353 |
try {
|
| 350 |
354 |
result.next();
|
| 351 |
|
source = result.getInt("source_geogcrs_code");
|
|
355 |
String kind = result.getString("coord_ref_sys_kind");
|
|
356 |
if (kind.equals("projected"))
|
|
357 |
source = result.getInt("source_geogcrs_code");
|
|
358 |
else if (kind.equals("geographic 2D"))
|
|
359 |
source = crsCode;
|
| 352 |
360 |
} catch (SQLException e1) {
|
| 353 |
361 |
logger.info("Can't get value 'source_geogcrs_code' from resulset, sentence="+sentence+".",e1);
|
| 354 |
362 |
}
|
| ... | ... | |
| 356 |
364 |
ResultSet result2 = null;
|
| 357 |
365 |
ResultSet result3 = null;
|
| 358 |
366 |
if (source != 0){
|
| 359 |
|
crsCode = source;
|
|
367 |
crsCode = source;
|
| 360 |
368 |
}
|
| 361 |
369 |
|
| 362 |
370 |
ArrayList codecs = new ArrayList();
|
| ... | ... | |
| 365 |
373 |
codecs = deleteItems(codecs);
|
| 366 |
374 |
|
| 367 |
375 |
for (int j=0; j< codecs.size(); j++){
|
| 368 |
|
sentence = "SELECT coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, area_of_use_code, coord_op_method_code " +
|
| 369 |
|
"FROM epsg_coordoperation " +
|
| 370 |
|
"WHERE source_crs_code = " + codecs.get(j) + "AND target_crs_code = " + crs_target;
|
|
376 |
sentence = "SELECT coord_op_code, coord_op_name, coord_op_type, source_crs_code, "
|
|
377 |
+ "target_crs_code, area_of_use_code, coord_op_method_code "
|
|
378 |
+ "FROM epsg_coordoperation WHERE source_crs_code = "
|
|
379 |
+ codecs.get(j) + " AND target_crs_code = " + crs_target;
|
| 371 |
380 |
|
| 372 |
381 |
result = Query.select(sentence,connect.getConnection());
|
| 373 |
382 |
|
| ... | ... | |
| 384 |
393 |
|
| 385 |
394 |
int aouc = Integer.parseInt(result.getString("area_of_use_code"));
|
| 386 |
395 |
|
| 387 |
|
sentence = "SELECT area_of_use FROM epsg_area " +
|
| 388 |
|
"WHERE area_code = "+ aouc ;
|
|
396 |
sentence = "SELECT area_of_use FROM epsg_area "
|
|
397 |
+ "WHERE area_code = " + aouc;
|
| 389 |
398 |
|
| 390 |
399 |
result2 = Query.select(sentence,connect.getConnection());
|
| 391 |
400 |
while (result2.next())
|
| ... | ... | |
| 393 |
402 |
|
| 394 |
403 |
String coord_op_method = result.getString("coord_op_method_code");
|
| 395 |
404 |
|
| 396 |
|
sentence = "SELECT reverse_op FROM epsg_coordoperationmethod "+
|
| 397 |
|
"WHERE coord_op_method_code LIKE " + coord_op_method;
|
|
405 |
sentence = "SELECT reverse_op FROM epsg_coordoperationmethod "
|
|
406 |
+ "WHERE coord_op_method_code LIKE " + coord_op_method;
|
| 398 |
407 |
result3 = Query.select(sentence,connect.getConnection());
|
| 399 |
408 |
|
| 400 |
409 |
while(result3.next()){
|
| ... | ... | |
| 522 |
531 |
|
| 523 |
532 |
int new_target = crs_target;
|
| 524 |
533 |
int base_target = src_code;
|
| 525 |
|
String sentence = "SELECT source_geogcrs_code, coord_ref_sys_kind " +
|
| 526 |
|
"FROM epsg_coordinatereferencesystem " +
|
| 527 |
|
"WHERE coord_ref_sys_code = "+ src_code;
|
|
534 |
String sentence = "SELECT source_geogcrs_code, coord_ref_sys_kind "
|
|
535 |
+ "FROM epsg_coordinatereferencesystem "
|
|
536 |
+ "WHERE coord_ref_sys_code = " + src_code;
|
| 528 |
537 |
ResultSet result = Query.select(sentence,connect.getConnection());
|
| 529 |
538 |
try {
|
| 530 |
539 |
result.next();
|
| ... | ... | |
| 571 |
580 |
|
| 572 |
581 |
int new_target = crs_target;
|
| 573 |
582 |
int base_target = code;
|
| 574 |
|
String sentence = "SELECT source_geogcrs_code, coord_ref_sys_kind " +
|
| 575 |
|
"FROM epsg_coordinatereferencesystem " +
|
| 576 |
|
"WHERE coord_ref_sys_code = "+ code;
|
|
583 |
String sentence = "SELECT source_geogcrs_code, coord_ref_sys_kind "
|
|
584 |
+ "FROM epsg_coordinatereferencesystem "
|
|
585 |
+ "WHERE coord_ref_sys_code = " + code;
|
| 577 |
586 |
ResultSet result = Query.select(sentence,connect.getConnection());
|
| 578 |
587 |
try {
|
| 579 |
588 |
result.next();
|
| ... | ... | |
| 610 |
619 |
dtm.removeRow(numRow);
|
| 611 |
620 |
}
|
| 612 |
621 |
|
| 613 |
|
String sentence = "SELECT source_geogcrs_code " +
|
| 614 |
|
"FROM epsg_coordinatereferencesystem " +
|
| 615 |
|
"WHERE coord_ref_sys_code = "+ crsCode ;
|
|
622 |
String sentence = "SELECT source_geogcrs_code FROM epsg_coordinatereferencesystem "
|
|
623 |
+ "WHERE coord_ref_sys_code = " + crsCode;
|
| 616 |
624 |
ResultSet result = Query.select(sentence,connect.getConnection());
|
| 617 |
625 |
int source = 0;
|
| 618 |
626 |
try {
|
| ... | ... | |
| 632 |
640 |
codecs.add(String.valueOf(crsCode));
|
| 633 |
641 |
|
| 634 |
642 |
for (int j=0; j< codecs.size(); j++){
|
| 635 |
|
sentence = "SELECT coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, area_of_use_code, coord_op_method_code " +
|
| 636 |
|
"FROM epsg_coordoperation " +
|
| 637 |
|
"WHERE source_crs_code = " + codecs.get(j) + " OR target_crs_code = "+ codecs.get(j);
|
|
643 |
sentence = "SELECT coord_op_code, coord_op_name, coord_op_type, source_crs_code, "
|
|
644 |
+ "target_crs_code, area_of_use_code, coord_op_method_code "
|
|
645 |
+ "FROM epsg_coordoperation WHERE source_crs_code = "
|
|
646 |
+ codecs.get(j) + " OR target_crs_code = " + codecs.get(j);
|
| 638 |
647 |
|
| 639 |
648 |
result = Query.select(sentence,connect.getConnection());
|
| 640 |
649 |
|
| ... | ... | |
| 651 |
660 |
|
| 652 |
661 |
int aouc = Integer.parseInt(result.getString("area_of_use_code"));
|
| 653 |
662 |
|
| 654 |
|
sentence = "SELECT area_of_use FROM epsg_area " +
|
| 655 |
|
"WHERE area_code = "+ aouc ;
|
|
663 |
sentence = "SELECT area_of_use FROM epsg_area "
|
|
664 |
+ "WHERE area_code = " + aouc;
|
| 656 |
665 |
|
| 657 |
666 |
result2 = Query.select(sentence,connect.getConnection());
|
| 658 |
667 |
while (result2.next())
|
| ... | ... | |
| 660 |
669 |
|
| 661 |
670 |
String coord_op_method = result.getString("coord_op_method_code");
|
| 662 |
671 |
|
| 663 |
|
sentence = "SELECT reverse_op FROM epsg_coordoperationmethod "+
|
| 664 |
|
"WHERE coord_op_method_code LIKE " + coord_op_method;
|
|
672 |
sentence = "SELECT reverse_op FROM epsg_coordoperationmethod "
|
|
673 |
+ "WHERE coord_op_method_code LIKE " + coord_op_method;
|
| 665 |
674 |
result3 = Query.select(sentence,connect.getConnection());
|
| 666 |
675 |
|
| 667 |
676 |
while(result3.next()){
|
| 668 |
|
if (Integer.parseInt(result3.getString("reverse_op")) == 1){
|
|
677 |
if (result3.getInt("reverse_op") == 1){
|
| 669 |
678 |
for (int i=0; i< transformations.length; i++){
|
| 670 |
679 |
if (coord_op_method.equals(transformations[i])){
|
| 671 |
680 |
dtm.addRow(data);
|
| ... | ... | |
| 740 |
749 |
|
| 741 |
750 |
public WindowInfo getWindowInfo() {
|
| 742 |
751 |
WindowInfo m_viewinfo=new WindowInfo(WindowInfo.MODALDIALOG);
|
| 743 |
|
m_viewinfo.setTitle("Transformation EPSG");
|
|
752 |
m_viewinfo.setTitle(PluginServices.getText(this,"EPSG_transformation"));
|
| 744 |
753 |
return m_viewinfo;
|
| 745 |
754 |
}
|
| 746 |
755 |
|