geotools

Geotools cannot find HSQL EPSG DB, throws error: NoSuchAuthorityCodeException

女生的网名这么多〃 提交于 2019-12-03 19:58:04
问题 I am running Geotools inside of Apache Storm, and having a heck of a time with geotools dependency management. Every thing works when I run the storm cluster locally (windows 7 laptop), but when I deploy to the cluster I get this exception in my logs. EDIT: Here is the Java I use that calls this functionality GridCoverage2D image = new GeoTiffReader(f).read(new GeneralParameterValue[]{policy, gridsize, useJaiRead}); /** * reproject to WGS84 */ CoordinateReferenceSystem targetCRS = CRS.decode(

java.lang.NoClassDefFoundError: Could not initialize class javax.media.jai.JAI

こ雲淡風輕ζ 提交于 2019-12-01 16:08:34
I recently started my first program with GeoTools in which i was also using JAI- Java Advanced Imaging 1_1_2_01 with JDK 1_7. It worked fine until I added GeoTiff Jars . I found following error Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class javax.media.jai.JAI at org.geotools.gce.geotiff.GeoTiffReader.read(GeoTiffReader.java:607) at com.rgb.PixelExtractor.extract(PixelExtractor.java:55) at com.rgb.RGBSpliter.main(RGBSpliter.java:136) The Code is as below public void extract(File f, String name, String date) throws Exception { ParameterValue<OverviewPolicy

Why can't I resolve the dependencies for GeoTools maven quickstart?

非 Y 不嫁゛ 提交于 2019-12-01 15:09:19
POM is <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.geotools</groupId> <artifactId>tutorial</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>tutorial</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <geotools.version>10-SNAPSHOT</geotools.version> </properties> <dependencies> <dependency>

Why can't I resolve the dependencies for GeoTools maven quickstart?

会有一股神秘感。 提交于 2019-12-01 14:46:32
问题 POM is <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.geotools</groupId> <artifactId>tutorial</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>tutorial</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build

GeoTools介绍、环境安装、读取shp文件并显示

混江龙づ霸主 提交于 2019-11-30 21:14:47
GeoTools是一个开放源代码(LGPL)Java代码库,它提供了符合标准的方法来处理地理空间数据,例如实现地理信息系统(GIS)。GeoTools库实现了开放地理空间联盟(OGC)规范。 Geotools主要提供各种GIS算法,实现各种数据格式的读写和显示。 在显示方面要差一些,只是用Swing实现了地图的简单查看和操作。 用户可以根据Geotools提供的算法自己实现地图的可视化。OpenJump和udig就是基于Geotools的。 目前的大部分开源软件,如udig,geoserver等,对空间数据的处理都是由geotools来做支撑。 web服务,命令行工具和桌面程序都可以由geotools来实现。 是构建在OGC标准之上的,是OGC思想的一种实现。而OGC是国际标准,所以geotools将来必定会成为开源空间数据处理的主要工具, Geotools用到的两个较重要的开源GIS工具包是JTS和GeoAPI。前者主要是实现各种GIS拓扑算法,也是基于GeoAPI的。 Geotools现在还只是基于2D图形的,缺乏对 3D空间数据算法和显示的支持。 Geotools支持的数据格式 arcsde , arcgrid , geotiff , grassraster , gtopo30 , image ( JPEG , TIFF , GIF , PNG ), imageio-ext

Google maps spatial reference system

淺唱寂寞╮ 提交于 2019-11-30 14:11:42
What is Google map's spatial reference system using when you enter a lat, long into the maps search bar? I've found hints that it might be WGS84 but after converting to that coordinate system, nothing shows up when i paste the coordinates into the google maps search box. I am converting from GDA MGA 56. Sample: Input MGA56 coords: 336301, 6253363 Expected WGS86 coords: -33.8473340793201, 151.230631835944 I get: 16834916.928327594 -4008321.1020318186 Spatial coord systems: EPSG:28356 for MGA56 EPSG:900913 for WGS86 (google maps) I am using geotools to do the transform: CoordinateReferenceSystem

Geotools cannot find HSQL EPSG DB, throws error: NoSuchAuthorityCodeException

安稳与你 提交于 2019-11-30 12:54:35
I am running Geotools inside of Apache Storm, and having a heck of a time with geotools dependency management. Every thing works when I run the storm cluster locally (windows 7 laptop), but when I deploy to the cluster I get this exception in my logs. EDIT: Here is the Java I use that calls this functionality GridCoverage2D image = new GeoTiffReader(f).read(new GeneralParameterValue[]{policy, gridsize, useJaiRead}); /** * reproject to WGS84 */ CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:4326"); GridCoverage2D reprojectedImage = (GridCoverage2D) Operations.DEFAULT.resample(image,

insert geospatial datatype( mutipolygon) in mysql with java( jdbc)

半腔热情 提交于 2019-11-29 17:37:11
I am using geotools library to extract the location information. With that I am getting an object of type class com.vividsolutions.jts.geom.MultiPolygon I now want to store this field in my mysql table with a jdbc connection . When I directly try to insert it as pstmtInsert.setObject(4, geoobject) I am getting this error Exception in thread "main" com.mysql.jdbc.MysqlDataTruncation: Data truncation: Cannot get geometry object from data you send to the GEOMETRY field MySql can't know how to store your GEO object, or what is his size. You should not store the object the way you're trying. The

JAVA用geotools读写shape格式文件

流过昼夜 提交于 2019-11-29 05:52:02
转自:http://toplchx.iteye.com/blog/1335007 JAVA用geotools读写shape格式文件 (对应geotools版本:2.7.2) (后面添加对应geotools 10.0版本的写法) 读shape文件。 shape格式文件最少包含3个文件,他们的后缀是:.shp, .dbf, .shx。 .shp存储地理形状和位置信息,.dbf存储属性信息,.shx是索引文件。 单独读取DBF文件 public void readDBF(String path) { Java代码 DbaseFileReader reader = null ; try { reader = new DbaseFileReader( new ShpFiles(path), false , Charset.forName( "GBK" )); DbaseFileHeader header = reader.getHeader(); int numFields = header.getNumFields(); //迭代读取记录 while (reader.hasNext()) { try { Object[] entry = reader.readEntry(); for ( int i= 0 ; i<numFields; i++) { String title =

how to convert between degrees, minutes, seconds to Decimal coordinates

ぃ、小莉子 提交于 2019-11-27 08:22:09
Looking for a java utility. It is even better if you can tell me how to do it using geotools library. By "Decimal coordinates" do you mean latitude and longitude (also known as the decimal degree)? If so, what you're trying to do is pretty easy: Given a DMS (Degrees, Minutes, Seconds) coordinate such as W87°43′41″, it's trivial to convert it to a number of decimal degrees using the following method: Calculate the total number of seconds, 43′41″ = (43*60 + 41) = 2621 seconds. The fractional part is total number of seconds divided by 3600. 2621 / 3600 = ~0.728056 Add fractional degrees to whole