Package org.geotools.data.shapefile.files

Examples of org.geotools.data.shapefile.files.ShpFiles


        File dir = DataUtilities.urlToFile(url);
        if (dir != null && dir.isDirectory()) {
            return new DirectoryDataStore(DataUtilities.urlToFile(url), new ShpFileStoreFactory(
                    this, params));
        } else {
            ShpFiles shpFiles = new ShpFiles(url);

            boolean isLocal = shpFiles.isLocal();
            boolean useMemoryMappedBuffer = isLocal && isMemoryMapped.booleanValue();
            boolean enableIndex = isEnableSpatialIndex.booleanValue() && isLocal;
            boolean createIndex = isCreateSpatialIndex.booleanValue() && enableIndex;

            // build the store
View Full Code Here


    private ShpFiles shpFiles;

    @Before
    public void setUp() throws Exception {
        shpFiles = new ShpFiles(TestData.url(TEST_FILE));
        dbf = new DbaseFileReader(shpFiles, false,
                ShapefileDataStore.DEFAULT_STRING_CHARSET);
    }
View Full Code Here

        DbaseFileWriter dbf = new DbaseFileWriter(header, fout.getChannel(), Charset.defaultCharset());
        for (int i = 0; i < header.getNumRecords(); i++) {
            dbf.write(new Object[6]);
        }
        dbf.close();
        ShpFiles tempShpFiles = new ShpFiles(f);
        DbaseFileReader r = new DbaseFileReader(tempShpFiles, false,
                ShapefileDataStore.DEFAULT_STRING_CHARSET);
        int cnt = 0;
        while (r.hasNext()) {
            cnt++;
View Full Code Here

    IndexManager indexManager;

    ShapefileSetManager shpManager;

    public ShapefileDataStore(URL url) {
        shpFiles = new ShpFiles(url);
        if (TRACE_ENABLED) {
            trace = new Exception();
            trace.fillInStackTrace();
        }
        shpManager = new ShapefileSetManager(shpFiles, this);
View Full Code Here

    /**
     * Generates the FID index file for the shpFile
     */
    public static synchronized void generate(URL shpURL) throws IOException {
        generate(new ShpFiles(shpURL));
    }
View Full Code Here

        map = ShpFilesTest.createFiles("shpFiles", ShpFileType.values(), false);

        typeName = map.get(SHP).getName();
        typeName = typeName.substring(0, typeName.lastIndexOf("."));

        files = new ShpFiles(map.get(SHP));
    }
View Full Code Here

        }
    }

    @Test
    public void testIsLocalURL() throws IOException {
        ShpFiles files = new ShpFiles("http://someurl.com/file.shp");
        assertFalse(files.isLocal());
    }
View Full Code Here

        }
    }

    @Test
    public void testExceptionGetInputStream() throws Exception {
        ShpFiles shpFiles = new ShpFiles(new URL("http://blah/blah.shp"));
        try{
            shpFiles.getInputStream(SHP, this);
            fail("maybe test is bad?  We want an exception here");
        }catch(Throwable e){
            assertEquals(0, shpFiles.numberOfLocks());
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testExceptionGetOutputStream() throws Exception {
        ShpFiles shpFiles = new ShpFiles(new URL("http://blah/blah.shp"));
        try{
            shpFiles.getOutputStream(SHP, this);
            fail("maybe test is bad?  We want an exception here");
        }catch(Throwable e){
            assertEquals(0, shpFiles.numberOfLocks());
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testExceptionGetWriteChannel() throws Exception {
        ShpFiles shpFiles = new ShpFiles(new URL("http://blah/blah.shp"));
        try{
            shpFiles.getWriteChannel(SHP, this);
            fail("maybe test is bad?  We want an exception here");
        }catch(Throwable e){
            assertEquals(0, shpFiles.numberOfLocks());
        }
    }
View Full Code Here

TOP

Related Classes of org.geotools.data.shapefile.files.ShpFiles

Copyright © 2018 www.massapicom. 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.