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?
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 ...
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
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
46 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
16 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 ...
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
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"); ...
2
votes
1answer
78 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 ...
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 ...
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 ...
4
votes
2answers
120 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 ...
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 ...
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
99 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
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 ...
0
votes
0answers
82 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 ...
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, ...
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[" ...
2
votes
0answers
40 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, ...
0
votes
0answers
43 views

Exporting a shapefile with geodetic values in geotools

I have collections of polygon features. Each point in a polygon has local cooridantes (x y values) and geodetic Coordinates (latitude and longitude in decimal degree) i can easily export the shape ...
3
votes
1answer
78 views

How to find intersected line is from left or right on another line?

There is a main LineString and its direction is known. I want to find the side of intersected lines to this main line. Example image: Black line is main LineString and red one is intersected ...
0
votes
1answer
25 views

Check if Point belongs to LineString in Geotools

Is there any way to check with Geotools if a point is placed on a LineString. I am trying to retrieve street names of a route obtained from a routing algorithm. The route is displayed in gps ...
0
votes
1answer
90 views

GeoTools exception: failed to connect to EPSG database

I downloaded the GeoTools 11.2 binary and am attempting to get it to run in my Netbeans java application. I tried to run this part of code: ... SimpleFeatureSource source = ...
0
votes
0answers
69 views

Create a point on a map using geotools

public class GeotoolsFxTest extends Application { Group root = new Group(); Group map1 = new Group(); Group map = new Group(); Group texts = new Group(); Scene scene; private double dragBaseX, ...
1
vote
1answer
56 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 ...
3
votes
1answer
356 views

Creating point in shapefile from latitude/longitude using GeoTools?

I m new to geotools and i find bit difficult to plot a point using the latitude and longitude values. can any one heple me out to solve my problem. GeometryFactory geometryFactory = ...
1
vote
0answers
20 views

Projecting all the points from the csv file at (0,0) in a map

I am trying to plot some points on a map using the geotools tutorial (http://docs.geotools.org/stable/tutorials/feature/csv2shp.html). Unexpectedly all the points given in the .csv file are being ...
1
vote
1answer
24 views

GeoTools and image storage / retrieval

Please can someone let me know how I can create a schema (using SimpleFeatureTypeBuilder()), read and write image data? Simple data types (Integer/Float etc) work fine but how do I handle image data?
2
votes
0answers
264 views

How to convert shp to csv

I am trying to convert my shape files to csv through a batch processing in Java using Geotools. The problem is I have more than 500 shape files (point features). The code is working fine for a small ...
3
votes
1answer
457 views

Coordinate conversion (EPSG:3857 to EPSG:4326) using OpenGIS/JTS too slow

I am using the Java based libraries of OpenGIS and JTS to convert coordinates from EPSG:3857 to EPSG:4326 to proceed to compute the distance using the Haversine formula. The distance features in a ...
0
votes
0answers
11 views

How to read *.map file by using geotools api in Java? [duplicate]

How to read *.map file by using geotools api? String filePath ="C:\\CTO-New\\SOCLOMO\\Location\\Map Info FIles\\New folder\\18-july-2014\\1301\\filename"; File file = new File(filePath); ...
1
vote
2answers
139 views

How to convert multiple csv files to shp using Java

I have some 100 CSV files. I want to convert them in shp format using Java. The csv file contains lat long information in WGS84. I can understand it is a batch processing and it is difficult to do in ...