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

learn more… | top users | synonyms

1
vote
0answers
134 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
220 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
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 = ...
0
votes
0answers
171 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
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 ...
0
votes
0answers
50 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
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
33 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
92 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
91 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
277 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
98 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
351 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
91 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
70 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
248 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
86 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 ...
1
vote
0answers
97 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 ...
0
votes
0answers
156 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
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 ...
0
votes
0answers
50 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
203 views

Defining 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
69 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
115 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
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 = ...
0
votes
1answer
194 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
249 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
90 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 ...
1
vote
1answer
79 views

GeoTools Geometries lost when storing features to shapefile [duplicate]

As you know, the geometry column name of schema for saving into a shapefile must be "the_geom". I have a SimpleFeatureCollection with a schema, geometry name of which is not "the_geom"; It is ...
0
votes
0answers
75 views

How to choose a projection for area measurement on building to continental scales?

I have many geographical objects described as polylines, polygons, multipolygons. All objects are in WGS84. Object could be: a building, stadium, park, street, highway, city, state, even country and ...
0
votes
0answers
28 views

Wrong axis order in geotools crs when reading from EPSG:4326 [duplicate]

Map<String,Object> params = ...; // postgis params DataStore dataStore = DataStoreFinder.getDataStore(params); SimpleFeatureCollection collection=...;// collection to save SimpleFeatureType ...
6
votes
2answers
243 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 ...
1
vote
1answer
81 views

GeoTools modify a FeatureType to change its name

I have a featureCollection and I want to save it into PostGIS dataStore. So I'm going to create a database table by geotools. I want to name my table "ali". But I can't rename the schema! DataStore ...
1
vote
1answer
47 views

Null save into Shapefile using geotools

When I convert csv to shp in geotools, I have an error NULL store for first attribute in my shape file. e.g. - want result: POINT(3625.55 3659.25), 2.4, 3.9 Error result: Null, 2.4, 3.9 This is ...
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
2answers
649 views

How to programmatically import a Shapefile into Oracle DB using Java?

What's the best approach to import a user uploaded shapefile into an Oracle DB? The dbf, shx and shp files of the Shapefile come in a ZIP Archive. Currently, we unzip programatically and then parse ...
1
vote
2answers
172 views

GeoTools CRS.getAxisOrder(CRS.getAxisOrder(“EPSG:4326”)) returns EAST_NORTH (LON_LAT)

All is in the title, with GeoTools if I do : AxisOrder order = CRS.getAxisOrder(CRS.getAxisOrder("EPSG:4326")); It returns EAST_NORTH (= LON_LAT), but EPSG:4326 is defined as ordering latitude ...
0
votes
1answer
259 views

GeoTools, convert CRS for Google Maps

I'm trying to use GeoTools to convert coordinates from EPSG:3857 to various CRS, in order to display WMS layers on a Google Map. For example, I want to display a layer in the EPSG:4326 CRS. I have ...
0
votes
1answer
78 views

GeoTools decode FeatureType

Encode: 1- A way of encoding a FeatureType is : SimpleFeatureType TYPE = DataUtilities.createType("Location", "geom:Point,name:String"); GML encode = new GML(Version.GML2); encode.setBaseURL(new ...
0
votes
0answers
70 views

Insensitive case query in Geotools to WFS

I'm trying to make an insensitive case query from Geotools to WFS (Web feature service) datasource,I used FilterFactory2 with the method like(Expression expr, String pattern, String wildcard, String ...
3
votes
1answer
133 views

How do I produce a GeoJSON with 1 point at a certain lon/lat?

I need to create a GeoJSON string, which contains exactly one point at lon/lat 132.159633, 43.350116. I'm trying to use GeoTools 12-RC1 for that. Let's say I have following method, which is supposed ...
2
votes
2answers
118 views

Can I use “Web Map Service Module” and “Web Feature Service Module” of Geoserver in my project?

I'm developing a GIS application with java Spring Framework and GeoTools library. I have some vector layer. I want to get this layers with wms and wfs protocols. I've downloaded geoserver code. It ...
2
votes
2answers
190 views

Using Geotools: How to convert these strange coordinates from a shapefile into regular lat and long?

I use this dataset from the European Union: http://www.eea.europa.eu/data-and-maps/data/administrative-land-accounting-units Opening the shapefile with Java' Geotools, I see coordinates like: ...
0
votes
1answer
106 views

Equidistant Cartesian projection for NYC

I'm working on a project in which I cluster locations in New York City based on their distance. My dataset contains latitude and longitude and thus I'd like to project it to a 2D Cartesian space in ...
3
votes
1answer
526 views

How to create a new shape file from jts geometries?

What I use: Java 1.7, JTS 1.13, geotools.api 14 What I have finished: Creating correct JTS geometries from OSM relations, ways and nodes. What I want to achieve: Create a csv file which contains the ...
1
vote
0answers
63 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 ...