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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mifdatastore.java

?? .mif .mid file read and write
?? JAVA
字號:
/*
 *    GeoTools - OpenSource mapping toolkit
 *    http://geotools.org
 *    (C) 2005-2006, GeoTools Project Managment Committee (PMC)
 * 
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation;
 *    version 2.1 of the License.
 *
 *    This library is distributed 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.  See the GNU
 *    Lesser General Public License for more details.
 */
package org.geotools.data.mif;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import org.geotools.data.AbstractDataStore;
import org.geotools.data.FeatureReader;
import org.geotools.data.FeatureWriter;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;


/**
 * <p>
 * MIFDataStore gives read and write access to MapInfo MIF files.  It can be
 * instantiated either on a single .mif file, or on a directory (thus exposing
 * all the mif files within).
 * </p>
 * 
 * <p>
 * MIFDataStore is a replacement for the MapInfoDataStore, which was based on
 * the legacy MapInfoDataSource.
 * </p>
 *
 * @author Luca S. Percich, AMA-MI
 * @source $URL: http://svn.geotools.org/trunk/modules/unsupported/mif/src/main/java/org/geotools/data/mif/MIFDataStore.java $
 * @version $Id: MIFDataStore.java 29414 2008-02-21 12:35:44Z groldan $
 */
public class MIFDataStore extends AbstractDataStore {
    // MIF Header clause names
    public static final String HCLAUSE_VERSION = "version";
    public static final String HCLAUSE_CHARSET = "charset";
    public static final String HCLAUSE_DELIMITER = "delimiter";
    public static final String HCLAUSE_UNIQUE = "unique";
    public static final String HCLAUSE_INDEX = "index";
    public static final String HCLAUSE_COORDSYS = "coordsys";
    public static final String HCLAUSE_TRANSFORM = "transform";

    // Config parameter names
    public static final String PARAM_FIELDCASE = "fieldCase";
    public static final String PARAM_GEOMFACTORY = "geometryFactory";
    public static final String PARAM_GEOMNAME = "geometryFieldName";
    public static final String PARAM_GEOMTYPE = "geometryType";
    public static final String PARAM_SRID = "SRID";

    // The path in which MIF/MIDs are being stored, or the single MIF file 
    private File filePath;

    // The parameter maps to pass to MIFFile constructors
    private HashMap params = null;

    // A map of MIFFileHolders, indexed by FeatureType name
    private HashMap mifFileHolders = new HashMap();

    /**
     * <p>
     * Builds a new MIFDataStore given a mif file or directory path.
     * </p>
     * 
     * <p>
     * Each feature type is represented by a MIFFile object
     * </p>
     *
     * @param path location (directory) of the mif files to read, or full path
     *        of a single mif file. If a directory is given, the headers of
     *        all the mif files in it are read.
     * @param params The MIFFile parameters map, see MIFFile for a full
     *        description.
     *
     * @throws IOException Path does not exists, or error accessing files
     *
     * @see MIFFile#MIFFile(String, Map)
     */
    public MIFDataStore(String path, HashMap params) throws IOException {
        // TODO use url instead of String
        super(true); // Is writable

        this.params = (params != null) ? params : new HashMap();

        filePath = new File(String.valueOf(path));

        if (filePath.isDirectory()) {
            scanFiles(filePath);
        } else {
            // Try to access a single .mif file - might have been specified with no extension
            registerMIF(filePath.getAbsolutePath());
        }
    }

    /**
     * <p>
     * Looks for all the .mif files in the given Path
     * </p>
     *
     * @param filePath
     *
     * @return the number of mif files found
     *
     * @throws IOException
     */
    private int scanFiles(File filePath) throws IOException {
        if (!filePath.isDirectory()) {
            return 0;
        }

        File[] files = filePath.listFiles();

        int found = 0;

        for (int i = 0; i < files.length; i++) {
            String fName = files[i].getName();

            if ((fName.length() > 4)
                    && (fName.toLowerCase().indexOf(".mif") == (fName.length()
                    - 4))) {
                fName = fName.substring(0, fName.length() - 4);

                if (mifFileHolders.get(fName) == null) {
                    registerMIF(files[i].getAbsolutePath());
                    found++;
                }
            }
        }

        return found;
    }

    /**
     * <p>
     * Given a FeatureType, creates the corresponding MIFFile object in the
     * current directory
     * </p>
     * .
     *
     * @param featureType The FeatureType
     *
     * @throws IOException if init path is not a directory or a MIFFile object
     *         cannot be created
     */
    public void createSchema(SimpleFeatureType featureType) throws IOException {
        if (!filePath.isDirectory()) {
            throw new IOException(
                "Can't create schema on a MIF DataStore instantiated from a single MIF file");
        }

        try {
            File newFile = new File(filePath, featureType.getTypeName()
                    + ".mif");
            MIFFile mf = new MIFFile(newFile.getAbsolutePath(), featureType,
                    params);
            MIFFileHolder mfh = new MIFFileHolder(mf);
            mifFileHolders.put(mf.getSchema().getTypeName(), mfh);
        } catch (Exception e) {
            throw new IOException("Unable to create MIFFile object: "
                + e.getMessage());
        }
    }

    /**
     * <p>
     * Returns the list of type names (mif files)
     * </p>
     *
     * @return The list of type names
     *
     * @throws IOException Couldn't scan path for files
     */
    public String[] getTypeNames() throws IOException {
        scanFiles(filePath); // re-scans path just in case some file was added

        String[] names = new String[mifFileHolders.size()];
        int index = 0;

        for (Iterator i = mifFileHolders.keySet().iterator(); i.hasNext();)
            names[index++] = (String) i.next();

        return names;
    }

    /**
     * <p>
     * Returns the schema given a type name
     * </p>
     *
     * @param typeName
     *
     *
     * @throws IOException
     */
    public SimpleFeatureType getSchema(String typeName) throws IOException {
        return getMIFFile(typeName).getSchema();
    }

    /**
     * Gets a  FeatureReader<SimpleFeatureType, SimpleFeature> from a MIFFile object
     *
     * @param typeName name of the FeatureType
     *
     * @return The FeatureReader
     *
     * @throws IOException
     */
    protected  FeatureReader<SimpleFeatureType, SimpleFeature> getFeatureReader(String typeName)
        throws IOException {
        return getMIFFile(typeName).getFeatureReader();
    }

    /**
     * Gets a FeatureWriter from a MIFFile object
     *
     * @param typeName
     *
     *
     * @throws IOException
     */
    protected FeatureWriter<SimpleFeatureType, SimpleFeature> getFeatureWriter(String typeName)
        throws IOException {
        return getMIFFile(typeName).getFeatureWriter();
    }

    /**
     * <p>
     * Loads a MIF file header and create the corresponding schema.
     * </p>
     *
     * @param path path of single .MIF file.
     *
     * @throws IOException
     */
    private void registerMIF(String path) throws IOException {
        MIFFile mf = new MIFFile(path, params);
        MIFFileHolder mfh = new MIFFileHolder(mf);
        SimpleFeatureType ft = mf.getSchema();
        mifFileHolders.put(ft.getTypeName(), mfh);
    }

    /**
     * <p>
     * Returns a MIFFile object given its type name.
     * </p>
     *
     * @param typeName
     *
     */
    private MIFFile getMIFFile(String typeName) {
        MIFFileHolder mifHolder = (MIFFileHolder) mifFileHolders.get(typeName);

        if (mifHolder != null) {
            return mifHolder.mifFile;
        }

        try {
            if (scanFiles(filePath) == 0) {
                return null; // no more file read 
            }
        } catch (IOException e) {
        }

        mifHolder = (MIFFileHolder) mifFileHolders.get(typeName);

        if (mifHolder != null) {
            return mifHolder.mifFile;
        }

        return null;
    }

    // Utility class for holding MIFFile objects
    private class MIFFileHolder {
        private MIFFile mifFile = null;

        //private boolean modified = false;
        //private boolean inSync = true;
        private MIFFileHolder(MIFFile mifFile) {
            this.mifFile = mifFile;
        }
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
aaa欧美日韩| 伊人一区二区三区| 极品少妇xxxx精品少妇| 日韩一级欧美一级| 美女视频免费一区| xvideos.蜜桃一区二区| 美女久久久精品| 久久久国产午夜精品| 国产69精品一区二区亚洲孕妇| 国产亚洲va综合人人澡精品| 粉嫩av一区二区三区在线播放| 国产亚洲一区字幕| 91麻豆精品秘密| 石原莉奈在线亚洲二区| 欧美草草影院在线视频| 国产精品18久久久久久vr| 国产精品欧美一区喷水| 欧美亚洲综合在线| 精品一区二区三区免费视频| 国产精品久久久久久久蜜臀 | 懂色av一区二区三区免费观看| 国产精品欧美一区喷水| 欧美日韩综合色| 国产一区不卡在线| 成人免费在线视频| 日韩精品中文字幕在线不卡尤物| 国产精品一区专区| 玉米视频成人免费看| 91精品国产黑色紧身裤美女| 丁香婷婷综合色啪| 亚洲观看高清完整版在线观看| 日韩一区二区三区电影在线观看| 成人永久看片免费视频天堂| 一卡二卡三卡日韩欧美| 久久人人爽人人爽| 欧美性受xxxx黑人xyx性爽| 精品综合免费视频观看| 一区二区三区国产精华| 精品欧美一区二区久久| 色又黄又爽网站www久久| 另类小说色综合网站| 亚洲男同性视频| 精品国产99国产精品| 欧美日韩精品欧美日韩精品一 | 欧美精品一区二区蜜臀亚洲| 99精品久久99久久久久| 久久疯狂做爰流白浆xx| 亚洲国产精品一区二区久久| 亚洲国产精品精华液ab| 欧美电影精品一区二区| 欧美视频中文字幕| 91天堂素人约啪| 国产成人综合网站| 久久99久久99| 日韩精品亚洲专区| 一区二区三区欧美日韩| 中文字幕欧美三区| 久久精品日产第一区二区三区高清版 | 国产精品网站在线| 精品成人在线观看| 欧美一激情一区二区三区| 色哟哟精品一区| 99久久婷婷国产| 成人黄动漫网站免费app| 国产精品白丝av| 国产一区二区三区精品欧美日韩一区二区三区 | 国产乱码精品一区二区三区忘忧草| 亚洲国产一区视频| 一区二区三区中文字幕在线观看| 国产精品欧美精品| 久久久.com| 国产无人区一区二区三区| 日韩欧美在线综合网| 国产欧美日韩亚州综合| 精品少妇一区二区三区视频免付费 | 国产欧美一区二区在线| 26uuuu精品一区二区| 欧美精品一区二| 欧美成人猛片aaaaaaa| 欧美不卡在线视频| 久久美女高清视频| 欧美国产视频在线| 最新国产成人在线观看| 亚洲欧洲精品天堂一级| 亚洲欧美综合另类在线卡通| 国产精品传媒视频| 亚洲女厕所小便bbb| 亚洲一区二区三区国产| 香蕉久久夜色精品国产使用方法| 五月婷婷久久丁香| 日韩精品国产精品| 久久丁香综合五月国产三级网站| 国模娜娜一区二区三区| 国产精品一二三四区| 成人动漫视频在线| 色欧美日韩亚洲| 欧美三级韩国三级日本三斤| 宅男噜噜噜66一区二区66| 日韩欧美精品在线视频| 国产女同性恋一区二区| 日韩理论电影院| 亚洲一区二区三区免费视频| 蜜臀av一区二区在线免费观看| 国产在线精品免费| 99久久综合色| 欧美精三区欧美精三区| 日韩一级大片在线观看| 国产日产亚洲精品系列| 亚洲欧美日韩国产另类专区| 午夜精品免费在线观看| 精品影视av免费| 91视视频在线观看入口直接观看www | 一区二区在线观看av| 亚洲成国产人片在线观看| 久久99久久久欧美国产| 精品污污网站免费看| 日韩精品资源二区在线| 中文字幕在线不卡一区| 午夜欧美电影在线观看| 国产福利精品一区二区| 欧洲日韩一区二区三区| 久久综合五月天婷婷伊人| 亚洲品质自拍视频| 九九九精品视频| 色哟哟亚洲精品| 国产亚洲欧美激情| 亚洲国产婷婷综合在线精品| 激情欧美日韩一区二区| 欧美少妇一区二区| 欧美国产精品中文字幕| 舔着乳尖日韩一区| 99久久伊人精品| 欧美大片在线观看| 亚洲午夜免费福利视频| 成人激情免费视频| 久久综合色婷婷| 日韩综合小视频| 色综合久久综合中文综合网| 2019国产精品| 日韩成人免费在线| 色综合咪咪久久| 中文字幕制服丝袜一区二区三区 | 久久亚洲综合色| 午夜av电影一区| 99国产麻豆精品| 欧美激情自拍偷拍| 国产一区二区三区四区五区入口 | 成人精品免费视频| 精品1区2区在线观看| 亚洲国产日韩a在线播放性色| 懂色av一区二区三区蜜臀 | 26uuu亚洲| 久久精品免费看| 欧美日韩国产bt| 亚洲一区二区高清| 99精品久久99久久久久| 2020国产成人综合网| 久久 天天综合| 日韩欧美亚洲国产另类| 日本成人超碰在线观看| 欧美日本一区二区| 一区二区三区免费| 99精品在线观看视频| 中文字幕一区二区三区乱码在线| 国产精品99久久久久久宅男| 日韩免费看的电影| 美腿丝袜亚洲色图| 日韩精品中午字幕| 狠狠色丁香九九婷婷综合五月| 欧美刺激脚交jootjob| 久久av资源网| 久久久影院官网| 国产精品911| 国产精品对白交换视频| 成人动漫一区二区在线| 亚洲欧洲一区二区三区| 91在线国产福利| 人人爽香蕉精品| 日韩一区二区三区精品视频| 日本大胆欧美人术艺术动态 | 色综合久久久网| 一区二区三区国产精品| 欧美日本国产视频| 蜜芽一区二区三区| 日韩精品一区二区三区四区| 久久国产精品露脸对白| 久久精品一区八戒影视| 国产91在线观看| 亚洲你懂的在线视频| 欧美精品一二三| 国产主播一区二区三区| 国产欧美视频一区二区| 91一区二区在线观看| 亚洲自拍偷拍综合| 日韩一区二区三区视频在线观看| 狠狠色丁香久久婷婷综| 亚洲欧美一区二区三区极速播放| 欧美私模裸体表演在线观看| 久久激情综合网| 亚洲欧洲韩国日本视频|