Hi,

I'm trying to get osm tiles (256x256px images) to display in my JMapPane.
What I do is: I download tiles from http://tile.openstreetmap.org/ (then I
cache etc.) and then:

StyleBuilder sb = new StyleBuilder();
Style style = sb.createStyle(sb.createRasterSymbolizer());
GridCoverageFactory gridFactory = new GridCoverageFactory(); GridCoverage2D
grid = gridFactory.create("GridCoverage-" + tile.getUniqueId(),
tile.getImage(), tile.getEnvelope()); MapLayer layer = new MapLayer(grid,
style); _map.getMapContext().addLayer(layer);
_map.repaint();

With _map being a JMapPane.

While this works most of the time, some tiles/layers are sometimes not
rendered. Actually every time there are some tiles/layers missing.

Interestingly when using JMapPane.moveImage in a completely unrelated part
of my code (panning) all the tiles show up. I already tried to use
moveImage(1,1) after addLayer, but that just messes everything up.

Sometimes I get this message:
09.06.2011 00:09:30
org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer
prepareFinalImage
INFO: The destination envelope does not intersect the envelope of the source
coverage.
But that's just 10% of the time tiles/layers are missing.

Am I even on the right track for displaying these images? And why doesn't it
work? :-)

Oh and I'm using geotools 8.0-M.0 + fix from
http://jira.codehaus.org/browse/GEOT-3555

Regards,
Alex


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to