當前位置: 首頁>>代碼示例>>Java>>正文


Java PrimeMeridian類代碼示例

本文整理匯總了Java中org.opengis.referencing.datum.PrimeMeridian的典型用法代碼示例。如果您正苦於以下問題:Java PrimeMeridian類的具體用法?Java PrimeMeridian怎麽用?Java PrimeMeridian使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PrimeMeridian類屬於org.opengis.referencing.datum包,在下文中一共展示了PrimeMeridian類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: premadeObjects

import org.opengis.referencing.datum.PrimeMeridian; //導入依賴的package包/類
/**
 * A method with some examples of premade static objects.
 */
void premadeObjects() {
    // premadeObjects start
    GeographicCRS geoCRS = org.geotools.referencing.crs.DefaultGeographicCRS.WGS84;
    GeodeticDatum wgs84Datum = org.geotools.referencing.datum.DefaultGeodeticDatum.WGS84;
    PrimeMeridian greenwichMeridian = org.geotools.referencing.datum.DefaultPrimeMeridian.GREENWICH;
    CartesianCS cartCS = org.geotools.referencing.cs.DefaultCartesianCS.GENERIC_2D;
    CoordinateSystemAxis latAxis = org.geotools.referencing.cs.DefaultCoordinateSystemAxis.GEODETIC_LATITUDE;
    // premadeObjects end
}
 
開發者ID:ianturton,項目名稱:geotools-cookbook,代碼行數:13,代碼來源:ReferencingExamples.java

示例2: createCRSByHand2

import org.opengis.referencing.datum.PrimeMeridian; //導入依賴的package包/類
/**
 * Creates a NAD 27 geographic CRS. Notice that the datum factory automatically adds aliase names to
 * the datum (because "North American Datum 1927" has an entry in http://svn.geotools.org
 * /geotools/trunk/gt/module/referencing/src/org/geotools/referencing/factory /DatumAliasesTable.txt
 * ). Also notice that toWGS84 information (used in a datum transform) was also added to the datum.
 */
void createCRSByHand2() throws Exception {
    System.out.println("------------------------------------------");
    System.out.println("Creating a CRS by hand:");
    // createCRSByHand2 start
    CRSFactory crsFactory = ReferencingFactoryFinder.getCRSFactory(null);
    DatumFactory datumFactory = ReferencingFactoryFinder.getDatumFactory(null);
    CSFactory csFactory = ReferencingFactoryFinder.getCSFactory(null);
    
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("name", "Clarke 1866");
    
    Ellipsoid clark1866ellipse = datumFactory.createFlattenedSphere(map, 6378206.4,
            294.978698213901, SI.METER);
    
    PrimeMeridian greenwichMeridian = org.geotools.referencing.datum.DefaultPrimeMeridian.GREENWICH;
    
    final BursaWolfParameters toWGS84 = new BursaWolfParameters(DefaultGeodeticDatum.WGS84);
    toWGS84.dx = -3.0;
    toWGS84.dy = 142;
    toWGS84.dz = 183;
    
    map.clear();
    map.put("name", "North American Datum 1927");
    map.put(DefaultGeodeticDatum.BURSA_WOLF_KEY, toWGS84);
    
    GeodeticDatum clark1866datum = datumFactory.createGeodeticDatum(map, clark1866ellipse,
            greenwichMeridian);
    System.out.println(clark1866datum.toWKT());
    // notice all of the lovely datum aliases (used to determine if two
    // datums are the same)
    System.out.println("Identified Datum object:");
    printIdentifierStuff(clark1866datum);
    
    map.clear();
    map.put("name", "<lat>, <long>");
    CoordinateSystemAxis latAxis = org.geotools.referencing.cs.DefaultCoordinateSystemAxis.GEODETIC_LATITUDE;
    CoordinateSystemAxis longAxis = org.geotools.referencing.cs.DefaultCoordinateSystemAxis.GEODETIC_LONGITUDE;
    EllipsoidalCS ellipsCS = csFactory.createEllipsoidalCS(map, latAxis, longAxis);
    
    map.clear();
    map.put("name", "NAD 27");
    map.put("authority", "9999");
    // TODO add an authority code here (should be an identifier)
    GeographicCRS nad27CRS = crsFactory.createGeographicCRS(map, clark1866datum, ellipsCS);
    // createCRSByHand2 end
    System.out.println(nad27CRS.toWKT());
    System.out.println("Identified CRS object:");
    printIdentifierStuff(nad27CRS);
    
    System.out.println("------------------------------------------");
    
    // save for latter use in createMathTransformBetweenCRSs()
    this.nad27CRS = nad27CRS;
}
 
開發者ID:ianturton,項目名稱:geotools-cookbook,代碼行數:61,代碼來源:ReferencingExamples.java


注:本文中的org.opengis.referencing.datum.PrimeMeridian類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。