utmprojectionloader.java

来自「OpenMap是一个基于JavaBeansTM的开发工具包。利用OpenMap你」· Java 代码 · 共 46 行

JAVA
46
字号
package com.bbn.openmap.proj;import java.util.Properties;import com.bbn.openmap.LatLonPoint;import com.bbn.openmap.util.Debug;import com.bbn.openmap.util.PropUtils;public class UTMProjectionLoader extends BasicProjectionLoader {    public static final String ZONE_NUMBER = "ZONE_NUMBER";    public static final String ZONE_LETTER = "ZONE_LETTER";    public static final String ELLIPSOID = "ELLIPSOID";    public UTMProjectionLoader() {        super(UTMProjection.class, "UTM Projection", "UTM Projection");    }    public Projection create(Properties props) throws ProjectionException {        try {            LatLonPoint center = (LatLonPoint) props.get(ProjectionFactory.CENTER);            float scale = PropUtils.floatFromProperties(props, ProjectionFactory.SCALE, 10000000);            int height = PropUtils.intFromProperties(props, ProjectionFactory.HEIGHT, 100);            int width = PropUtils.intFromProperties(props, ProjectionFactory.WIDTH, 100);            int type = UTMProjection.UTMType;            int zone_number = PropUtils.intFromProperties(props, ZONE_NUMBER, 0);            char zone_letter = ((String) props.get(ZONE_LETTER)).charAt(0);            boolean isnorthern = (zone_letter == 'N');            Ellipsoid ellps = (Ellipsoid) props.get(ELLIPSOID);            return new UTMProjection(center, scale, width, height, type, zone_number, isnorthern,                    ellps);        } catch (Exception e) {            if (Debug.debugging("proj")) {                Debug.output("UTMProjectionLoader: problem creating UTM projection "                        + e.getMessage());                e.printStackTrace();            }        }        throw new ProjectionException("UTMProjectionLoader: problem creating UTM projection");    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?