Examples of VPFFile


Examples of org.geotools.data.vpf.file.VPFFile

     

        String fcsFileName = directoryName + File.separator + TABLE_FCS;

        try {
            VPFFile fcsFile = (VPFFile) VPFFileFactory.getInstance().getFile(fcsFileName);
            Iterator<SimpleFeature> iter = fcsFile.readAllRows().iterator();

            while (iter.hasNext()) {
                SimpleFeature feature = (SimpleFeature) iter.next();
                String featureClassName = feature.getAttribute("feature_class")
                                                 .toString().trim();
View Full Code Here

Examples of org.geotools.data.vpf.file.VPFFile

        String table1Key = row.getAttribute("table1_key").toString();
        String table2 = row.getAttribute("table2").toString();
        String table2Key = row.getAttribute("table2_key").toString();

        try {
            VPFFile vpfFile1 = VPFFileFactory.getInstance().getFile(directoryName.concat(
                        File.separator).concat(table1));
            addFileToTable(vpfFile1);

            VPFFile vpfFile2 = null;
            VPFColumn joinColumn1 = vpfFile1.getColumn(table1Key);
            VPFColumn joinColumn2;

            try {
                vpfFile2 = VPFFileFactory.getInstance().getFile(directoryName.concat(
                            File.separator).concat(table2));
                addFileToTable(vpfFile2);
                joinColumn2 = vpfFile2.getColumn(table2Key);
            } catch (IOException exc) {
                fileList.add(null);
                // We need to add a geometry column
                joinColumn2 = buildGeometryColumn(table2);
            }
View Full Code Here

Examples of org.geotools.data.vpf.file.VPFFile

        AbstractSet featureClassNames = new HashSet();
        String featureClassName;

        // We need to record all of the possible files
        // for each of the feature classes in this coverage
        VPFFile file =  VPFFileFactory.getInstance().getFile(fcsFileName);

        // We might want to grab the FCS list and pass it to the feature class
        // constructor just to save time.
        Iterator iter = file.readAllRows().iterator();
        while (iter.hasNext()) {
            SimpleFeature row = (SimpleFeature) iter.next();
            featureClassName = row.getAttribute("feature_class").toString().trim();
            featureClass = new VPFFeatureClass(this, featureClassName,
                    pathName, namespace);
View Full Code Here

Examples of org.geotools.data.vpf.file.VPFFile

     * @return a TableInputStream for the char.vdt for this coverage
     *
     * @throws IOException on any IO problems, particularly not being able to find the char.vdt file
     */
    private VPFFile getCharVDT() throws IOException {
        VPFFile charvdtInputStream = null;
        String charvdtFileName = pathName + File.separator
            + CHARACTER_VALUE_DESCRIPTION_TABLE;
        charvdtInputStream = VPFFileFactory.getInstance()
                                           .getFile(charvdtFileName);

View Full Code Here

Examples of org.geotools.data.vpf.file.VPFFile

     * @param directory A <code>File</code> representing the base directory of the database
     * @throws IOException
     * @throws SchemaException
     */
    public VPFDataBase(File directory) throws IOException, SchemaException {
        VPFFile vpfTable;
        String vpfTableName;
        SimpleFeature feature;
        VPFLibrary library;

        // read libraries info
        vpfTableName = new File(directory, LIBRARY_ATTTIBUTE_TABLE).toString();
        vpfTable = VPFFileFactory.getInstance().getFile(vpfTableName);

        Iterator iter = vpfTable.readAllRows().iterator();

        while (iter.hasNext()) {
            feature = (SimpleFeature) iter.next();

            try {
View Full Code Here

Examples of org.geotools.data.vpf.file.VPFFile

     * @throws SchemaException For problems making one of the feature classes as a FeatureType.
     */
    public VPFLibrary(File dir, URI namespace) throws IOException, SchemaException {
        // read libraries info
        String vpfTableName = new File(dir, LIBRARY_HEADER_TABLE).toString();
        VPFFile lhtFile = VPFFileFactory.getInstance().getFile(vpfTableName);
        lhtFile.reset();
  this.namespace = namespace;
        try {
            lhtFile.readFeature(); // check for errors
        } catch (IllegalAttributeException exc) {
            exc.printStackTrace();
            throw new IOException("Illegal values in library attribute table");
        }
        xmin = -180;
View Full Code Here

Examples of org.geotools.data.vpf.file.VPFFile

        String directoryName;

        // I'd like to know why this if is here...
        if (!directory.getName().equals("rference")) {
            String vpfTableName = new File(directory, COVERAGE_ATTRIBUTE_TABLE).toString();
            VPFFile vpfFile = VPFFileFactory.getInstance().getFile(vpfTableName);
            //            TableInputStream vpfTable = new TableInputStream(vpfTableName);
            Iterator iter = vpfFile.readAllRows().iterator();
            while (iter.hasNext()){
                feature = (SimpleFeature)iter.next();
                directoryName = directory.getPath();
                coverage = new VPFCoverage(this, feature, directoryName, namespace);
                coverages.add(coverage);
View Full Code Here

Examples of org.geotools.data.vpf.file.VPFFile

     */
    private void createTilingSchema(VPFCoverage coverage) throws IOException {
        //            File tilefile = new File(directory, "tilereft.tft");
       
        VPFFeatureType tileType = (VPFFeatureType)coverage.getFeatureTypes().get(0);
        VPFFile tileFile = (VPFFile)tileType.getFeatureClass().getFileList().get(0);
        Iterator rowsIter = tileFile.readAllRows().iterator();
        while (rowsIter.hasNext())
        {
            SimpleFeature row = (SimpleFeature)rowsIter.next();
            Short rowId = new Short(Short.parseShort(row.getAttribute("id").toString()));
            String value = row.getAttribute(FIELD_TILE_NAME).toString();
View Full Code Here

Examples of org.geotools.data.vpf.file.VPFFile

            try{
                // This is not really correct.  It does some basic sanity checks
                // (for GEO data type and WGE datum code), but basically assumes
                // WGS84 data ("EPSG:4326").
                String vpfTableName = new File(directory, GEOGRAPHIC_REFERENCE_TABLE).toString();
                VPFFile grtFile = VPFFileFactory.getInstance().getFile(vpfTableName);
                SimpleFeature grt = grtFile.getRowFromId("id", 1);
                String dataType = String.valueOf(grt.getAttribute("data_type"));

                if("GEO".equalsIgnoreCase(dataType)){
                    String geoDatumCode = String.valueOf(grt.getAttribute("geo_datum_code"));
                    if ("WGE".equalsIgnoreCase(geoDatumCode)){
View Full Code Here

Examples of org.geotools.data.vpf.file.VPFFile

            Short tileId = new Short(Short.parseShort(values.getAttribute("tile_id").toString()));
            tileDirectory = tileDirectory.concat(File.separator).concat(featureType.getFeatureClass().getCoverage().getLibrary().getTileMap().get(tileId).toString()).trim();
        }

        String edgeTableName = tileDirectory.concat(File.separator).concat(EDGE_PRIMITIVE);
        VPFFile edgeFile = VPFFileFactory.getInstance().getFile(edgeTableName);
        SimpleFeature row = edgeFile.getRowFromId("id", edgeId);
        result = (Geometry)row.getAttribute("coordinates");
        values.setDefaultGeometry(result);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.