Hi.
I'm trying to merge an (satellite background) image I get from a WMS
server with a local (partially transparent) image.
I guess I'm not that far away from the solution but I don't know how to
store the combined image on the hard drive.
My current code is:
mBoundingBox = ...
URL url = new URL("http://localhost/wms_dop");
WebMapServer wms = new WebMapServer(url);
GetMapRequest request = wms.createGetMapRequest();
BoundingBox bbox = new ReferencedEnvelope(mBoundingBox);
request.setBBox( bbox );
request.setFormat( "image/png" );
request.setDimensions( 256, 256 );
request.setSRS( "EPSG:4326" );
GetMapResponse response = wms.issueRequest(request);
BufferedImage image = ImageIO.read(response.getInputStream());
AbstractGridFormat format = GridFormatFinder.findFormat( image );
AbstractGridCoverage2DReader reader = format.getReader( image );
File imageLocation = new File(heatmapLocation);
AbstractGridFormat format2 = GridFormatFinder.findFormat( imageLocation );
AbstractGridCoverage2DReader reader2 = format2.getReader( imageLocation );
MapContext map = new DefaultMapContext();
map.addLayer( reader, null );
map.addLayer( reader2, null );
// ...store map as png on hard drive?
Thanks in advance for any help!
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users