Created
October 16, 2010 21:02
-
-
Save dwins/630258 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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")) | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See http://groups.google.com/group/geoscript/browse_thread/thread/a57d6c7dd34664e5 for the Style discussion thus far.