There's probably something messed up in the GeoTIFF metadata.  What does
listgeo (from libgeotiff) say about the file?

-- 
                                        Gary Jackson
                                        [EMAIL PROTECTED]
 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Scott Pezanowski
> Sent: Thursday, October 13, 2005 8:33 AM
> To: [email protected]
> Subject: [Geotools-gt2-users] using the GeoTiff Reader
> 
> Hi,
> 
> 
> 
> I am using the GeoTiffReader. Here is a code snippet from my 
> application:
> 
> 
>         //getting a reader
>         AbstractGridFormat format = new GeoTiffFormat();
> 
>         if (format.accepts(image)) {
>             GridCoverageReader reader = new 
> GeoTiffReader(format, image, null);
>             GridCoverage gc = null;
>             try {
>                 gc = reader.read(null);
>             } catch (IOException ioe) {
>                 System.out.println(ioe.getMessage());
>             }
>              ...
> 
> 
> With this code snippet, I occassionally get the following error:
> 
> 
> 
> 
> 
> exception 
> 
> org.apache.jasper.JasperException: String index out of range: -47
>       
> org.apache.jasper.servlet.JspServletWrapper.service(JspServlet
> Wrapper.java:370)
>       
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet
> .java:291)
>       
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>       
> org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter
> (MonitorFilter.java:362)
> 
> root cause 
> 
> java.lang.StringIndexOutOfBoundsException: String index out of range: 
> -47
>       java.lang.String.substring(String.java:1768)
>       
> org.geotools.gce.geotiff.GeoTiffIIOMetadataAdapter.getTiffAsci
> i(GeoTiffIIOMetadataAdapter.java:1097)
>       
> org.geotools.gce.geotiff.GeoTiffIIOMetadataAdapter.getGeoKey(G
> eoTiffIIOMetadataAdapter.java:771)
>       
> org.geotools.gce.geotiff.GeoTiffException.getMessage(GeoTiffEx
> ception.java:196)
>       
> edu.psu.geovista.gccm.FileUpload.getEmbeddedCoords(FileUpload.
> java:352)
>       
> org.apache.jsp.geoTiffOverlay_jsp._jspService(org.apache.jsp.g
eoTiffOverlay_jsp:73)
>       
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>       
> org.apache.jasper.servlet.JspServletWrapper.service(JspServlet
> Wrapper.java:322)
>       
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet
> .java:291)
>       
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
>       javax.servlet.http.Htt
> pServlet.service(HttpServlet.java:802)
>       
> org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter
> (MonitorFilter.java:362)
> 
> What is unusual is that the error only seems to occur with 
> some GeoTiff Images. Some of the images work and some I get 
> this error. Does anyone know what might be going on here?
> 
> Also, does anyone have any sample code for how I would use 
> the GeoTiffReader if the GeoTiff image that I am using has an 
> asscoiated world file?
> 
> Thanks,
> Scott
> 
> ------------------------------------------------------- This 
> SF.Net email is sponsored by: Power Architecture Resource 
> Center: Free content, downloads, discussions, and more. 
> http://solutions.newsforge.com/ibmarch.tmpl 
> _______________________________________________ 
> Geotools-gt2-users mailing list 
> [email protected] 
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users 
> 



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to