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

learn more… | top users | synonyms

1
vote
0answers
9 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
4 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"); ...
0
votes
1answer
28 views

Not able to read Multilinestring and multigeometry with geotool from KML file

We are not able to read Multilinestring tag field from geotools. We are able to read multigeometry but its coordinate we are getting empty. any suggestion or code snippet would really help me. I ...
1
vote
1answer
11 views

How to crop a shapefile using a raster with Geotools?

I'm working on a project for my school for which I need to use Geotools. I need to be able to display a raster file and a shapefile, but the shapefile is way bigger than the raster and I just want to ...
0
votes
1answer
16 views

GeoTools WFS Query sortBy not working for GeoServer WFS

I am using GeoTools to query a GeoServer WFS using the following code: Map connectionParameters = new HashMap(); connectionParameters.put("WFSDataStoreFactory:GET_CAPABILITIES_URL", ...
0
votes
1answer
13 views

Can I put a JMapFrame In my main JFrame?

I use Geotools, I have a main Jframe and i want to put in it a map content(JMapFrame). Is there a way to add JMapFrame in JFrame?
3
votes
1answer
731 views

GeoTools WFS Feature retrieval

I am trying to use geotools to retrieve the list of features served by a WFS. I am following the tutorial provided at http://docs.geotools.org/latest/userguide/library/data/wfs.html. The code that I ...
1
vote
1answer
156 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 ...
2
votes
1answer
31 views

how to find necessary geoserver/geotools maven dependencies for a class?

I am trying to create a Web Processing Service with GeoServer. I used maven following opengeo instructions, and I get an eclipse project with a pom.xml file with dependencies like the following: ...
0
votes
0answers
11 views

How to obtain a `GridCoverage2D` from Geoserver raster layer?

I am learning java programming with geoserver. I see that in geoserver web services if you pick a raster layer as an input parameter (e.g. img1) from the web service builder interface, in the java ...
0
votes
0answers
19 views

How to combine two `GridCoverage2D` to make a new `GridCoverage2D`

I was wondering if there is any GeoTools code example which combines two GridCoverage2D to make a third new GridCoverage2D? I can find examples for reading pixels from GridCoverage2D or writing a ...
0
votes
1answer
121 views

How to add RGBA color map to single band GeoTIFF using GeoTools 2.x?

I am developing a light weight GIS application, and am looking for the simplest way to add an RGBA color map to a single band GeoTIFF using GeoTools 2.x?
4
votes
1answer
5k views

How to draw polygons on an existing map?

If you want a map with some circles, squares, etc. representing cities or something else you can use the following code. Note that you can change the map and the coordinates with yours, and you'll ...
4
votes
1answer
2k views

Convert Gauss-Kruger to UTM

How to covert Gauss-Kruger coordinates to UTM coordinates with GeoTools java library? As I have figured out the location (zone, country) is important. I need the calculation for Slovenia.
2
votes
1answer
153 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 ...
0
votes
0answers
32 views

Check Geometry Type of a Shapefile Using GeoTools?

I want to get the type (point, line, or polygon) of shapefile using GeoTools but so far I haven't found any code. Any other Java library also works for me.
2
votes
0answers
45 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 ...
1
vote
0answers
15 views

combine multiple geojsons

I have several geojsons which contain polygons. But the polygons are reaching over other geojsons. When I import them into lets say Qgis, the polygons, which are distributed among several geojsons are ...
2
votes
1answer
129 views

Displaying coordinate references in GeoTools?

I'm using this library to finish my final project and I have to say I'm no familiar with the maps worlds. My question is if geotools has a method to show automatically the coordinates references in ...
0
votes
0answers
20 views

creating Polygon from LineString and a width

I have to create a Polygon from a lineString and a width. Ex: Given a street as a lineString (Or a list of points) and a width, create the polygon (the road). I am using Geotools, but I couldn't find ...
1
vote
1answer
19 views

How to add a new features to an existing shapefile using Geotools?

I have a shapefile with some points. I would like to add a new points to this shapefile using Geotools.
0
votes
0answers
21 views

Geotools/Geoserver Modifiy interpolate function with dynamic color fill

Here I am again with a different approach to my problem. I use the interpolate function in geoserver to get a choropleth from my data. The problem is that I have to hardcode the color for each value ...
0
votes
0answers
37 views

How can I draw a Line on a Shapefile?

I have a problem, in Java I can draw points on my Shapefile, but I don´t know how to draw a Line. I found the SimpleLineSymbol, but don´t know how to use it further. My first try was ...
4
votes
2answers
350 views

How to read each pixel of each band of a multiband GeoTiff with GeoTools Java

I am new to working with Raster in GeoTools-very experienced in java. My goal is to read in a geotiff that has multiple bands, then create a HashMap for each pixel, where the key is simply the lat/lon ...
2
votes
1answer
77 views

geotools Linestring distance in meters

I want to use geotools for working with gis data. I'm most concerned about distance calculations, not so much about drawing a map. What I still couldn't figure out is how to make distance calculations ...
0
votes
0answers
46 views

FATAL: **password authentication failed for user “Geotools”**

I just add Geotools jar files and used projection packages import org.geotools.geometry.jts.JTS; import org.geotools.referencing.CRS; CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:4326"); ...
1
vote
1answer
65 views

Error Reading ESRI ArcGrid File using GeoTools?

I have a raster file in ESRI ArcGrid format (e.g. hdr.adf). I would like to run some analysis using GeoTools. I've never used the coverage classes before and I'm having a few problems out of the ...
0
votes
0answers
21 views

import org.geotools.referencing.CRS

while working on java serve-lets, I wanted to project a pointset from EPSG:4326 to Mercator projection. But I'm lost on how to get and use the package "import org.geotools.referencing.CRS". My ...
0
votes
0answers
42 views

how apply an SLD to vector layer in geoTools java

I have been using geoTools 11.2 in Java 1.8 to display a vector layer with a desired style of it in worldwind 2.0. I have read features and styles and created objects. I have my own defined vector ...
0
votes
0answers
27 views

Unit of Geotools' getArea function

I have Polygons with WGS84/EPSG:4326 coordinates (like 13.57933804767844,52.5126298984133) and use the Polygon.getArea function to obtain the area of the polygon. But the result I get is something ...
1
vote
1answer
20 views

Trouble in Natural Earth Shapefile “jumps” read using GeoTools

I'm using GeoTools 12.0 to read in Natural Earth data. I'm really happy with the performance, and ease of implementation. But, I'm having trouble reading in very large polygon data. The 110M Ocean ...
1
vote
1answer
46 views

How to split a geotiff into a standard tiling scheme with Geotools in Java

I would like to tile random geotiffs to a standard grid, with a standard size of 256X256 using Geotools in java. My use case is as follows: I receive a "stream" of raster data in the form of multiband ...
2
votes
1answer
176 views

Create image (TIFF/PNG) from geodetic (lat/long) data

Using Java, I need to render a bunch of geodetic data to an image, ideally TIFF or PNG. Specifically this is weather data, with each sample having a latitude, longitude, and amplitude value. I'd like ...
1
vote
0answers
26 views

Geotools WFS basic authentication

I'm trying to retrieve data from remote WFS server which requires basic https authentication using GeoTools. I defined connection parameters for username and password like ...
0
votes
0answers
27 views

Linear interpolation on raster data, save result (geoserver)

I am trying to perform a linear interpolation on a coverage layer (Source data is in EHdr Coverage format, file extension: .flt). Ultimately, I want to use the interpolated layer as input to a WPS ...
3
votes
1answer
228 views

Geotools shapefile and geotiff displaying problem in JMapPane

I'm trying to get a JMapPane to show up in a JPanel, but without success. Below is the JPanel instance containing the map. I am importing a geotiff and a shapefile layered in that order. Not only does ...
4
votes
2answers
119 views

How to create a map and save it to an image with GeoTools

I would like to create a map with GeoTools and save it to an image (e.g. JPEG). My requirements are simple: Create a map of the world with 2 layers: Political boundaries and a graticule. The layers ...
0
votes
1answer
20 views

Use coordinates from Geotools geometry-object to send request to Webserver

I have a polygon as a Geotools Geometry Object. No I want to use the coordinates of the polygon to send a request to a webserver. The webserver demands the coordinates to be in the following format ...
1
vote
0answers
79 views

Why does this Geotools Java reprojection to WGS-84/4326 cause offset?

I am using the block of code below. I am reading in a geotif with a UTM zone projection and converting it to 4326. I am pulling out certain multiband values and creating a new raster, when I plot the ...
0
votes
0answers
33 views

Problems resampling and displaying grid coverages with EPSG 27200 <-> 2193

What is wrong with this code? Given a BufferedImage , a world file and a coordinate system I construct a code coverage as follows: Rectangle actualDim = new Rectangle(0, 0, ...
0
votes
0answers
11 views

How do I get new world file parameters from a resampled grid coverage?

I have a grid coverage that I resample (reproject) and I would like to find out what the new matrix coefficients that would be outputted to a world file. How do I find them?
1
vote
1answer
98 views

Geotools create/save shapefile has no geometry information

When I create and save a shapefile in GeoTools, then open it in ArcGIS or QGIS, it doesn't show up on the map, even though the features are there in the attribute table (and all attributes I added ...
3
votes
1answer
91 views

Creation of tiled grid in JAVA with geotols

I am trying to create a grid using GeoTools in JAVA, covering specyfic area with resolution 50 m (distance between two points). To do so I have two points: the most nortwestern (let's call it NW) and ...
1
vote
1answer
146 views

GeoTools 10 - Convert Raster To Vector

I am fairly green with GeoTools, and having a hard time converting a raster (GridCoverage2D) into a vector format. In the hours I've spent searching this site and Google, there seems to be multiple ...
2
votes
0answers
53 views

how to get a feature from coordinates in geotools [closed]

I'm working on web services in Java and using GeoTools java api for wfs operations. I have a wfs store and a lot of features in it. I do some operations via geotools wfs api for example buffer, ...
0
votes
0answers
81 views

Parsing GML results in empty FeatureCollection

I am issuing a call to a WMS to get feature information. <?xml version="1.0" encoding="UTF-8"?> <wfs:FeatureCollection xmlns="http://www.opengis.net/wfs" ...
2
votes
0answers
67 views

Geotools wfs getFeature

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 ...
0
votes
0answers
85 views

Drawing Line on existant Shapefile in Geotools

I have a shapefile that is opened and looks as such: Now I am attempting to draw a line from two points I click on that map; however the code they give for the QuickStart.java example is ...
2
votes
1answer
92 views

Writing shapefile metadata with geotools

Using GeoTools, I'm able to write features to a shapefile by essentially passing a SimpleFeatureCollection to a ShapefileDataStore. The feature collection provides both a schema and features including ...
3
votes
1answer
57 views

How to set decimal precision in shapefile via javacode

we are using the below code : SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); builder.setName("Location"); String wkt = "GEOGCS[" + "\"GCS_WGS_1984\"," + " DATUM[" ...