private Image getMapImage (TileIndex tile) { WebMercatorTilePyramid mercator = new WebMercatorTilePyramid(); Rectangle2D bounds = mercator.getEPSG_900913Bounds(tile, null); String url = String.format("http://129.206.228.72/cached/osm?LAYERS=osm_auto:all&STYLES=&" + "SRS=EPSG%%3A900913&FORMAT=image%%2Fpng&SERVICE=WMS&VERSION=1.1.1" + "&REQUEST=GetMap&BBOX=%.3f,%.3f,%.3f,%.3f&WIDTH=1024&HEIGHT=1024", bounds.getMinX(), bounds.getMinY(), bounds.getMaxX(), bounds.getMaxY()); try { return getToolkit().getImage(new URL(url)); } catch (MalformedURLException e) { return null; } }
/** * Get the tiling projection used to create the tile pyramid described by * this metadata object. */ public TilePyramid getTilePyramid () { try { String projection = _metaData.getString("projection"); if ("EPSG:4326".equals(projection)) { JSONArray bounds = _metaData.getJSONArray("bounds"); double xMin = bounds.getDouble(0); double yMin = bounds.getDouble(1); double xMax = bounds.getDouble(2); double yMax = bounds.getDouble(3); return new AOITilePyramid(xMin, yMin, xMax, yMax); } else if ("EPSG:900913".equals(projection) || "EPSG:3857".equals(projection)) { return new WebMercatorTilePyramid(); } } catch (JSONException e) { LOGGER.log(Level.WARNING, "Bad projection data in tile pyramid", e); } return null; }
@Override protected TilePyramid create () throws ConfigurationException { String pyramidType = getPropertyValue(PYRAMID_TYPE).toLowerCase(); if ("webmercator".equals(pyramidType) || "epsg:900913".equals(pyramidType) || "epsg:3857".equals(pyramidType)) { return new WebMercatorTilePyramid(); } else if ("areaofinterest".equals(pyramidType) || "epsg:4326".equals(pyramidType)) { double minX = getPropertyValue(MINIMUM_X); double maxX = getPropertyValue(MAXIMUM_X); double minY = getPropertyValue(MINIMUM_Y); double maxY = getPropertyValue(MAXIMUM_Y); return new AOITilePyramid(minX, minY, maxX, maxY); } else { throw new ConfigurationException("Unrecognized pyramid type "+pyramidType); } } }
@Before public void setup () { _mercator = new WebMercatorTilePyramid(); }
@Before public void setup () { _pyramid = new WebMercatorTilePyramid(); _indexer = new AnnotationIndexerImpl(); }
@Before public void setup () { _pyramid = new WebMercatorTilePyramid(); _indexer = new AnnotationIndexerImpl(); }
@Before public void setup () { _pyramid = new WebMercatorTilePyramid(); _indexer = new AnnotationIndexerImpl(); _tileSerializer = new StringLongPairArrayMapJsonSerializer(); _dataSerializer = new JSONAnnotationDataSerializer(); }
@Before public void setup () { try { _dataIO = new HBaseAnnotationIO("MUST", "SET", "THESE"); _tileIO = new HBasePyramidIO("MUST", "SET", "THESE"); } catch (Exception e) { LOGGER.error("Error: " + e.getMessage()); } _pyramid = new WebMercatorTilePyramid(); _indexer = new AnnotationIndexerImpl(); _tileSerializer = new StringLongPairArrayMapJsonSerializer(); _dataSerializer = new JSONAnnotationDataSerializer(); }
@Test public void smallIteratorTest () { WebMercatorTilePyramid mercator = new WebMercatorTilePyramid();
@Before public void setup () { try { _dataIO = new FileSystemAnnotationIO( new FileSystemAnnotationSource( ROOT_PATH, DATA_EXT ) ); _tileIO = new FileBasedPyramidIO(new FileSystemPyramidSource(ROOT_PATH, TILE_EXT)); } catch (Exception e) { LOGGER.debug("Error: " + e.getMessage()); } _pyramid = new WebMercatorTilePyramid(); _indexer = new AnnotationIndexerImpl(); _tileSerializer = new StringLongPairArrayMapJsonSerializer(); _dataSerializer = new JSONAnnotationDataSerializer(); }
@Ignore @Test public void isolateTestCases () { WebMercatorTilePyramid mercator = new WebMercatorTilePyramid();
@Test public void largeIteratorTest () { WebMercatorTilePyramid mercator = new WebMercatorTilePyramid();