Hi all,

I passed a CRS for ReferencedEnvelope constructor and now I get a rendered
image, but it is not centered. Does anyone know how can I fix this?

Thanks in advance.

On 24 June 2011 21:02, Odilon Lima <[email protected]> wrote:

> Hi all,
>
> I am also having trouble generating an image. I tried to run the following
> code:
>
>
> Style shpStyle = SLD.createPolygonStyle(Color.YELLOW, null, 0.0f);
>             FileDataStore dataStore = FileDataStoreFinder.getDataStore(new
> File("/home/odilon/mapas/AESA/Municipios/Municipios.shp"));
>             SimpleFeatureSource shapefileSource =
> dataStore.getFeatureSource();
>
>             final MapContext map = new DefaultMapContext();
>             ReferencedEnvelope envelope = new ReferencedEnvelope(0.0,
> 300.0, 0.0, 600.0, null);
>             map.setAreaOfInterest(envelope);
>             map.addLayer(shapefileSource, shpStyle);
>             saveImage(map, "/home/odilon/image.jpg");
>
> Where the saveImage method is the same of the 
> example<http://docs.geotools.org/latest/userguide/library/render/gtrenderer.html#image>and
>  as result I got a blank image.
>
> Thanks in advance.
>
>
> On 22 June 2011 08:55, Gustavo Mesquita <[email protected]>wrote:
>
>> No I did not. I only used the method  'Envelope fixAspectRatio (Rectangle
>> r,
>> Envelope mapArea)' from JMapPane because without this method the image has
>> the same aspect ratio as the image size (the Rectangle object) and this is
>> not good. I needed that image in BufferedImage had the same appearance and
>> aspect shown in JMapPane.
>>
>> Thanks one more time.
>>
>> -----
>> Gustavo Mesquita da Silva.
>> Brazilian Navy Hydrographic Center
>> NiterĂ³i, Rio de Janeiro - Brazil
>> --
>> View this message in context:
>> http://osgeo-org.1803224.n2.nabble.com/Need-to-save-the-JMapPane-content-to-Image-file-tp6495634p6503922.html
>> Sent from the geotools-gt2-users mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> Simplify data backup and recovery for your virtual environment with
>> vRanger.
>> Installation's a snap, and flexible recovery options mean your data is
>> safe,
>> secure and there when you need it. Data protection magic?
>> Nope - It's vRanger. Get your free trial download today.
>> http://p.sf.net/sfu/quest-sfdev2dev
>> _______________________________________________
>> Geotools-gt2-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>
>
>
> --
> Odilon Lima
>



-- 
Odilon Lima
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a 
definitive record of customers, application performance, security 
threats, fraudulent activity and more. Splunk takes this data and makes 
sense of it. Business sense. IT sense. Common sense.. 
http://p.sf.net/sfu/splunk-d2d-c1
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to