Last active
January 4, 2016 09:09
-
-
Save pmauduit/8599714 to your computer and use it in GitHub Desktop.
build.gradle - groovy sample code
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
apply plugin: 'groovy' | |
buildscript { | |
repositories { | |
mavenLocal() | |
maven { | |
url "http://repo.opengeo.org" | |
} | |
} | |
dependencies { | |
classpath ('org.geotools:gt-epsg-hsql:10.4', 'org.geotools:gt-api:10.4', 'com.vividsolutions:jts:1.13') | |
} | |
} | |
import org.geotools.referencing.CRS | |
import org.geotools.geometry.jts.JTS | |
import com.vividsolutions.jts.geom.Coordinate | |
task transform() { | |
def epsg4326 = CRS.decode("EPSG:4326", true) | |
def lv03 = CRS.decode("EPSG:21781") | |
def mathTransform = CRS.findMathTransform(epsg4326, lv03, true) | |
def result = JTS.transform(new Coordinate(7.6626,47.53814), null, mathTransform) | |
println(result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to be launched using gradle: