I'm new to GeoTools and as a start I'm trying to display a small (under 10MB) GeoTiff file on a map.
The GeoTiff covers the entire world (it shows average temperature), but the data I would like to display on it is at a much lower level (for example locations of trees in a city park).
I'm using GeoTiffReader to read the tif file which I then add to a GridReaderLayer. The map is displayed using JMapFrame.showMap(map).
When the Swing application opens I can see the map and interact with it without major delays. However as I zoom in more and more, the map becomes slower and slower, until it becomes unusable (eventually the JVM will start using a lot of CPU and memory and crash), but when I zoom out again the map becomes fast again.
I was expecting the performance to get better as I work with smaller and smaller parts of the image, because the system only needs to work with a small subset of data / pixels. Yet it feels like the GeoTools library is scaling up the entire image before cropping it to fit the displayed area, rather than first getting a "crop" of the displayed area (by lat/lon) and then scaling it up to fit the map display.
How can I make the map more responsive when zoomed in?
PS. I don't see any performance impact when I load the same GeoTiff file in a number of different GIS tools. I can even zoom in and show just 4 pixels from the original GeoTiff as 4 huge boxes on the map, something GeoTools can't even get close to doing.
أكثر...
The GeoTiff covers the entire world (it shows average temperature), but the data I would like to display on it is at a much lower level (for example locations of trees in a city park).
I'm using GeoTiffReader to read the tif file which I then add to a GridReaderLayer. The map is displayed using JMapFrame.showMap(map).
When the Swing application opens I can see the map and interact with it without major delays. However as I zoom in more and more, the map becomes slower and slower, until it becomes unusable (eventually the JVM will start using a lot of CPU and memory and crash), but when I zoom out again the map becomes fast again.
I was expecting the performance to get better as I work with smaller and smaller parts of the image, because the system only needs to work with a small subset of data / pixels. Yet it feels like the GeoTools library is scaling up the entire image before cropping it to fit the displayed area, rather than first getting a "crop" of the displayed area (by lat/lon) and then scaling it up to fit the map display.
How can I make the map more responsive when zoomed in?
PS. I don't see any performance impact when I load the same GeoTiff file in a number of different GIS tools. I can even zoom in and show just 4 pixels from the original GeoTiff as 4 huge boxes on the map, something GeoTools can't even get close to doing.
أكثر...