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

learn more… | top users | synonyms

0
votes
1answer
39 views

Geotools filterfactory not found exception

Can anyone help me out of this exception. In a geotools query program i am using Filter filter = CQL.toFilter("CONTAINS(the_geom,POINT(-115.56,67.567))"); and when am running the program using ...
0
votes
0answers
83 views

Saving shapefile using GeoTools?

This is my first time dealing with the GeoTools library and not sure how to troubleshoot the issue. I am trying to save a shape file using the library but I get the following stack trace: ...
1
vote
1answer
200 views

Plot the longitude and latitudes on map using geotools

I am new to geotools and i find bit difficult to plot a point using the latitude and longitude values. can any one help me out to solve my problem. I tried the following code but not helpful.By ...
0
votes
0answers
29 views

geotools shapefile does not support utf-8 for dbf header

I create a ShapefileDataStore to create a new shapefile and call dataStore.createSchema(...) . But it does not work for utf-8 header fields. I checked the geotools source code and realized that it ...
2
votes
2answers
40 views

How to convert bbox when importing GeoTIFF with Geotools?

Here is my code: String EPSG4326 = "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS ...
0
votes
0answers
7 views

geotools-13.5 not writing geometry in shapefile [duplicate]

I am using geotools 13.5 to create shape file and followed guidelines from post : http://docs.geotools.org/stable/tutorials/feature/csv2shp.html Since I am trying to create "Line" feature, I have ...
0
votes
0answers
32 views

Add raster layer or a WMS using geotools - problem to run the jar file from cmd

I am using geotools in order to develop a custom GIS. So, i tried to add a raster layer and a WMS based on the tutorials given by geotools. When i am running the project using the main class in ...
0
votes
2answers
78 views

Image is black and white after multiply by a constant

Below is my code AbstractGridCoverage2DReader reader = null; try { reader = new GeoTiffReader(new File(path1)); Coverage cov1 = reader.read(null ); double[] v1 = new ...
0
votes
1answer
64 views

How to clear JMapFrame with multiple layers

Is there any way to clear a JMapFrame and all of its layers before opening a new file? I currently am running into an error (exception no stack trace) while opening a file with one already open that ...
3
votes
2answers
116 views

Reading Lambert Conformal Conic NetCDF into GeoServer?

I'm working on reading in a NetCDF file into GeoServer and GeoServer has no problem reading it in as a data store, but when I go to publish the layer from the data store I get an error that states ...
1
vote
2answers
162 views

How to get the LineStrings from a MultiLineString

I was wondering if there is a way I can extract the LineStrings from a MultiLinestring object. What I am really trying to do is look into a MultiLineString and see if I have a certain LineString. I ...
4
votes
3answers
3k views

converting/parsing geojson into com.vividsolutions.jts geometry

Does any has any experience with converting string geojson into com.vividsolutions.jts geometry object (point, polygon, etc). Maybe there is some java library I cannot find. Greets!
1
vote
2answers
135 views

Creating a raster file from a shapefile using GeoTools with different colours for different features

The shapefiles that I am processing display information on an operation of a piece of equipment over an area, where the information is stored in steps as polygon features with various attributes and ...
0
votes
0answers
153 views

How to convert world coordinates to screen coordinates (pixels)

I am trying to export and display an SVG file, the exporting works, I even added some custom grouping. However the image is either not displayed at all or not displayed properly (very small and lines ...
2
votes
0answers
46 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 ...
1
vote
1answer
22 views

Comparing Coordinate Reference Systems in GeoTools

This seems like a pretty silly problem. I'm using a Maven build with GeoTools 14.0. All I want is to compare CRSs with flexibility so that it doesn't have to be exactly equal as long as all the ...
1
vote
1answer
93 views

Problem with downloading dependencies gt-epsg-hsql

Few days ago I started training with maven repository on www.geotools.org. Right now I have a problem with downloading dependencies gt-epsg-hsql. My Eclipse tell me that kind of Error "Offline/Missing ...
0
votes
0answers
34 views

Axis order in user Shapefile

I have a shapefile which has the following PRJ GEOGCS["WGS 84", DATUM["World Geodetic System 1984", SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], ...
0
votes
0answers
54 views

Can't read GeometryCollection from Json String with java 8

I've got a problem with geotools and Java 8: since I started working with it, GeometryJSON can't read jts GeometryCollection from a Json String. Here an example: import java.io.ByteArrayInputStream; ...
0
votes
1answer
316 views

overriding showMap

This code is not working as needed. I need just to make a window with addlayer button. import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import ...
1
vote
0answers
115 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 ...
2
votes
1answer
182 views

Java library to break up a big polygon into many parts

I need to break up large polygons like these into smaller manageable pieces that can be stored in my DB. I tried searching for tools to do this and mostly come across using software such as ArcGIS or ...
1
vote
0answers
17 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 = ...
2
votes
1answer
191 views

Bad calculations with Colombian projection (EPSG:3116) in GeoTools?

Solved, reading mail-archive I can understand that there is a conflict between: gt-epsg-wkt-9.2.jar gt-epsg-hsql-9.2.jar I tested removing each one, with 'hsql' I get the same wrong result, but ...
1
vote
0answers
39 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 ...
0
votes
0answers
47 views

Change color of feature by ID (GeoTools)

I am trying to change the color of a specific object, by ID (or another feature). Currently I am able to extract data about an shapefile and display that data. However, I want to be able to change the ...
1
vote
0answers
68 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
26 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, ...
2
votes
0answers
120 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, ...
1
vote
0answers
31 views

Export shapefile layers to svg [closed]

I have an application that exports an SVG after reading in a shapefile (thanks to iant for the exporting bit). You can view the code here: Exporting Shapefile to SVG using Java & GeoTools? What ...
1
vote
0answers
24 views

Casting problem at CSWClientDemo of geotoolkit

I tried to test CSWClientDemo of geotoolkit but couldn't succeed. Here is a casting problem: GetRecordsResponseType response = ((JAXBElement<GetRecordsResponseType>) ...
0
votes
0answers
82 views

GeoTools and JavaFX?

I am using geotools with the swing library in order to develop a GIS application. I would like to ask if there is a possibility to use JavaFX library instead of swing library? Unfortunately, i ...
3
votes
1answer
244 views

Exporting Shapefile to SVG using Java & GeoTools?

I am currently working on how to read in ESRI shapefiles, parse/edit layers and then export out to SVG (Scalable Vector Graphic) file type. I have been using GeoTools primarily for reading/loading ...
3
votes
1answer
88 views

Difference between Envelope and BoundingBox

As you know GeoTools uses OpenGIS declared APIs; BoundingBox and Envelope for example. picture from geotools docs. BoundingBox Represents a two-dimensional envelope. This interface ...
2
votes
1answer
83 views

Small GeoTiff of the world very slow when zoomed in to city level

I'm new to GeoTools and as a start I'm trying to display a small GeoTiff file on a map . The GeoTiff files I'm using are under 10MB (for example a 1MB file at 720x360 pixels) and covers the entire ...
4
votes
0answers
322 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 ...
0
votes
0answers
57 views

Display WMSMapLayer: Failed to connect to the EPSG database - Geotools

i am quite new to the geotools community. I am trying to show a WMSMapLayer, however i get back an error: "org.opengis.referencing.FactoryException: Failed to connect to the EPSG database." Iam ...
2
votes
1answer
213 views

GeoTools JTS: Snap a Point to a polygon (equivalent to PostGis ST_ClosestPoint)

I'm using GeoTools JTS libraries in Java and I want to find the nearest point inside polygon shape to some single target location. This is exactly what in PostGis ST_ClosestPoint does. I found this ...
1
vote
0answers
100 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 ...
0
votes
0answers
92 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 ...
0
votes
0answers
140 views

Calculating intersection between lines with GeoTools (java)

I have ArratList<Segment> (N segments - array size is N) when: public class Segment { Node vertex_1; Node vertex_2; } public class Node { double latitude; double longitude; } ...
1
vote
0answers
27 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
37 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 ...
6
votes
2answers
238 views

Difference between CoordinateSystem and CoordinateReferenceSystem

What is the concept of Coordinate Reference System. You know GeoTools has a FeatureType class having getCoordinateReferenceSystem() function and also a CoordinateReferenceSystem class having ...
0
votes
0answers
43 views

Label rendered with empty features using geotools

I am using geotools to generate some images based on the shapefile data, it works well until I tried to add labels for the line features: the labels are rendred even there is no features in the ...
1
vote
2answers
171 views

How to define a coordinate reference system with rotation in GeoServer?

I am using GeoServer and have a layer in EPSG:900913 ("Google Mercator"). I need to "rotate" the map around certain point (say, 1500000, 7000000) by certain degree (say, 30 degrees clockwise). How ...
1
vote
1answer
62 views

How to pass custom data in GeoJSON point?

I have an application, which creates a GeoJSON stream on the server, which is then rendered on the client (using CesiumJS). GeoJSON is created using GeoTools. I want to pass some custom data to the ...
0
votes
0answers
106 views

GeoServer: Filter Function problem for function if_then_else argument #2 - expected type Object

I'm facing a problem with the GeoServer SLD XML. My XML code is as follows: <Fill> <CssParameter name="fill"> <ogc:Function name="if_then_else"> ...
10
votes
2answers
245 views

Why do I get correct area and intersect area when use wrong projection?

I need to calculate areas and intersection areas for polygons (some real geographical objects like lake, city, country, e.t.c.). Polygons located in California, New Zealand, Russia.Anadyr, Sweden All ...
1
vote
0answers
63 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 = ...