Guest User

Untitled

a guest
Jul 16th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. import geoscript.layer.*
  2. import geoscript.proj.*
  3. import geoscript.style.*
  4. import geoscript.map.*
  5. import geoscript.filter.Function
  6.  
  7. def statesShp = new Shapefile("states.shp")
  8.  
  9. statesShp.style = new Style([
  10. new PolygonSymbolizer(
  11. fillColor: "#E6E6E6",
  12. strokeColor: "#4C4C4C",
  13. strokeWidth: 0.5f
  14. ),
  15. new PointSymbolizer(
  16. geometry: new Function("centroid(the_geom)"),
  17. fillColor: "#66CCff",
  18. strokeColor: "#004080",
  19. size: 6f,
  20. shape: "circle"
  21. ),
  22. new TextSymbolizer(
  23. label: new Function("strToLowerCase(STATE_ABBR)"),
  24. color: "#004080",
  25. fontWeight: "bold"
  26. )
  27. ])
  28.  
  29. def map = new Map(width: 600, height: 400, fixAspectRatio: true)
  30. map.proj = "EPSG:4326"
  31. map.addLayer(statesShp)
  32. map.bounds = statesShp.bounds
  33. map.render(new File("states.png"))
Add Comment
Please, Sign In to add comment