GeoTools is an open source Java library that provides tools for geospatial data.

learn more… | top users | synonyms

4
votes
0answers
346 views

Renaming Columns in Geotools FeatureType

I am attempting to build a simple java program that loads shapefiles into a Postgis 2.0 database. Everything is working out great except that I would like to be able to modify the FeatureType in the ...
4
votes
0answers
323 views

Can GeoTools parse GML CRS definitions?

A kind of branching of this question. Soon I will need to handle GML Coordinate Reference Sysyem definitions in a Java servlet. Links: GML OGC reference. Concrete example. I know that GeoTools ...
3
votes
0answers
145 views

Filtered SimpleFeatureCollection really slow on Map and other operations

I'm working with a shapefile having about 85.000 features. I need to select some of these using a filter and then showing these on a map. Now... If I draw the entire shapefile's features the creation ...
3
votes
0answers
910 views

What is the best way to convert WKT String to GML String

What is the best way to programatically convert WKT String to GML String? Every reasonable library (at best available in some Maven repository) can be used. Till now I came up with this solution ...
3
votes
0answers
320 views

Illegal argument exception while reading tiff image using GeoTools

I am working on a Java swings based GIS application to project my tiff image as maps . But each time I run my application I get Illegal argument: "semiMajorAxis=�" . The tiff images I have are working ...
3
votes
0answers
274 views

Is there a way to create raster by interpolating point values using GeoTools 8.2?

im new in using GeoTools (8.2). I was able to create shp from asc file which contains my data. Now my question is is there a simple way to create (interpolate) a simple shapefile (only points) to ...
3
votes
0answers
277 views

Symbolizer with external GIF image is not rendered pixel-perfect

We want to pinpoint some locations on a map with some external GIF symbolizers. The issue we have is visible in the attached image*: looks like somethings happens on a sub-pixel level, so that the ...
3
votes
0answers
142 views

GeoTools, add column in query with CQL

I'm trying to query the database (DataStore) and want to let the datastore calculate a value for me. In SQL I would do it like this: SELECT name, ST_Area(ST_Intersection(the_geom, ....) AS myValue ...
3
votes
0answers
333 views

How to get distinct values from multiple columns in GeoTools?

Is there a way to get distinct values from multiple columns in geotools? I know I can get unique values from a column like this: SimpleFeatureSource featureSource = ...
2
votes
0answers
38 views

GridCoverage2DReader not reading 16 bit grayscale?

I have a geotiff that has 16-bit gray scale pixels and GridCoverage2DReader instance only returns the nodata value. Yet both QGIS and uDig show the image and I see WGS 84 and EPSG:4326 for the geotiff ...
2
votes
0answers
48 views

What are the geotiff limitations of geotools?

I'm trying to process globcover, which is a .tif file of 374mb. Running the following code: File tiffFile = new File("C:\\Users\\CAA\\Desktop\\test.tif"); GeoTiffReader reader = new ...
2
votes
0answers
782 views

GeoTools - Find distance in meters between point and path in lat/lon

I need to find distance in meters between some point with given latitude and longitude and line (on Earth) defined by several points with lat/lon coordinates. I read this questions: first second ...
2
votes
0answers
274 views

How to prevent an IllegalArgumentException with GeoTools WFS GetFeature request?

I want to retrieve the feature Collection from a WFS server with the java library GeoTools. I tried this code, but unfortunately the program fails to execute. public class App { public static void ...
2
votes
0answers
127 views

GeoServer: `org.geotools.process.raster.AffineProcess` could not be instantiated, how to fix?

I have installed GeoServer from OpenGeo Suite 4.1 on a fresh Unbuntu 12.04 following Boundless instructions. Now I wanted to test geoscript-groovy, and installed groovy, geoscript-groovy-1.3.1, ...
2
votes
0answers
89 views

Ortholines in GeoTools

I am using GeoTools 10.7 to generate a map with decorations in my Java application. One of the feature I need in the map is to display ortholines both latitude and longitude. The lines will need to be ...
2
votes
0answers
800 views

Building java based desktop map application using embedded database such as spatialite

I am relatively very new to building GIS based applications and have a very limited understanding in this area. So I need some help in building a java based desktop application which would generate ...
2
votes
0answers
673 views

How to create SLD with inline features and style and add to WMS using GeoTools?

I am trying to create labels with arbitrary values on a WMS map using GeoTools (9.4). I have created a feature type, a feature (in a data store), and a user layer. With that I generated an SLD ...
2
votes
0answers
199 views

What is the relation between geotools and hibernate-spatial ( differences and similarities)

I know that hibernate-sapatial is supposed to be an abstraction for the db . And from what i understand there is some kind of possibillity to do that with geotools? ( to what extent i do not know). ...
2
votes
0answers
400 views

Implement a WFS Server using Geo tools

I need to implement a WFS Server using Geo tools, I have an application developed in Java using a spatial database. I wish to develop a WFS service using GeoTools. As a first step, I am implementing ...
2
votes
0answers
877 views

Geotools, output to kml and convert meters

I have a complex problem. I'm using geotools 10.* I have input data: latitude, longitude (WGS_84), radius in meters, start angle (12 o'clock), end angle (clockwise, i.e. turn to the right). I need ...
2
votes
0answers
202 views

Geotools 8.4 CRS.decode invalid(?) reference to HTTP_URI_OGC

I'm trying to do a simple CRS.decode to lookup a CoordinateReference system: E.g. CoordinateReferenceSystem target_crs = CRS.decode("EPSG:4326"); However this fails with a reference to the ...
2
votes
0answers
630 views

How to open image file saved with JAI in Geotools?

I need to find NDVI and other vegetation indices and then find changes in time with tif images. I've been using Geotools for this. I took 2 tiff images, then using QGIS I changed them to PNG because ...
2
votes
0answers
478 views

create geotiff from shapefiles

I need to colorized geometries from shapefiles and convert them to raster image (geotiff). I tried to use geotools's VectorToRasterProcess and ImageWorker ("d:\gis\tmp\32 27 25 w4.shp" is path to my ...
2
votes
0answers
97 views

MultiPolygon from database

I would like to know how to create an instance of a Multipoint from a PostGIS database.. I do the query , then got the ResultSet named "area" , the column with MultiPolygon attributes is named "geom" ...
2
votes
0answers
151 views

Geotools throws “Cannot encode multilinestring (yet)” while Shape import on Linux

I've encountered a strange platform-dependent SHP import problem. Everything works fine on Windows, shape files are converted fine to database. There is although small little warning: [[ACTIVE] ...
2
votes
0answers
286 views

How to programatically add KML Icons to Placemark generated from SimpleFeatures using GeoTools?

I have successfully generated a set of (unstyled) placemarks in a KML file using the GeoTools framework, and the Encoder class. The file renders fine in Google Earth with standard balloon placemarks. ...
2
votes
0answers
329 views

GeoTiff specs for coordinate transformation definition

I would like to define a GeoTiff coordinate transformation by a set of GCPs only. The intention is to publish the GeoTiff as a coverage in GeoServer. However if I specify tie points only, GeoServer ...
1
vote
0answers
9 views

Load WMS into Map (Geotools)

At the Moment I try to load a WMS-Map into a Java Geotools Project. I followed every Step in the Userguide of Geotools. (here the Link: ...
1
vote
0answers
13 views

StreamingRenderer

I have a problem in my code (Java Geotools). When I draw in my carte map a LineString sometimes when I run my program an errors apears and I don't understand what does it means. Error: avr. 14, ...
1
vote
0answers
11 views

Geotools : Getting currently click layer from MapLayerTable

I've added a MapLayerTable to my application, and I'm loading multiple layers using shape files successfully. Now I would like to select features on the map of the selected layer. For this, I would ...
1
vote
0answers
132 views

GeoTools: Lambert72 to WGS84

I am trying to convert coordinates (and polygons from com.vividsolutions.jts.geom) in Lambert72 (EPSG:31370) to WGS84 (or the other way around). I'm using the org.geotools.referencing CRS and ...
1
vote
0answers
18 views

GeoTools FeatureCollection to Filter (make Filter from a FeatureCollection)

I have a FeatureCollection and I want to make a Filter of them. One way is that I may use FilterFactory#id(Set<Identifier> set) to make a filter. FilterFactory ff = ...
1
vote
0answers
40 views

Create a Geotiff with different colors

I have a geotiff raster image. I have estracted the WritableRaster, the envelope, and the gridsampleDimension I need to create a new geotiff using Geotools. GridCoverageFactory gcf = new ...
1
vote
0answers
70 views

Error on Map Style Tutorial

Trying to follow the Map Style tutorial, as the functionality of changing color of objects selected is one thing I am trying to add to my project. However, after running the code from the tutorial I ...
1
vote
0answers
28 views

Error in: org.geotools.swing.MapLayerTableCellRenderer.getListCellRendererComponent

Getting this error while exporting an shapefile to svg (courtesy to iant): The weird thing is I wasn't getting this error before, but I just suddenly starting getting it after running my application, ...
1
vote
0answers
96 views

Adding rasters with GeoTools

I'm using org.geotools.process.raster.AddCoveragesProcess class, to add two raster's with same resolution and buonding box. I get the following exception java.lang.IllegalArgumentException: Range ...
1
vote
0answers
101 views

How add two coverages with different bounding-box and different resolution using geotools

I'm developing a Java application with some spatial analysis operations. One of the operations is to add two coverages. But how can I add two coverages with different bounding-box and different ...
1
vote
0answers
28 views

Wrong shape type

I am from statistics, and I need to do a fast cartogram. But I am getting this error from ScapeToad: Error processing record (a):160 PolygonHandler.read() - got shape type 1610612760 but was ...
1
vote
0answers
42 views

Create compressed GeoTiff in Java

I've got a typical two-dimensional array in Java with values which represent a grid. Rows, columns, coordinate system (latlon), origin and cell size are known. I am able to export this data as ASCII ...
1
vote
0answers
60 views

Addressing a WPS using Geotools' ExecuteProcessRequest

I am trying to address a WPS that is running on a known machine to retrieve some isochrones. Below are excerpts from the relevant parts of the WSDL of said server: <schema ...
1
vote
0answers
66 views

GeoTools How to add attribute to a schema in DataStore

As you know, you can create a schema in a DataStore. For example, you may create a table in a postgresql database like this: SimpleFeatureType schema = ...;// some schema DataStore dataStore = ...
1
vote
0answers
45 views

In Geotools, why does reprojecting the origin of a GridGeometry2D results in off-the-grid coordinates?

I have a simple GridGeometry2D in Geotools 13.1 that is created like this: GridEnvelope grid = new GridEnvelope2D(0, 0, 100, 100); Envelope2D envelope = new Envelope2D(CRS.decode("EPSG:3857"), 10.0, ...
1
vote
0answers
62 views

GeoTools WFS Authentication

I have a connection with basicAuthentication, the getCapabilities and getFeatureStore return me correct data but when i try to commit a transaction I get the next exception: "HTTP response code:401 ...
1
vote
0answers
292 views

How to get geoJSON from spring REST Controller?

I am developing a GIS application with java(Spring-4.1.5 + Hibernate-4.3.8) and OpenLayers. For this project I use GeoTools-13RC, HibernateSptial-4.3, jts-1.13 and jackson-2.5. In this project, I have ...
1
vote
0answers
49 views

Geoserver - How to make a psql-backed timestamp that uses timezones

I'm working on an application that extends geoserver and am frustrated as I'm trying to define a SimpleFeature that has timestamps that include timezones. I've tried declaring my timestamp field ...
1
vote
0answers
200 views

Is geotools transformation of EPSG:3785 (Web mercator) to EPSG:4326 wrong?

Using postgres (9.3.6) and postgis: select st_astext(st_transform(ST_GeomFromEWKT('SRID=3785;POINT( 7550310.77 4139679.02 )'), 4326)); This returns POINT(67.8255956454323 34.8217133646348) Using ...
1
vote
0answers
264 views

GeoTools refresh layers in map

I need update/refresh/repaint the layer on the map when i click on the button refresh. I remove the layer and add it again but it not working and points on the map are not displaying. Is there an ...
1
vote
0answers
113 views

JTS Geometry to GML3.1 encoding

I searched all the internet and I didn't find a solution to my problem. I want to convert a JTS geometry to a GML3.1 geometry. Geo tools says that have support but the have not (please check encode ...
1
vote
0answers
68 views

How to load ALKIS (GML3) data in GeoTools

I wonder how I can load ALKIS GML (German gov geo data) in GeoTools. Here is a small sample dataset from the government: ...
1
vote
0answers
59 views

Disabling XML schema when using GML3 decodeFeatureCollection in GeoTools

I wrote some code based on http://docs.geotools.org/stable/userguide/library/xml/geometry.html#id6 GML gml = new GML(Version.GML3); try { InputStream in = new FileInputStream("file.gml"); ...