Hello!
I do not get a chance to work with raster data much - you should really ask on
the geotools user email list, and check out some of the code examples in the
docs:
My understanding is you have to issue a "Sample" operation if you want to pull
things out pixel by pixel, or provide a byte[] for ImageIO to dump data into?
It looks (to my limited knowledge ) that you are on the right track, perhaps
you need to configure the JAI TileCache to match the large areas you are
reading at a time?
I have CCed the geotools-gt2-users email list for you, but you should join the
list in order to interact more directly.
--
Jody Garnett
On Friday, 16 November 2012 at 5:57 PM, Büchel Damian (buchedam) wrote:
> Dear Mr. Garnett
>
> I'm a student of Information Technology at Zurich University of Applied
> Sciences in Switzerland. We are developing a uDig-Plug-in as a project work.
> This Plug-in should allow to convert GIS-data in order to import it into
> CryTek's CryEngine 3, i.e. to transform GIS-data to a real-time
> 3D-environment.
> Unfortunately, I'm having troubles reading GridCoverages. On the internet, I
> learned that you seem to be a member of the uDig-Development-team, so I
> thought maybe you could help us along...
>
> I'm searching the active uDig-map for all ILayers containing elevation-data
> (well, not exactly, I just take those ILayers resolvable to
> GridCoverage.class and look if gridCoverage.getNumSampleDimensions() is equal
> to 1; is there a way to absolutely determine the type of the GridCoverage?).
> Then I want to read some data out of the ILayer's real data-source. So I
> perform the following:
>
> GridCoverage2D elevationData;
> ILayer layer;
>
> File sourceFile = new File(layer.getID().getPath());
> Set<AbstractGridFormat> formats = GridFormatFinder.findFormats(sourceFile);
> AbstractGridFormat formatToRead = null;
> for(AbstractGridFormat format : formats) {
> if(!(format instanceof GrassCoverageFormat)) {
> formatToRead = format;
> }
> }
> AbstractGridCoverage2DReader reader = formatToRead.getReader(sourceFile);
> elevationData = reader.read(null);
>
> This works so far. I then perform later on the following commands to read
> elevation-data at a certain point:
>
> DirectPosition position = new DirectPosition2D(crs, xPosition, yPosition);
> double data[] = null;
> double altitude = elevationData.evaluate(position, data)[0];
>
> This also works for now. Unfotunately, we are working with large files
> (GeoTIFF's at approx. 780MB). I always need to read a quadratic area, e.g.
> 128m x 128m. And this is where my problem occurs:
> If I'm reading data for an area of up to 1024m x 1024m, everything works just
> fine. The reading process lasts about 1-2 second. But if I want to read an
> area of 2048m x 2048m, which is fourfold the area of 1024m x 1024m, I would
> expect to need maybe up to 10s to read the data.
> Unfortunately, this is not the case. Even for a single row of 2048m, I need
> up to half the time as I need for the whole 1024m x 1024m - tile.
>
> We couldn't yet find an explanation for this behaviour, and since this could
> be a major drawback for our project, we are desperately searching for a
> solution.
> Maybe you could point into the right direction or even help us out.
>
> With kindest regards,
> Damian Büchel
>
>
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users