Examples of DcwRecordFile


Examples of com.bbn.openmap.layer.vpf.DcwRecordFile

        int id = VPFUtil.objectToInt(l.get(0));
        row.addElement("" + id + " (" + tileId + "," + primId + ") (" + fcId
                + ", " + featureId + ")");
        try {
            tiler.getRow(tileId, primId, primRow);
            DcwRecordFile featureTable = getFeatureTable(fcId);
            featureTable.getRow(featureRow, featureId);
            for (Iterator i = primRow.iterator(); i.hasNext();) {
                row.addElement(new TableDataElement("CLASS=JoinColumn", i.next()
                        .toString()));
            }
            for (Iterator i = featureRow.iterator(); i.hasNext();) {
View Full Code Here

Examples of com.bbn.openmap.layer.vpf.DcwRecordFile

    public String[] getFeatureNames(File dirPath) throws FormatException {
        File fcafile = new File(dirPath, "fca");
        if (!fcafile.canRead()) {
            fcafile = new File(dirPath, "fca.");
        }
        DcwRecordFile fca = new DcwRecordFile(fcafile.toString());
        List l = new ArrayList(fca.getColumnCount());
        int fclassColumn = fca.whatColumn("fclass");
        List fclassnames = new ArrayList();
        while (fca.parseRow(l)) {
            fclassnames.add(l.get(fclassColumn));
        }
        fca.close();
        String retval[] = new String[fclassnames.size()];
        fclassnames.toArray(retval);
        return retval;
    }
View Full Code Here

Examples of com.bbn.openmap.layer.vpf.DcwRecordFile

    }

    public void close() {
        tiler.close();
        for (int i = 0; i < featureTables.length; i++) {
            DcwRecordFile drf = featureTables[i];
            if (drf != null) {
                drf.close();
            }
        }
    }
View Full Code Here

Examples of com.bbn.openmap.layer.vpf.DcwRecordFile

                response.setContentType("text/html");
                out.println(HTML_DOCTYPE + "<HTML>\n<HEAD><TITLE>" + filename
                        + "</TITLE></HEAD>\r\n<BODY>\r\n<H1>Table " + filename
                        + "</H1>\r\n");
                out.println(getStylesheetHTML(request));
                DcwRecordFile foo = new DcwRecordFile(rootpath);
                request.setAttribute(RECORD_FILE_OBJ, foo);
                RequestDispatcher rd = request.getRequestDispatcher("/Schema");
                rd.include(request, response);
                RequestDispatcher rd2 = request.getRequestDispatcher("/Data");
                rd2.include(request, response);

                foo.close();
            }
        } catch (FormatException f) {
            throw new ServletException("Format Error: ", f);
        }
        // s.close();
View Full Code Here

Examples of com.bbn.openmap.layer.vpf.DcwRecordFile

            if (!pathOkay(filePath, pathInfo, response)) {
                return;
            }
        }

        DcwRecordFile docfile = null;
        try {
            docfile = new DcwRecordFile(filePath);
        } catch (FormatException fe) {
            response.sendError(HttpServletResponse.SC_NOT_FOUND,
                    " docfile not found");
            return;
        }

        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        out.println(HTML_DOCTYPE);
        out.println(getStylesheetHTML(request));

        String tableName = docfile.getTableName();
        out.println("<HTML>");
        String title = "VPF Documentation File " + tableName;
        out.println("<HEAD><TITLE>" + title + "</TITLE></HEAD>");
        out.println("<BODY><H1>" + title + "</H1>");

        try {
            docfile.lookupSchema(FieldColumns,
                    true,
                    FieldTypeSchema,
                    FieldLengthSchema,
                    false);
        } catch (FormatException fe) {
            out.println("The documentation file appears to be invalid.");
            RequestDispatcher rd = request.getRequestDispatcher("/Schema");
            rd.include(request, response);
            out.println("</BODY></HTML>");
            docfile.close();
            return;
        }

        ArrayList al = new ArrayList(FieldTypeSchema.length);
        out.println("<pre>");
        try {
            while (docfile.parseRow(al)) {
                out.println("   " + al.get(1).toString());
            }
            out.println("</pre>");
        } catch (FormatException fe) {
            out.println("/pre>");
            out.println("File Format Exception processing data: " + fe);
        }
        out.println("</BODY></HTML>");
        docfile.close();
    }
View Full Code Here

Examples of com.bbn.openmap.layer.vpf.DcwRecordFile

        this.basepath = basepath;
        curTile = -1;
        if (isTiled) {
            tileStuff = doTileRefStuff(basepath);
        } else {
            currentTileFile = new DcwRecordFile(basepath + File.separator
                    + fileName);
        }
    }
View Full Code Here

Examples of com.bbn.openmap.layer.vpf.DcwRecordFile

        }
        if (tileId != curTile) {
            File joinfile = new File(basepath + File.separator
                    + tileStuff[tileId]);
            close();
            currentTileFile = new DcwRecordFile(joinfile + File.separator
                    + fileName);
            curTile = tileId;
        }
        return currentTileFile.getRow(retrow, rowId);
    }
View Full Code Here

Examples of com.bbn.openmap.layer.vpf.DcwRecordFile

        // read the fbr (face bounding rectangle) table
        File fcsFile = new File(pathname, "fcs");
        if (!fcsFile.canRead()) {
            fcsFile = new File(pathname, "fcs.");
        }
        DcwRecordFile fcs = new DcwRecordFile(fcsFile.toString());
        Vector fcsv = new Vector(fcs.getColumnCount());
        while (fcs.parseRow(fcsv)) {
            String fclass = ((String) fcsv.elementAt(1)).toLowerCase();
            String table1 = ((String) fcsv.elementAt(2)).toLowerCase();
            if ((fclass.equals("tileref")) && (table1.equals("tileref.aft"))) {
                faceIDColumnName = (String) fcsv.elementAt(3);
                break;
            }
        }
        fcs.close();

        if (faceIDColumnName == null) {
            throw new FormatException("no faceIDColumn");
            // won't be able to read the tiling info. abort
        }

        // Okay, we've got info on what column we use from tileref.aft
        // to index
        // into the fbr.
        DcwRecordFile aft = new DcwRecordFile(pathname + File.separator
                + "tileref.aft");
        int faceIDColumn = aft.whatColumn(faceIDColumnName.toLowerCase());
        int tileNameColumn = aft.whatColumn("tile_name");

        if ((faceIDColumn == -1) || (tileNameColumn == -1)) {
            aft.close();
            throw new FormatException("no faceIDColumn");
        }

        Vector aftv = new Vector(aft.getColumnCount());

        // set the array size to record count + 1, to be able to
        // use the tileID as the index into the array
        String containedTiles[] = new String[aft.getRecordCount() + 1];

        int tileid = 1;
        while (aft.parseRow(aftv)) {
            //int fac_num = ((Number) aftv.elementAt(faceIDColumn)).intValue();
            String tilename = (String) aftv.elementAt(tileNameColumn);

            char chs[] = tilename.toCharArray();
            boolean goodTile = false;
            for (int i = 0; i < chs.length; i++) {
                if ((chs[i] != '\\') && (chs[i] != ' ')) {
                    goodTile = true;
                    chs[i] = Character.toLowerCase(chs[i]);
                }
                if (chs[i] == '\\') {
                    chs[i] = File.separatorChar;
                }
            }
            containedTiles[tileid++] = (goodTile) ? new String(chs) : null;
        }
        aft.close();
        return containedTiles;
    }
View Full Code Here

Examples of com.bbn.openmap.layer.vpf.DcwRecordFile

    private HashMap loadIntVDT(File path, String tableName) {
        HashMap hm = new HashMap();
        try {
            File vdt = new File(path, Constants.intVDTTableName);
            if (vdt.canRead()) {
                DcwRecordFile intvdt = new DcwRecordFile(vdt.toString());
                int intcols[] = intvdt.lookupSchema(CoverageTable.VDTColumnNames,
                        true,
                        CoverageTable.intVDTschematype,
                        CoverageTable.intVDTschemalength,
                        false);

                List al = new ArrayList(intvdt.getColumnCount());
                while (intvdt.parseRow(al)) {
                    String tab = (String) al.get(intcols[0]);
                    if (!tableName.equalsIgnoreCase(tab)) {
                        continue;
                    }
                    String attr = (String) al.get(intcols[1]);
                    int val = ((Number) al.get(intcols[2])).intValue();
                    String desc = ((String) al.get(intcols[3])).intern();
                    hm.put(new CoverageIntVdt(attr, val), desc);
                }
                intvdt.close();
            }
        } catch (FormatException f) {
        }
        return hm;
    }
View Full Code Here

Examples of com.bbn.openmap.layer.vpf.DcwRecordFile

    private HashMap loadCharVDT(File path, String tableName) {
        HashMap hm = new HashMap();
        try {
            File vdt = new File(path, Constants.charVDTTableName);
            if (vdt.canRead()) {
                DcwRecordFile charvdt = new DcwRecordFile(vdt.toString());
                int charcols[] = charvdt.lookupSchema(CoverageTable.VDTColumnNames,
                        true,
                        CoverageTable.charVDTschematype,
                        CoverageTable.charVDTschemalength,
                        false);

                ArrayList al = new ArrayList(charvdt.getColumnCount());
                while (charvdt.parseRow(al)) {
                    String tab = (String) al.get(charcols[0]);
                    if (!tableName.equalsIgnoreCase(tab)) {
                        continue;
                    }
                    String attr = (String) al.get(charcols[1]);
                    String val = (String) al.get(charcols[2]);
                    String desc = ((String) al.get(charcols[3])).intern();
                    hm.put(new CoverageCharVdt(attr, val), desc);
                }
                charvdt.close();
            }
        } catch (FormatException f) {
        }
        return hm;
    }
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.