Hi list.
I'm trying to learn raster handling with geotools and Java.
I've been looking at the example code  "Image Tiling Application" 
https://docs.geotools.org/latest/userguide/tutorial/coverage/coverage.html
I have a file:
Size is 8123, 12480
Coordinate System is:
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
   ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
Origin = (15.373676860688539,64.534556346504218)
Pixel Size = (0.000419878389258,-0.000187830401707)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  TIFFTAG_XRESOLUTION=300
  TIFFTAG_YRESOLUTION=300
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  15.3736769,  64.5345563) ( 15d22'25.24"E, 64d32' 4.40"N)
Lower Left  (  15.3736769,  62.1904329) ( 15d22'25.24"E, 62d11'25.56"N)
Upper Right (  18.7843490,  64.5345563) ( 18d47' 3.66"E, 64d32' 4.40"N)
Lower Right (  18.7843490,  62.1904329) ( 18d47' 3.66"E, 62d11'25.56"N)
Center      (  17.0790129,  63.3624946) ( 17d 4'44.45"E, 63d21'44.98"N)
Band 1 Block=8123x130 Type=Byte, ColorInterp=Red
  NoData Value=255
Band 2 Block=8123x130 Type=Byte, ColorInterp=Green
  NoData Value=255
Band 3 Block=8123x130 Type=Byte, ColorInterp=Blue
  NoData Value=255

When I try to split the file in 2x2 tiles, there is no problem, but when I try 
to split it in 10x10 tiles I get the following printout and exception (Scale 
=1):
Processing tile at indices i: 0 and j: 0
Processing tile at indices i: 0 and j: 1
Processing tile at indices i: 0 and j: 2
Processing tile at indices i: 0 and j: 3
Processing tile at indices i: 0 and j: 4
Processing tile at indices i: 0 and j: 5
Processing tile at indices i: 0 and j: 6
Processing tile at indices i: 0 and j: 7
Processing tile at indices i: 0 and j: 8
Processing tile at indices i: 0 and j: 9
Exception in thread "AWT-EventQueue-0" 
org.geotools.coverage.processing.EmptyIntersectionException: Crop envelope does 
not intersect in model space
            at 
org.geotools.coverage.processing.operation.Crop.doOperation(Crop.java:407)
            at 
org.geotools.coverage.processing.CoverageProcessor.doOperation(CoverageProcessor.java:583)
            at 
org.geotools.coverage.processing.CoverageProcessor.doOperation(CoverageProcessor.java:606)
            at raster.ImageTiler.cropCoverage(ImageTiler.java:385)
            at raster.ImageTiler.tile(ImageTiler.java:353)
            at raster.ImageTiler.info(ImageTiler.java:246)
            at raster.ImageTiler.access$2(ImageTiler.java:229)
            at raster.ImageTiler$2.mouseReleased(ImageTiler.java:210)
            at 
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
            at java.awt.Component.processMouseEvent(Component.java:6539)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
            at java.awt.Component.processEvent(Component.java:6304)
            at java.awt.Container.processEvent(Container.java:2239)
            at java.awt.Component.dispatchEventImpl(Component.java:4889)
            at java.awt.Container.dispatchEventImpl(Container.java:2297)
            at java.awt.Component.dispatchEvent(Component.java:4711)
            at 
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
            at 
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
            at java.awt.Container.dispatchEventImpl(Container.java:2283)
            at java.awt.Window.dispatchEventImpl(Window.java:2746)
            at java.awt.Component.dispatchEvent(Component.java:4711)
            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
            at java.awt.EventQueue.access$500(EventQueue.java:97)
            at java.awt.EventQueue$3.run(EventQueue.java:709)
            at java.awt.EventQueue$3.run(EventQueue.java:703)
            at java.security.AccessController.doPrivileged(Native Method)
            at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
            at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
            at java.awt.EventQueue$4.run(EventQueue.java:733)
            at java.awt.EventQueue$4.run(EventQueue.java:731)
            at java.security.AccessController.doPrivileged(Native Method)
            at 
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
            at 
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
            at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
            at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
            at 
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
            at 
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Can anyone see what I'm doing wrong?
Kind regards,
Paul
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to