User Tools

Site Tools


lib:javadoc:javadoc

This is an old revision of the document!


JavaDoc

Javadoc ist ein Software-Dokumentationswerkzeug, das aus Java-Quelltexten automatisch HTML-Dokumentationsdateien erstellt.

Diese Dokumentation der crsTools-Bibliothek könnne Sie sich hier

JavaDoc 'crsTools'

anzeigen lassen. Die hat kein Zertifikat und daher wird die Meldung “Verbindung ist nicht sicher” (oder-so-ähnlich) angezeigt. Die können diese Seite vertrauen!

Nachfolgend einige Code-Beispiele.

Beispiel: Projektions-Umformung

 public static void main(String[] args) throws CrsException {
 
  /*
   * #############################################################################
    * ####### 1.: über: CrsDef
     */
 
    System.out.println("\n######> Alternative-1\n");
 
    CrsProjConv crsMapConv_1 = new CrsProjConv(); //
 
    boolean okSrc = crsMapConv_1.setCrsSrc(4647); // 4647
    boolean okTrg = crsMapConv_1.setCrsTrg(25832); // 31466
    boolean ok = crsMapConv_1.init();
 
    if (okSrc && okTrg && ok) {
 
      /*
       * ========================== the most cumbersome way to eliminate the zone :-))))
       */
      double cInp[] = new double[] { 32650000.0, 5590000.0 };
      double cRes[] = crsMapConv_1.doTrans(32650000.0, 5590000.0); // => 650000.0 / 5590000.0
      if (cRes != null) {
        System.out.println(String.format("%13.3f %13.3f > %13.3f %13.3f > wasWithinBounds=%b", cInp[0], cInp[1],
            cRes[0], cRes[1], crsMapConv_1.wasWithinBounds()));
      }
 
      /*
       * ============================================================== ... or to add
       */
      cInp = new double[] { 650000.0, 5590000.0 };
      cRes = crsMapConv_1.doTransInv(650000.0, 5590000.0); // => 32650000.0, 5590000.0
      if (cRes != null) {
        System.out.println(String.format("%13.3f %13.3f > %13.3f %13.3f > wasWithinBounds=%b", cInp[0], cInp[1],
            cRes[0], cRes[1], crsMapConv_1.wasWithinBounds()));
      }
 
      /*
       * =============================================================================
       */
      cInp = new double[] { 32713000.0, 5590000.0 }; // just inside
      cRes = crsMapConv_1.doTrans(32713000.0, 5590000.0);
      if (cRes != null) {
        System.out.println(String.format("just inside  : %13.3f %13.3f > %13.3f %13.3f > wasWithinBounds=%b",
            cInp[0], cInp[1], cRes[0], cRes[1], crsMapConv_1.wasWithinBounds()));
      }
 
      /*
       * =============================================================================
       */
      cInp = new double[] { 32714000.0, 5590000.0 }; // just outside
      cRes = crsMapConv_1.doTrans(cInp[0], cInp[1]); // out of bounds - but mathematically legal
      if (cRes != null) {
        System.out.println(String.format("just outside : %13.3f %13.3f > %13.3f %13.3f > wasWithinBounds=%b",
            cInp[0], cInp[1], cRes[0], cRes[1], crsMapConv_1.wasWithinBounds()));
      }
 
      /*
       * ============================================================= Check only
       */
 
      if (crsMapConv_1.isInitOk()) {
 
        cInp = new double[] { 32500000.0, 5590000.0 };
        System.out.println(String.format("SRC = %13.3f %13.3f wasWithinBounds=%b", cInp[0], cInp[1],
            crsMapConv_1.isWithinSrcBounds(cInp[0], cInp[1])));
        cInp = new double[] { 500000.0, 5590000.0 };
        System.out.println(String.format("TRG = %13.3f %13.3f wasWithinBounds=%b", cInp[0], cInp[1],
            crsMapConv_1.isWithinTrgBounds(cInp[0], cInp[1])));
 
        cInp = new double[] { 32800000.0, 5590000.0 };
        System.out.println(String.format("SRC = %13.3f %13.3f wasWithinBounds=%b", cInp[0], cInp[1],
            crsMapConv_1.isWithinSrcBounds(cInp[0], cInp[1])));
        cInp = new double[] { 800000.0, 5590000.0 };
        System.out.println(String.format("TRG = %13.3f %13.3f wasWithinBounds=%b", cInp[0], cInp[1],
            crsMapConv_1.isWithinTrgBounds(cInp[0], cInp[1])));
 
      } else {
        System.out.println("not initialized");
      }
 
      /*
       * ###################################################### 2.: über: Elli+MP+MC
       */
 
      System.out.println("\n######> Alternative-2\n");
 
      CrsProjConv crsMapConv_2 = new CrsProjConv();
 
      if (crsMapConv_2.init(7004, 16263, 9807, 8901, 16264, 9807, 8901)) {
 
        cInp = new double[] { 3600000.0, 5590000.0 }; // just outside
        cRes = crsMapConv_2.doTrans(cInp[0], cInp[1]); // out of bounds - but mathematically legal
        if (cRes != null) {
          System.out.println(String.format("%13.3f %13.3f > %13.3f %13.3f > wasWithinBounds=%b", cInp[0],
              cInp[1], cRes[0], cRes[1], crsMapConv_2.wasWithinBounds()));
        }
 
      } else {
        System.out.println("not initialized");
      }
 
      /*
       * #################################### 3.: über: Elli+MP+MC Instanzen
       */
 
      System.out.println("\n######> Alternative-3\n");
 
      CrsProjConv crsMapConv_3 = new CrsProjConv();
 
      if (crsMapConv_3.init(7004, 16264, 9807, 8901, 16263, 9807, 8901)) {
 
        cInp = new double[] { 4386906.134, 5590264.337 }; // just outside
        cRes = crsMapConv_3.doTrans(cInp[0], cInp[1]); // out of bounds - but mathematically legal
        if (cRes != null) {
          System.out.println(String.format("%13.3f %13.3f > %13.3f %13.3f > wasWithinBounds=%b", cInp[0],
              cInp[1], cRes[0], cRes[1], crsMapConv_3.wasWithinBounds()));
        }
 
      } else {
        System.out.println("not initialized");
      }
    } else {
      System.out.println(String.format("ERROR: SrcOK=%b / TrgOK=%b / OK=%b", okSrc, okTrg, ok));
    }
  }
lib/javadoc/javadoc.1637839669.txt.gz · Last modified: 2023/07/03 18:26 (external edit)