<div dir="ltr">Hello all,<div><br></div><div>I am using DefaultPortrayalService to render a MapContext to a BufferedImage. My (heavily simplified) code looks something like this:</div><div><br></div><div><font face="monospace, monospace">MapContext context = ... (created earlier)</font></div><div><font face="monospace, monospace">Envelope envelope = ... (created earlier)</font></div><div><font face="monospace, monospace">OutputStream outputStream = ... (created earlier)</font></div><div><font face="monospace, monospace">Dimension dimension = ... (created earlier)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">BufferedImage img = DefaultPortrayalService.portray(context, envelope, dimension, false);</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">ImageIO.write(img, "PNG", outputStream);</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">As far as I can tell, this is the proper way to render a MapContext. However, the image I get back in the output stream is incorrect. In order to get the image oriented properly, I need to flip it upside down and rotate it -90 degrees. Additionally, if the supplied dimensions are not square, the original image is missing content because it is drawn in the wrong orientation (that is, it gets cropped). I've attached a few example files.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">I'm trying to work around the issue by performing AffineTransforms on the rendered image to get it oriented properly, but I would obviously prefer if the image were correct on the first try. Is this an issue with the way I am using DefaultPortrayalService, or is it a bug?</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">In case it is relevant, I am getting the FeatureCollection in my MapContext from WGS 1984 shape files. I have tried a few different shape files, so I don't think it's an issue caused only by certain data sets. Also of note is that my source CRS and target CRS are the same (EPSG:4326, AKA WGS 1984).</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Regards</font></div><div><font face="arial, helvetica, sans-serif">Cullen Rombach</font></div><div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Cullen Rombach<div>Image Matters LLC</div><div><a href="http://www.imagemattersllc.com" target="_blank">www.imagemattersllc.com</a></div></div></div>
</div></div>