This file contains 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 geoscript.layer.Shapefile | |
import geoscript.proj.Projection | |
import geoscript.feature.Field | |
def shp = new Shapefile("test_uk.shp") | |
def out = shp.workspace.create(shp.schema.reproject("EPSG:27700", "test_uk_valid")) | |
out.add(shp.cursor.collect{f -> | |
f.geom = Projection.transform(f.geom, "EPSG:4326", "EPSG:27700") | |
if (!f.geom.isValid()) { | |
f.geom = f.geom.buffer(0) |
This file contains 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 geoscript.layer.* | |
import geoscript.proj.* | |
import geoscript.style.* | |
import geoscript.map.* | |
import geoscript.filter.Function | |
def statesShp = new Shapefile("states.shp") | |
statesShp.style = new Style([ | |
new PolygonSymbolizer( |
This file contains 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 geoscript.geom.Bounds | |
import geoscript.map.Map | |
import geoscript.workspace.Directory | |
import geoscript.style.* | |
import geoscript.filter.Function | |
def dir = new Directory("/Users/jericks/Downloads/OpenGeo Workshop/data/shp-gs") | |
def layer = dir.get("nyc_buildings") | |
layer.style = new Style([ | |
new PolygonSymbolizer( |
This file contains 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 geoscript.feature.Field | |
import org.geotools.factory.CommonFactoryFinder | |
import org.opengis.filter.expression.Function as GtFunction | |
import org.geotools.filter.FunctionImpl | |
import org.opengis.filter.expression.Expression | |
/** | |
* A GeoScript Function either wraps an existing GeoTools Function or | |
* can easily create a new Function by passing in a Closure. | |
* @author Jared Erickson |
NewerOlder