Hello,

We used Geotools (2.3.0)  in order to perform route calculation. 
Everything works fine with a reasonable number of streets, but when 
trying to use millions of segments, our application cannot start : we 
have not enough memory (i've tried with memory up to 4Gb)!
In order to accomplish route calculation we used classes inside the 
"graph" package, such as graph, node, edge and so on...
Is there some bests practices to follow in order to perform route 
calculation with a tremendous number of streets?

Any help will be welcome!

Thanks in advance,

Sebastien



Milton Jonathan a écrit :
> Hello there
>
> I've been playing around reprojecting imagery and found that everything
> works fine with tiny MrSID files. However, when attempting to read a
> larger file (e.g.,
> ftp://data.massgis.state.ma.us/pub/wave/coqhsid/east/161866.sid), I get
> an "OutOfMemoryError: Direct buffer memory" exception.
>
> The reason is probably because I am trying to read everything into
> memory (using GridCoverageReader.read(null), which by the way is
> deprecated). So, what would be the current suggested way of doing this, 
> so that I simply specify the reprojection operation without having to 
> read everything? I am aware that the Coverage API is going to change, 
> but it would still be good to know how to do things right with the 
> current library available.
>
> My current code goes as follows (using GeoTools version 2.5-RC1):
>
>
> File file = new File("D:\\data\\source.sid");
> File destFile = new File("D:\\data\\dest.tif");
>
> AbstractGridFormat gridFormat =
> (AbstractGridFormat)GridFormatFinder.findFormat(file);
> if (gridFormat instanceof UnknownFormat)
>      throw new FactoryException("Cannot find a reader for file " + file);
>
> GridCoverageReader reader = gridFormat.getReader(file, hints);
> GridCoverage2D coverage = (GridCoverage2D) reader.read(null);
>
> CoordinateReferenceSystem sourceCRS =
> coverage.getCoordinateReferenceSystem();
> CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:4326");
>
> GridCoverage2D coverageTransf = (GridCoverage2D)
> Operations.DEFAULT.resample(coverage, targetCRS);
>
> GeoTiffWriter writer = new GeoTiffWriter(destFile);
> writer.write(coverageTransf, null);
>
>
>
> Thanks!
> Milton
>
>   

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to