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
package spike;
import org.geotools.referencing.CRS;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
public class ParseCRS {
public static void main(String[] args) throws FactoryException {
String crs = "PROJCS[\"Albers_Conical_Equal_Area\",\n" +
"GEOGCS[\"NAD83\",\n" +
"DATUM[\"North_American_Datum_1983\",\n" +
"SPHEROID[\"GRS 1980\",6378137,298.2572221010002,\n" +
"AUTHORITY[\"EPSG\",\"7019\"]],\n" +
"AUTHORITY[\"EPSG\",\"6269\"]],\n" +
"PRIMEM[\"Greenwich\",0],\n" +
"UNIT[\"degree\",0.0174532925199433],\n" +
"AUTHORITY[\"EPSG\",\"4269\"]],\n" +
"PROJECTION[\"Albers_Conic_Equal_Area\"],\n" +
"PARAMETER[\"standard_parallel_1\",29.5],\n" +
"PARAMETER[\"standard_parallel_2\",45.5],\n" +
"PARAMETER[\"latitude_of_center\",23],\n" +
"PARAMETER[\"longitude_of_center\",-96],\n" +
"PARAMETER[\"false_easting\",0],\n" +
"PARAMETER[\"false_northing\",0],\n" +
"UNIT[\"metre\",1,\n" +
"AUTHORITY[\"EPSG\",\"9001\"]]]\n" +
"";
CoordinateReferenceSystem proj = CRS.parseWKT(crs);
System.out.println(proj);
}
}
------------------------------------------------------------------------------
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users