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

learn more… | top users | synonyms

1
vote
0answers
21 views

How to get geoJSON from spring REST Controller?

I am developing a GIS application with java(Spring-4.1.5 + Hibernate-4.3.8) and OpenLayers. For this project I use GeoTools-13RC, HibernateSptial-4.3, jts-1.13 and jackson-2.5. In this project, I have ...
1
vote
0answers
16 views

How get geoJson layer whit geoTools? [duplicate]

I have a class in java: "MyPoint" Class: @Entity @Table(name="MyPoint") public class MyPoint{ @id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long Id; @Column ...
2
votes
2answers
220 views

Are mixed geometry types allowed in a shapefile?

Does the shapefile support mixed geometry types (ie. point and polygon all in the same file)?
1
vote
1answer
30 views

Unable to read different kind of shape files

I have written the java code to read the shapefile and insert it into the table. But the way I have written code it will accept only a multistring .shp file. It fails for other shapefile geometry ...
1
vote
0answers
12 views

Geoserver - How to make a psql-backed timestamp that uses timezones

I'm working on an application that extends geoserver and am frustrated as I'm trying to define a SimpleFeature that has timestamps that include timezones. I've tried declaring my timestamp field ...
1
vote
0answers
39 views

Is geotools transformation of EPSG:3785 (Web mercator) to EPSG:4326 wrong?

Using postgres (9.3.6) and postgis: select st_astext(st_transform(ST_GeomFromEWKT('SRID=3785;POINT( 7550310.77 4139679.02 )'), 4326)); This returns POINT(67.8255956454323 34.8217133646348) Using ...
0
votes
1answer
15 views

Problem with editing in geotools 13.0

I have a problem with getting the ID of a newly created feature in the shapefile. I have a datasource / datastore that reads and writes to a shapefile. I create a feature, add it to the store and ...
0
votes
0answers
23 views

ClassNotFound Exception: org.postgresql.Driver Using Geotool: gt-imagemosiac-jdbc-x.x.jar

I am a newbie to GIS, coming from a strict MIS background. Anyway, I have been having a little challenge for the past couple of days trying to import tiles and pyramids into my database. Using a ...
0
votes
0answers
28 views

GeoTools refresh layers in map

I need update/refresh/repaint the layer on the map when i click on the button refresh. I remove the layer and add it again but it not working and points on the map are not displaying. Is there an ...
0
votes
1answer
23 views

unable to catch exception in opening a shape file geotoools

I am loading a shapefile where .shx file is missing i am getting the following error. I am unable to catch this exception please help me. error log Could not open the .shx file, continuing ...
1
vote
1answer
55 views

Different definition of EPSG:3857 in GeoTools and QGIS

I want to do some checking if my point lies in any of the polygons defined in shapefile. So, I thought that I will determine CRS from shapefile (created in QGIS), and use it for transformation (where ...
0
votes
0answers
29 views

JTS Geometry to GML3.1 encoding

I searched all the internet and I didn't find a solution to my problem. I want to convert a JTS geometry to a GML3.1 geometry. Geo tools says that have support but the have not (please check encode ...
0
votes
1answer
32 views

GeoServer/GeoTools (backed by Neo4J) or implement it myself?

I’ve been trying to get my head around the best way to build support for some planning processes we need to invent to support an infrastructure build project. Today I’ve got my hands on a load of GB ...
1
vote
0answers
19 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
7 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
40 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
27 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
27 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
19 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
14 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
26 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 ...
3
votes
2answers
96 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
41 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
111 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
25 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
30 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
34 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
74 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
132 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
87 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
23 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
65 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
46 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
24 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
67 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
38 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
52 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
166 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
24 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
42 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
96 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
50 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
204 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
269 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
98 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
90 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
63 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
62 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
44 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, ...