Package org.geotools.geopkg

Examples of org.geotools.geopkg.Tile


        geopkg.create(e);
        assertTileEntry(e);

        List<Tile> tiles = new ArrayList();
        tiles.add(new Tile(0,0,0,new byte[]{0}));
        tiles.add(new Tile(1,0,0,new byte[]{1}));
        tiles.add(new Tile(1,0,1,new byte[]{2}));
        tiles.add(new Tile(1,1,0,new byte[]{3}));
        tiles.add(new Tile(1,1,1,new byte[]{4}));

        for (Tile t : tiles) {
            geopkg.add(e, t);
        }
View Full Code Here


    void assertTiles(List<Tile> tiles, TileReader r) throws IOException {
        for (Tile t : tiles) {
            assertTrue(r.hasNext());

            Tile a = r.next();
            assertEquals(t, a);
        }
        assertFalse(r.hasNext());
        r.close();
    }
View Full Code Here

            TileReader it;
            it = file.reader(entry, bestMatrix.getZoomLevel(), bestMatrix.getZoomLevel(), leftTile, rightTile, bottomTile, topTile);

            while (it.hasNext()) {               
                Tile tile = it.next();

                BufferedImage tileImage = readImage(tile.getData());

                if (image == null) {
                    image = getStartImage(tileImage, width, height);
                }

                //coordinates
                int posx = (int) (tile.getColumn() - leftTile) * DEFAULT_TILE_SIZE;
                int posy = (int) (topTile - tile.getRow()) * DEFAULT_TILE_SIZE;

                image.getRaster().setRect(posx, posy, tileImage.getData() );
            }

            it.close();
View Full Code Here

           
            for (long x = minX; x < maxX; x++) {
                for (long y = minY; y < maxY; y++) {
                    req.setBbox(new Envelope( xOffset + x * resX , xOffset + (x+1) * resX, yOffset + y * resY, yOffset + (y+1) * resY));
                    WebMap result = webMapService.getMap(req);
                    Tile t = new Tile();
                    t.setZoom(matrix.getZoomLevel());
                    t.setColumn((int) x);
                    t.setRow((int) y);
                    t.setData(toBytes(result));
                    geopkg.add(e, t);
                    // Cleanup
                    cleaner.finished(null);
                }
            }
View Full Code Here

        }

        @Override
        public void addTile(int zoom, int x, int y, byte[] data) throws IOException {
            Tile t = new Tile();
            t.setZoom(zoom);
            t.setColumn(x);
            t.setRow(y);
            t.setData(data);
            geopkg.add(e, t);
        }
View Full Code Here

TOP

Related Classes of org.geotools.geopkg.Tile

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.