Skip to content

Commit a72066d

Browse files
committed
Fix style recode example
1 parent e109729 commit a72066d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/style_recode.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import geoscript.filter.Function
33
import geoscript.render.Draw
44
import geoscript.style.*
55

6+
import javax.imageio.ImageIO
7+
68
shp = new Shapefile("states.shp")
79
func = new Function("Recode(SUB_REGION,'N Eng','#6495ED','Mid Atl','#B0C4DE','S Atl','#00FFFF','E N Cen','#9ACD32','E S Cen','#00FA9A','W N Cen','#FFF8DC','W S Cen','#F5DEB3','Mtn','#F4A460','Pacific','#87CEEB')")
810

911
shp.style = new Fill(func) + new Stroke("#999999",0.1) + new Label("STATE_ABBR").point([0.5,0.5])
1012
shp.style.asSLD()
1113

12-
Draw.drawToImage(shp)
14+
ImageIO.write(Draw.drawToImage(shp), "png", new File("states_recode.png"))

0 commit comments

Comments
 (0)