@@ -5,6 +5,7 @@ import geoscript.geom.Point
5
5
import geoscript.layer.Raster
6
6
import geoscript.layer.Renderable
7
7
import geoscript.proj.Projection
8
+ import org.geotools.referencing.operation.projection.MapProjection
8
9
9
10
import javax.imageio.ImageIO
10
11
import java.awt.Color
@@ -53,6 +54,8 @@ class MapCube {
53
54
54
55
void render (List<Renderable > layers , OutputStream out ) {
55
56
57
+ MapProjection . SKIP_SANITY_CHECKS = true
58
+
56
59
BufferedImage image = new BufferedImage (1800 , 1500 , BufferedImage . TYPE_INT_ARGB )
57
60
Graphics2D g2d = image. createGraphics()
58
61
g2d. paint = java.awt.Color . WHITE
@@ -88,8 +91,8 @@ class MapCube {
88
91
[id : " 5" , image : [500 , 940 ], center : new Point (-45 , -90 + 0.1 ), bounds : new Bounds (-180.0 , -45.0 , 180.0 , -90.0 , " EPSG:4326" )]
89
92
]
90
93
91
- cubes . each { java.util.Map cube ->
92
- if (preRaster) {
94
+ if (preRaster) {
95
+ cubes . each { java.util.Map cube ->
93
96
Point center = cube. center
94
97
Projection p = new Projection (" AUTO:97001,9001,${ center.x} ,${ center.y} " )
95
98
Bounds b = cube. bounds. reproject(p)
@@ -106,7 +109,10 @@ class MapCube {
106
109
BufferedImage img = map. renderToImage()
107
110
g2d. drawImage(img, cube. image[0 ], cube. image[1 ], null )
108
111
}
109
- if (drawOutline) {
112
+ }
113
+
114
+ if (drawOutline) {
115
+ cubes. each { java.util.Map cube ->
110
116
g2d. paint = new Color (0 , 0 , 0 )
111
117
g2d. drawRect(cube. image[0 ], cube. image[1 ], 400 , 400 )
112
118
}
@@ -142,6 +148,7 @@ class MapCube {
142
148
ImageIO . write(image, imageType, out)
143
149
out. close()
144
150
151
+ MapProjection . SKIP_SANITY_CHECKS = false
145
152
}
146
153
147
154
protected void drawTab (Graphics2D g , int x , int y , String side , int tab ) {
0 commit comments