亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? mysqlgeometrylayer.java

?? openmap java寫的開源數(shù)字地圖程序. 用applet實(shí)現(xiàn),可以像google map 那樣放大縮小地圖.
?? JAVA
字號:
/* *********************************************************************** * This layer is for the reading and display of any spatial data retrieved * from a MySQL Database (Version 4.1). At this time MySQL 4.1 is available * only as alfa release, and represents the first version with support for  * the Datatype Geometry. Therefore be carefull expecting to much. * Usefull information can be found in the chapter 9 of the MySQL Reference  * (Spatial Extensions in MySQL)  * http://www.mysql.com/documentation/mysql/bychapter/index.html#GIS_spatial_extensions_in_MySQL * partially this layer is inspired by Ian Batley's OracleSpatialLayer which  * can be found on the on the Open Map website.Thanks Ian. * This program is distributed freely and in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Copyright 2003 by the Author * * Author name: Uwe Baier uwe.baier@gmx.net * Version 1.0 * *********************************************************************** */package com.bbn.openmap.layer.mysql;/*  Java Core  */import java.sql.*;import java.util.Properties;import java.util.Vector;import javax.swing.ImageIcon;/*  OpenMap  */import com.bbn.openmap.layer.OMGraphicHandlerLayer;import com.bbn.openmap.util.PropUtils;import com.bbn.openmap.omGraphics.DrawingAttributes;import com.bbn.openmap.omGraphics.OMGraphic;import com.bbn.openmap.omGraphics.OMGraphicList;import com.bbn.openmap.omGraphics.OMRaster;import com.bbn.openmap.omGraphics.OMPoly;import com.bbn.openmap.proj.Projection;import com.bbn.openmap.util.Debug;/** * This layer is for the reading and display of any spatial data * retrieved from a MySQL Database (Version 4.1). At this time MySQL * 4.1 is available only as alfa release, and represents the first * version with support for the Datatype Geometry. Therefore, be * careful in expecting too much. Usefull information can be found in * the chapter 9 of the MySQL Reference (Spatial Extensions in MySQL) * http://www.mysql.com/documentation/mysql/bychapter/index.html#GIS_spatial_extensions_in_MySQL * partially this layer is inspired by Ian Batley's OracleSpatialLayer * which can be found on the on the OpenMap website. Thanks Ian. * <p> *  * MysqlGeometryLayer uses at this stage a set of Classes which wraps * the Geometries retrieved from the database. They are thougth to be * a provisorium until a nice MySQL Geometry API is available. * Coordinate values are stored as values of double precision in * arrays as a sequence of Latitude/Longitude pairs. This differs from * tha database where values are stored as X/Y or Easting/Northing * pairs. *  * <p> * Properties to be set: *  * <pre> *  *  *  mygeo.prettyName=&amp;ltYour Layer Name&amp;gt *  mygeo.dbUrl=&amp;lt Driver Class &amp;gt eg.  &quot;jdbc:mysql://localhost/openmap?user=me&amp;password=secret&quot; *  mygeo.dbClass=&amp;lt Driver Class &amp;gt eg. &quot;com.mysql.jdbc.Driver&quot; *  mygeo.geomTable=&amp;ltDatabase Tablename&amp;gt *  mygeo.geomColumn=&amp;ltColumn name which contains the geometry&amp;gt *  mygeo.pointSymbol=&amp;ltFilename and path for image to use for point objects&amp;gtDefault is  *  # Optional Properties - use as required *  # NOTE: There are default for each of these  *  mygeo.lineColor=&amp;ltColor for lines&amp;gtDefault is red *  mygeo.lineWidth=&amp;ltPixel width of lines&amp;gtDefault is 0 *  mygeo.fillColor=&amp;ltColor of fill&amp;gtDefault is red *  *   * </pre> *  * Copyright 2003 by the Author <br> * <p> *  * @author Uwe Baier uwe.baier@gmx.net <br> * @version 1.0 <br> */public class MysqlGeometryLayer extends OMGraphicHandlerLayer {    /**     * ; The connection String to use for the jdbc query, e.g.     * "jdbc:mysql://localhost/openmap?user=me&password=secret"     */    protected String dbUrl = null;    /**     * The Property to set for the query: <b>dbUrl </b>.     */    public static final String dbUrlProperty = "dbUrl";    /**     * ; The driver to use.     */    protected String dbClass = null;    /**     * The property to use for specifing the driver: <b>dbClass </b>     */    public static final String dbClassProperty = "dbClass";    /**     * Connection to server.     */    protected Connection conn = null;    /**     * The result set object.     */    protected ResultSet rs = null;    /**     * Statement to be executed for queries.     */    protected Statement stmt = null;    /** Table name which contains the geometry to be used. */    protected String geomTable = null;    /**     * Property to specify geomTable in the Database: <b>geomTable     * </b>.     */    public static final String geomTableProperty = "geomTable";    /** Column name which contains the geometry to be used. */    protected String geomColumn = null;    /**     * Property to specify geomColumn in the Database: <b>geomColumn     * </b>     */    public static final String geomColumnProperty = "geomColumn";    /** The point Symbol set by the Properties */    protected String pointSymbol = "";    /**     * Property to specify GIF or image file(symbol) to use for     * Points: <b>pointSymbol </b>.     */    public static final String pointSymbolProperty = "pointSymbol";    protected DrawingAttributes drawingAttributes = DrawingAttributes.getDefaultClone();    /**     * The properties and prefix are managed and decoded here.     *      * @param prefix string prefix used in the properties file for     *        this layer.     * @param properties the properties set in the properties file.     */    public void setProperties(String prefix, Properties properties) {        super.setProperties(prefix, properties);        prefix = PropUtils.getScopedPropertyPrefix(prefix);        dbClass = properties.getProperty(prefix + dbClassProperty);        dbUrl = properties.getProperty(prefix + dbUrlProperty);        geomTable = properties.getProperty(prefix + geomTableProperty);        geomColumn = properties.getProperty(prefix + geomColumnProperty);        pointSymbol = properties.getProperty(prefix + pointSymbolProperty);        if (Debug.debugging("mysql")) {            Debug.output("MysqlGeometryLayer (" + getName() + ") properties:");            Debug.output("  " + dbClass);            Debug.output("  " + dbUrl);            Debug.output("  " + geomTable);            Debug.output("  " + geomColumn);        }        drawingAttributes.setProperties(prefix, properties);    }    public synchronized OMGraphicList prepare() {        Projection proj = getProjection();        if (proj == null) {            Debug.output("MysqlGeometryLayer.prepare: null projection!");            return null;        }        OMGraphicList graphics = new OMGraphicList();        try {            Class.forName(dbClass).newInstance();            try {                conn = DriverManager.getConnection(dbUrl);            } catch (Exception ex) {                ex.printStackTrace();            }            stmt = conn.createStatement();            String q = "SELECT ID, AsText(" + geomColumn + ") FROM "                    + geomTable                    + " WHERE MBRIntersects(GEO, GeomFromText('Polygon(( "                    + getProjection().getUpperLeft().getLongitude() + " "                    + getProjection().getUpperLeft().getLatitude() + ", "                    + getProjection().getUpperLeft().getLongitude() + " "                    + getProjection().getLowerRight().getLatitude() + ", "                    + getProjection().getLowerRight().getLongitude() + " "                    + getProjection().getLowerRight().getLatitude() + ", "                    + getProjection().getLowerRight().getLongitude() + " "                    + getProjection().getUpperLeft().getLatitude() + ", "                    + getProjection().getUpperLeft().getLongitude() + " "                    + getProjection().getUpperLeft().getLatitude() + "))'))";            if (Debug.debugging("mysql")) {                Debug.output("MysqlGeometryLayer query: " + q);            }            stmt.executeQuery(q);            rs = stmt.getResultSet();            graphics.clear();            while (rs.next()) {                String result = rs.getString(2);                if (Debug.debugging("mysql")) {                    Debug.output("MysqlGeometryLayer result: " + result);                }                MysqlGeometry mg = MysqlWKTGeometryFactory.createGeometry(result);                OMGraphic omg = createGraphic(mg);                omg.generate(proj);                graphics.add(omg);            }            rs.close();            conn.close();        } catch (SQLException sqlE) {            sqlE.printStackTrace();        } catch (Exception e) {            e.printStackTrace();        }        return graphics;    }    /**     * Method createPoint. Renders a Point.     *      * @param myPoint     */    protected OMGraphic createPoint(MysqlPoint myPoint) {        ImageIcon actualPointSymbol = new ImageIcon(pointSymbol);        OMRaster ompoint = new OMRaster((float) myPoint.getNorthings(), (float) myPoint.getEastings(), actualPointSymbol);        drawingAttributes.setTo(ompoint);        return ompoint;    }    /**     * Method createLine. Renders a Linestring Geometry. ToDo: Holes     *      * @param myLine - Database object which will be rendered     */    protected OMGraphic createLine(MysqlLine myLine) {        OMPoly ompoly = new OMPoly(DoubleToFloat(myLine.getCoordinateArray()), OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_STRAIGHT);        drawingAttributes.setTo(ompoly);        return ompoly;    }    /**     * Method createPolygon. Renders a polygon geometry     *      * @param myPoly - Database object which will be rendered     */    protected OMGraphic createPolygon(MysqlPolygon myPoly) {        Vector v = myPoly.getRings();        int size = v.size();        OMGraphic ret = null;        OMPoly ompoly = null;        OMGraphicList subList = null;        if (size > 1) {            subList = new OMGraphicList();            ret = subList;        }        for (int i = 0; i < size; i++) {            ompoly = new OMPoly(DoubleToFloat((double[]) v.elementAt(i)), OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_STRAIGHT);            drawingAttributes.setTo(ompoly);            if (subList != null) {                subList.add(ompoly);            } else {                ret = ompoly;            }        }        return ret;    }    /**     * Method chooses what type of geometry to render.     *      * @param mg Database object which will be rendered     */    protected OMGraphic createGraphic(MysqlGeometry mg) {        OMGraphic ret = null;        if (mg != null) {            String type = mg.getType();            if (type.equals(MysqlGeometry.POINTTYPE)) {                ret = createPoint((MysqlPoint) mg);            } else if (type.equals(MysqlGeometry.LINESTRINGTYPE)) {                ret = createLine((MysqlLine) mg);            } else if (type.equals(MysqlGeometry.POLYGONTTYPE)) {                ret = createPolygon((MysqlPolygon) mg);            } else if (type.equals(MysqlGeometry.MULTIPOINTTYPE)                    || type.equals(MysqlGeometry.MULTILINESTRINGTYPE)                    || type.equals(MysqlGeometry.MULTIPOLYGONTYPE)                    || type.equals(MysqlGeometry.GEOMETRYCOLLECTIONTYPE)) {                MysqlMulti multi = (MysqlMulti) mg;                OMGraphicList subList = new OMGraphicList();                for (int i = 0; i < multi.countElements(); i++) {                    OMGraphic subRet = null;                    if (type.equals(MysqlGeometry.MULTIPOINTTYPE)) {                        subRet = createPoint((MysqlPoint) multi.getElementByIndex(i));                    } else if (type.equals(MysqlGeometry.MULTILINESTRINGTYPE)) {                        subRet = createLine((MysqlLine) multi.getElementByIndex(i));                    } else if (type.equals(MysqlGeometry.MULTIPOLYGONTYPE)) {                        subRet = createPolygon((MysqlPolygon) multi.getElementByIndex(i));                    } else if (type.equals(MysqlGeometry.GEOMETRYCOLLECTIONTYPE)) {                        subRet = createGraphic((MysqlGeometry) multi.getElementByIndex(i));                    }                    if (subRet != null) {                        subList.add(subRet);                    }                }                ret = subList;            } else {                // Other types of geometry                if (Debug.debugging("mysql")) {                    Debug.output("MysqlGeometryLayer.createGeometry: Geometry type not supported");                }            }        }        return ret;    }    /**     * Method DoubleToFloat. Used to cast arrays of double precision     * to float, precision which is internally used by OpenMap. This     * is ugly, but I prefered to keep the precision of values in the     * Geometry Classes the same as they are in MySQL Database.     *      * @param d     * @return float[]     */    private float[] DoubleToFloat(double[] d) {        float[] f = new float[d.length];        for (int i = 0; i < d.length; i++) {            f[i] = (float) d[i];        }        return f;    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品乱人伦久久久久久| 成人一区二区在线观看| 欧洲av在线精品| 亚洲色图清纯唯美| www.亚洲色图| 自拍偷拍欧美激情| 国产成人免费在线观看| 久久久久久久久伊人| 国产在线播放一区三区四| 亚洲精品一区二区三区蜜桃下载| 免费在线看一区| 欧美成人一区二区三区在线观看 | 91精品国产福利| 日韩国产高清在线| 精品久久国产老人久久综合| 国产一本一道久久香蕉| 国产拍揄自揄精品视频麻豆| 97se亚洲国产综合自在线观| 一区二区三区丝袜| 69精品人人人人| 国模套图日韩精品一区二区| 国产精品免费视频观看| av一区二区不卡| 亚洲成人第一页| 久久综合国产精品| 99久久99久久精品免费看蜜桃| 一区二区三区四区亚洲| 欧美精品v日韩精品v韩国精品v| 免费久久99精品国产| 日本一区二区高清| 欧美男同性恋视频网站| 久久精品久久综合| 《视频一区视频二区| 日韩欧美一二三| 91免费视频网| 国产一区高清在线| 亚洲一区二区欧美日韩 | 欧美一区二区三区四区久久| 韩国av一区二区三区四区| 一区二区成人在线观看| 国产日韩欧美综合一区| 日韩一区二区影院| 色噜噜狠狠成人中文综合 | 免费国产亚洲视频| 亚洲综合成人在线| 国产精品久久777777| 欧美xxx久久| 欧美日韩久久久一区| 欧美色图在线观看| 亚洲18影院在线观看| 精品国产伦一区二区三区观看方式| 亚洲精品一卡二卡| 欧美一区二区精品| 精品乱码亚洲一区二区不卡| 久久综合狠狠综合| 日韩一区在线播放| 亚洲一区在线电影| 丝瓜av网站精品一区二区 | 捆绑紧缚一区二区三区视频| 国产精品对白交换视频| 精品国产亚洲在线| 欧美一区二区视频观看视频| 欧美视频精品在线观看| 一本色道久久综合亚洲aⅴ蜜桃| 精彩视频一区二区三区| 日本女人一区二区三区| 亚洲自拍偷拍网站| 亚洲欧美一区二区三区久本道91| 国产三级一区二区| 欧美xxxxx牲另类人与| 欧美一区二区三区四区在线观看| 欧美人妖巨大在线| 欧美精品99久久久**| 91精品在线一区二区| 在线播放中文一区| 日韩欧美黄色影院| 中文无字幕一区二区三区| 中文字幕在线不卡视频| 日韩avvvv在线播放| 国模大尺度一区二区三区| 不卡欧美aaaaa| 欧美视频一区在线观看| 欧美日韩电影一区| 精品免费国产一区二区三区四区| 欧美精品一区男女天堂| 一区二区三区美女视频| 麻豆成人av在线| 国产精品1区2区3区| 欧美在线啊v一区| 久久综合久久综合久久| 一区二区国产视频| 国产一区二区女| 欧美综合色免费| 久久久不卡影院| 夜夜嗨av一区二区三区四季av| 激情图片小说一区| 欧美三级电影在线看| 中文字幕一区二区三区蜜月| 日本成人在线看| 欧美在线观看视频一区二区三区| 久久众筹精品私拍模特| 国产在线精品不卡| 99久久精品免费看国产| 久久精品国产亚洲aⅴ| 91麻豆国产在线观看| 欧美r级电影在线观看| 天天综合网天天综合色| 欧美日韩视频在线第一区| 午夜精品爽啪视频| 日韩美女天天操| 日韩精品五月天| 欧美日本一区二区在线观看| 一区二区在线观看免费| 99久久99久久精品免费观看| 18欧美亚洲精品| 91在线免费播放| 亚洲少妇最新在线视频| 97成人超碰视| 亚洲午夜久久久久| 在线观看欧美黄色| 亚洲精品成人精品456| 91九色最新地址| 婷婷一区二区三区| 欧美一二三四在线| 国产精品66部| 国产精品家庭影院| 色www精品视频在线观看| 亚洲综合色在线| 欧美区一区二区三区| 日韩黄色免费电影| 国产免费久久精品| 在线观看日韩av先锋影音电影院| 日韩电影在线一区二区三区| 欧美精品一区二区三区一线天视频| 丰满亚洲少妇av| 亚洲一区二区视频在线| 久久综合色鬼综合色| 国产一区视频导航| 亚洲美女一区二区三区| 欧美肥妇毛茸茸| 丰满白嫩尤物一区二区| 一区二区三区不卡视频在线观看| 337p亚洲精品色噜噜| 国产大片一区二区| 亚洲风情在线资源站| 精品久久久久久久人人人人传媒| eeuss国产一区二区三区| 日韩激情中文字幕| 国产精品久久久久影视| 8v天堂国产在线一区二区| av毛片久久久久**hd| 久久国产精品99精品国产| 亚洲自拍偷拍av| 国产欧美日韩亚州综合| 日韩一区二区三区四区五区六区| 波波电影院一区二区三区| 免费人成在线不卡| 亚洲高清免费在线| 亚洲欧洲美洲综合色网| 亚洲精品一区二区三区四区高清| 色噜噜狠狠一区二区三区果冻| 国产精品996| 国产精品伊人色| 极品销魂美女一区二区三区| 蜜臀av性久久久久蜜臀av麻豆| 亚洲精品成人少妇| 亚洲一级二级在线| 一级特黄大欧美久久久| 亚洲精品久久7777| 亚洲综合视频在线观看| 亚洲综合免费观看高清在线观看| 一区二区三区国产精华| 自拍偷拍亚洲综合| 亚洲免费在线观看| 亚洲精品老司机| 一区二区三区成人在线视频| 天天影视涩香欲综合网| 免费成人结看片| 国产一区日韩二区欧美三区| 不卡一区二区三区四区| 在线欧美日韩精品| 欧美一级夜夜爽| 国产日韩视频一区二区三区| 中文字幕日本不卡| 天堂久久一区二区三区| 亚洲日本在线观看| 国产日韩欧美综合一区| 国产精品蜜臀av| ...xxx性欧美| 亚洲黄色小视频| 五月天久久比比资源色| 蜜臀av一级做a爰片久久| 精品亚洲欧美一区| 成人avav影音| 欧美网站一区二区| 日韩欧美国产不卡| 国产女人aaa级久久久级| 亚洲免费在线视频| 日本不卡不码高清免费观看| 精品一区二区日韩|