I did manage to finally overcome the NoSuchFieldException: METER problem.
It was related to fixing library dependencies.  Here is a working build.sbt
for posterity:

name := "wkt-parse"
version := "0.1.0"
scalaVersion := "2.10.6"
crossScalaVersions := Seq("2.11.5", "2.10.5")
organization := "com.example"
licenses := Seq("Apache-2.0" -> url("
http://www.apache.org/licenses/LICENSE-2.0.html";))
scalacOptions ++= Seq(
  "-deprecation",
  "-unchecked",
  "-Yinline-warnings",
  "-language:implicitConversions",
  "-language:reflectiveCalls",
  "-language:higherKinds",
  "-language:postfixOps",
  "-language:existentials",
  "-feature")
publishMavenStyle := true
publishArtifact in Test := false
pomIncludeRepository := { _ => false }

resolvers ++= Seq(
  "java3d" at "http://maven.geotoolkit.org/";,
  "geosolutions" at "http://maven.geo-solutions.it/";,
  "osgeo" at "http://download.osgeo.org/webdav/geotools/";,
  "maven" at "http://central.maven.org/maven2/";
)

libraryDependencies ++= Seq(
  "com.googlecode.efficient-java-matrix-library"  % "ejml"               %
"0.25",
  "net.java.dev.jsr-275"                          % "jsr-275"            %
"1.0-beta-2",
  "org.geotools"                                  % "gt-data"            %
"14.3",
  "org.geotools"                                  % "gt-metadata"        %
"14.3",
  "org.geotools"                                  % "gt-referencing"     %
"14.3",
)



-Justin

On Sat, Jul 30, 2016 at 7:17 AM, Ian Turton <[email protected]> wrote:

> I can't reproduce this in Java (see attached file) - mvn dependency:tree
> gives me the following jars as a requirement against gt-epsg-hsql
>
> [INFO] +- org.geotools:gt-epsg-hsql:jar:16-SNAPSHOT:compile
> [INFO] |  +- org.geotools:gt-referencing:jar:16-SNAPSHOT:compile
> [INFO] |  |  +-
> com.googlecode.efficient-java-matrix-library:core:jar:0.26:compile
> [INFO] |  |  +- org.geotools:gt-metadata:jar:16-SNAPSHOT:compile
> [INFO] |  |  +- jgridshift:jgridshift:jar:1.0:compile
> [INFO] |  |  \- net.sf.geographiclib:GeographicLib-Java:jar:1.44:compile
> [INFO] |  \- org.hsqldb:hsqldb:jar:2.3.0:compile
>
> Note I'm using 16-SNAPSHOT while you don't say which version of GeoTools
> you are using so that might be the issue too.
>
> Ian
>
> On 29 July 2016 at 20:53, Justin Polchlopek <[email protected]>
> wrote:
>
>> Hello!
>>
>> I'm experiencing an odd error that I can find no references to in this
>> mailing list or on the wider web that I hope someone can clear up for me.
>>
>> While attempting to execute the following (in Scala):
>>
>> val wkt = """
>> PROJCS["Albers_Conical_Equal_Area",
>> GEOGCS["NAD83",
>> DATUM["North_American_Datum_1983",
>> SPHEROID["GRS 1980",6378137,298.2572221010002,
>> AUTHORITY["EPSG","7019"]],
>> AUTHORITY["EPSG","6269"]],
>> PRIMEM["Greenwich",0],
>> UNIT["degree",0.0174532925199433],
>> AUTHORITY["EPSG","4269"]],
>> PROJECTION["Albers_Conic_Equal_Area"],
>> PARAMETER["standard_parallel_1",29.5],
>> PARAMETER["standard_parallel_2",45.5],
>> PARAMETER["latitude_of_center",23],
>> PARAMETER["longitude_of_center",-96],
>> PARAMETER["false_easting",0],
>> PARAMETER["false_northing",0],
>> UNIT["metre",1,
>> AUTHORITY["EPSG","9001"]]]
>> """
>> org.geotools.referencing.CRS.parseWKT(wkt)
>>
>> I am encountering the following exception:
>>   java.lang.NoSuchFieldError: METER
>>
>> This is happening in this example, with a different WKT string, and
>> irrespective of the spelling of meter or even the presence of a UNIT field
>> at all.  Is there a solution to this problem?
>>
>> My build.sbt file includes the following library dependencies:
>> libraryDependencies ++= Seq(
>>   "javax.measure"         %% "jsr-275"          % "0.9.2" from "
>> http://central.maven.org/maven2/javax/measure/jsr-275/0.9.2/jsr-275-0.9.2.jar
>> ",
>>   "java3d"                %% "vecmath"          % "1.5.2" from "
>> http://maven.geotoolkit.org/java3d/vecmath/1.5.2/vecmath-1.5.2.jar";,
>>   "org.geotools"          %% "gt-data"          % "14.3",
>>   "org.geotools"          %% "gt-shapefile"     % "14.3",
>>   "org.geotools"          %% "gt-api"           % "14.3",
>>   "org.geotools"          %% "gt-main"          % "14.3",
>>   "org.geotools"          %% "gt-metadata"      % "14.3",
>>   "org.geotools"          %% "gt-opengis"       % "14.3",
>>   "org.geotools"          %% "gt-referencing"   % "14.3",
>>   "org.geotools"          %% "gt-epsg-wkt"      % "14.3"
>> )
>>
>> Any help would be greatly appreciated!
>>
>> Thanks.
>>
>> -Justin
>>
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> GeoTools-GT2-Users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>>
>
>
> --
> Ian Turton
>
------------------------------------------------------------------------------
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to