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

learn more… | top users | synonyms

0
votes
1answer
8 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 ...
1
vote
0answers
43 views
+50

Unable to transform from EPSG:3857 to UTM in Geotools

I'm using Geotools to perform some transformations between coordinate reference systems. I created a proof of concept taking data from Google Earth, which uses ESPG:4326, and converting it to UTM. ...
0
votes
0answers
12 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 ...
1
vote
1answer
40 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 ...
2
votes
2answers
25 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
4 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 ...
1
vote
1answer
46 views

Elasticsearch datastore for GeoServer

When searching for a possibility to use an Elasticsearch data store as a data source in GeoServer, I found this inofficial plugin. Its documentation states that you have to clone the Git repository ...
0
votes
0answers
22 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
71 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
41 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
76 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
47 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 ...
1
vote
0answers
32 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 ...
0
votes
0answers
11 views

CRS problems with SwtMapPane

I'm quite new to geotools and I'm trying to get to grips with it. Trying to load some shapefiles (see attachment) into a MapContent which in turn is associated with a SwtMapPane I always get an ...
1
vote
1answer
17 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 ...
0
votes
0answers
28 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"]], ...
1
vote
1answer
43 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
35 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; ...
1
vote
0answers
59 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
59 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
12 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 = ...
0
votes
0answers
103 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 ...
1
vote
0answers
26 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
26 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
45 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
20 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
23 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 ...
0
votes
0answers
43 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 ...
0
votes
0answers
65 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: ...
3
votes
1answer
166 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
64 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 ...
1
vote
1answer
141 views

Create shapefile based on geojson data with geotools (Java)

I'm using Geotools 14.0 for Java and I'm trying to generate shapefile based on data from GeoJSON. Here is my code: try { String url = "geojson.json"; File geojson = new File(url); ...
2
votes
1answer
68 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 ...
0
votes
0answers
39 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 ...
1
vote
1answer
110 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
69 views

Performance Scanning Big Rasters in GeoTIFF Format? [closed]

I am scanning large rasters in GeoTIFF format. The size is around 30GB and there is only one band. I'm using geotools to do that. I did some experiments on scanning the whole raster to find the best ...
0
votes
0answers
75 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
96 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
86 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
22 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
24 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
46 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 ...
0
votes
0answers
28 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
112 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
49 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
75 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"> ...
1
vote
0answers
45 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 = ...
0
votes
1answer
123 views

Java library to compare shape files

I have county shape file & school district shape file. Once each school district file is overlay on county shape file I would like to know how much % of area of school district file covered by ...
10
votes
2answers
235 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 ...
3
votes
1answer
62 views

Add Features from KML to a GeoPackage using GeoTools

Using GeoTools v13.2 I need to add features to a GeoPackage from KML. So far I can get the features in a SimpleFeatureCollection which can be added to the GeoPackage: public void ...