Skip to content

Instantly share code, notes, and snippets.

@dwins
Created October 16, 2010 21:02
Show Gist options
  • Select an option

  • Save dwins/630258 to your computer and use it in GitHub Desktop.

Select an option

Save dwins/630258 to your computer and use it in GitHub Desktop.
import org.geoscript._
import style_new._
import filter.Expression.enrichString
// import enrichString for spiffy "".cql method, otherwise strings are treated as literals
// alternatively: import org.geotools.filter.text.ecql.ECQL.{ toExpression => cql }
// to use cql("")
val states = layer.Shapefile("geoscript/src/test/resources/data/states.shp")
val theme =
Label("STATE_ABBR".cql) and
(Fill("#4DFF4D", opacity=0.7) where "PERSONS < 2e6") and
(Fill("#FF4D4D", opacity=0.7) where "PERSONS >= 2e6 AND PERSONS <4e6") and
(Fill("#4D4DFF", opacity=0.7) where "PERSONS >= 4e6") and
Stroke("black", width="PERSONS/10000000".cql)
val viewport = render.Viewport(states.bounds)
viewport.render(Seq(states -> theme)).writeTo(render.PNG("states.png"))
@dwins
Copy link
Author

dwins commented Oct 16, 2010

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment