Skip to content

Commit

Permalink
Fix style recode example
Browse files Browse the repository at this point in the history
  • Loading branch information
jericks committed Jun 1, 2022
1 parent e109729 commit a72066d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/style_recode.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import geoscript.filter.Function
import geoscript.render.Draw
import geoscript.style.*

import javax.imageio.ImageIO

shp = new Shapefile("states.shp")
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')")

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

Draw.drawToImage(shp)
ImageIO.write(Draw.drawToImage(shp), "png", new File("states_recode.png"))

0 comments on commit a72066d

Please sign in to comment.