Mike,

I suspect your black screen was caused by recent changes to how
rendering and display threads are handled. I've just tweaked that code
and tested it successfully here with a geotiff file.

The changes have been committed to trunk so if you are building
locally you can get them now. If instead you are working with the
8-SNAPSHOT binaries you will have to wait for the build server to
refresh the jars. It is running at the moment.

Please let me know how you go.

Michael

On 17 August 2011 10:59, Michael Bedward <[email protected]> wrote:
> Hello Mike,
>
> It sounds like I've broken something with the recent changes to the
> swing module (a _lot_ of code has been in flux).
>
> I'll investigate and get back to you here.
>
> Michael
>
>
> On 17 August 2011 06:12, Mike O'Toole <[email protected]> wrote:
>> Thank You Michael,
>>
>> I updated to the latest trunk today and did a mvn clean install. I then 
>> copied the needed jars to my project.
>>
>> I'm using a tif from the USGS National Elevation Dataset as my input. I can 
>> send this to you if needed.
>>
>> Here is the code I'm running. It should be an exact subset from the image 
>> tutorial. Running this produces no errors now. However, I just get a black 
>> image in the JMapFrame.
>>
>> Thank you for your help with this.
>>
>> Mike
>>
>>
>> Code:
>>
>> showRaster(File rasterFile)
>> {
>>        AbstractGridFormat format = GridFormatFinder.findFormat( rasterFile );
>>        reader = format.getReader(rasterFile);
>>
>>        rasterStyle = createGreyscaleStyle(1);
>>
>>        // Set up a MapContent with the two layers
>>        final MapContent map = new MapContent();
>>
>>        Layer rasterLayer = new GridReaderLayer(reader, rasterStyle);
>>        map.addLayer(rasterLayer);
>>
>>        frame = new JMapFrame(map);
>>        frame.setSize(965, 600);
>>        frame.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE);
>>
>>        frame.setVisible(true);
>> }
>>
>> private static Style createGreyscaleStyle(int band)
>>  {
>>        ContrastEnhancement ce = sf.contrastEnhancement(ff.literal(1.0), 
>> ContrastMethod.NORMALIZE);
>>        SelectedChannelType sct = 
>> sf.createSelectedChannelType(String.valueOf(band), ce);
>>
>>        RasterSymbolizer sym = sf.getDefaultRasterSymbolizer();
>>        ChannelSelection sel = sf.channelSelection(sct);
>>        sym.setChannelSelection(sel);
>>
>>        return SLD.wrapSymbolizers(sym);
>> }
>>
>>
>>
>> On Aug 2, 2011, at 6:38 PM, Michael Bedward wrote:
>>
>>> Hi Mike,
>>>
>>> The level of those logging messages was changed to FINE some time ago
>>> so you must be using old jars. However, they don't indicate any error.
>>>
>>> I'd normally recommend that you update to the latest 8.0-SNAPSHOT
>>> where many bugs in the gt-swing module have been fixed recently, but I
>>> realize that's a pain if you can't use Maven and have to download the
>>> jars manually. Failing that, please provide more details about the
>>> relevant parts of your code and the data you are working with.
>>>
>>> Michael
>>>
>>> On 3 August 2011 03:50, Mike O'Toole <[email protected]> wrote:
>>>> Hello,
>>>>
>>>> Thank you everyone for you help. I don't have a JIRA login so I can't add 
>>>> the ticket myself.
>>>>
>>>> I removed the grass binay raster plugin from my path as Simone suggested. 
>>>> Unfortunately because of my strange setup using maven is not a the best 
>>>> option for me. This has forced me to add all the jars manually and remove 
>>>> any in conflict. Removing the grass raster jar fixed my previous error. 
>>>> However,  my JMapFrame gives me a black image. I see the following INFO 
>>>> messages in my console. I have the epsg-hsql jar in my path. The 
>>>> epsg-extesnsion, epsg-postgresql and epsg-wkt jars are not in my path. Any 
>>>> ideas on why this is happening? Thanks!
>>>>
>>>> Mike
>>>>
>>>> 2011-08-02 10:49:38 INFO: Setting the EPSG factory 
>>>> org.geotools.referencing.factory.epsg.DefaultFactory to a 1800000ms 
>>>> timeout (ThreadedEpsgFactory.<init>())
>>>> 2011-08-02 10:49:38 INFO: Setting the EPSG factory 
>>>> org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory to a 
>>>> 1800000ms timeout (ThreadedEpsgFactory.<init>())
>>>> 2011-08-02 10:49:38 INFO: Building new data source for 
>>>> org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory 
>>>> (ThreadedHsqlEpsgFactory.createDataSource())
>>>> 2011-08-02 10:49:38 INFO: Building backing store for 
>>>> org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory 
>>>> (ThreadedHsqlEpsgFactory.createBackingStore())
>>>> 2011-08-02 10:49:39 INFO: Setting the EPSG factory 
>>>> org.geotools.referencing.factory.epsg.DefaultFactory to a 1800000ms 
>>>> timeout (ThreadedEpsgFactory.<init>())
>>>> 2011-08-02 10:49:39 INFO: Setting the EPSG factory 
>>>> org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory to a 
>>>> 1800000ms timeout (ThreadedEpsgFactory.<init>())
>>>> 2011-08-02 10:49:39 INFO: Setting the EPSG factory 
>>>> org.geotools.referencing.factory.epsg.DefaultFactory to a 1800000ms 
>>>> timeout (ThreadedEpsgFactory.<init>())
>>>> 2011-08-02 10:49:39 INFO: Setting the EPSG factory 
>>>> org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory to a 
>>>> 1800000ms timeout (ThreadedEpsgFactory.<init>())
>>>> 2011-08-02 10:49:39 INFO: Setting the EPSG factory 
>>>> org.geotools.referencing.factory.epsg.DefaultFactory to a 1800000ms 
>>>> timeout (ThreadedEpsgFactory.<init>())
>>>> 2011-08-02 10:49:39 INFO: Setting the EPSG factory 
>>>> org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory to a 
>>>> 1800000ms timeout (ThreadedEpsgFactory.<init>())
>>>>
>>>>
>>>> On Aug 2, 2011, at 7:29 AM, andrea antonello wrote:
>>>>
>>>>> Hi Andrea,
>>>>> what you suggest (checking the presence of certain folders/files) is
>>>>> the way to go. I have the code already, I only do not have the time to
>>>>> do it with calm right now.
>>>>> But I will as soon as I am back.
>>>>>
>>>>> Andrea
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Aug 2, 2011 at 2:48 PM, Andrea Aime
>>>>> <[email protected]> wrote:
>>>>>> On Tue, Aug 2, 2011 at 8:18 AM, andrea antonello
>>>>>> <[email protected]> wrote:
>>>>>>> Hi Simone, Mike,
>>>>>>> wasn't aware of that weekness in the plugin.
>>>>>>> Please open a JIra and assign it to me. I am working abroad this week,
>>>>>>> so I probably won't be able to fix it right now.
>>>>>>> It will be the first thing when I am back.
>>>>>>
>>>>>> One common way to recognize a file type is the use of the magic numbers:
>>>>>> http://www.garykessler.net/library/file_sigs.html
>>>>>>
>>>>>> However it seems I can't find one for the grass raster format. But in 
>>>>>> general,
>>>>>> try to open the file header and try to check for an expected binary 
>>>>>> layout,
>>>>>> or something like that. Or maybe for this case it might be worth 
>>>>>> checking the
>>>>>> location of the raster on the file system, it should be located in a 
>>>>>> specific
>>>>>> place in the location directory no?
>>>>>>
>>>>>> Cheers
>>>>>> Andrea
>>>>>>
>>>>>> --
>>>>>> -------------------------------------------------------
>>>>>> Ing. Andrea Aime
>>>>>> GeoSolutions S.A.S.
>>>>>> Tech lead
>>>>>>
>>>>>> Via Poggio alle Viti 1187
>>>>>> 55054  Massarosa (LU)
>>>>>> Italy
>>>>>>
>>>>>> phone: +39 0584 962313
>>>>>> fax:      +39 0584 962313
>>>>>>
>>>>>> http://www.geo-solutions.it
>>>>>> http://geo-solutions.blogspot.com/
>>>>>> http://www.youtube.com/user/GeoSolutionsIT
>>>>>> http://www.linkedin.com/in/andreaaime
>>>>>> http://twitter.com/geowolf
>>>>>>
>>>>>> -------------------------------------------------------
>>>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
>>>> The must-attend event for mobile developers. Connect with experts.
>>>> Get tools for creating Super Apps. See the latest technologies.
>>>> Sessions, hands-on labs, demos & much more. Register early & save!
>>>> http://p.sf.net/sfu/rim-blackberry-1
>>>> _______________________________________________
>>>> Geotools-gt2-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>>>
>>
>>
>

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to