当前位置: 首页>>代码示例>>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;未经允许,请勿转载。