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

learn more… | top users | synonyms

3
votes
1answer
69 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[" ...
3
votes
1answer
89 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 ...
2
votes
1answer
64 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 ...
2
votes
1answer
489 views

Getting DataStore Problem with Geotools

I recently found an issue with Geotools and getting the datastore for a shapefile. If I try: FileDataStore dataStore = FileDataStoreFinder.getDataStore(file); -or- Map connect = new HashMap(); ...
1
vote
1answer
33 views

Geotools geoTiff running slow

I am using following code to display geotiff file. Its only a small file 1,5MB but when I am moving map I have online white screen which gets loaded after I finish moving but it is a bit slow for me. ...
1
vote
1answer
124 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 ...
1
vote
1answer
151 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 ...
1
vote
1answer
70 views

Problem Inserting feature with Geotools WFS

With this tutorial http://docs.codehaus.org/display/GEOTOOLS/Data+Writing When I try to insert a feature try { DataStore geoToolsClient = getGeoToolsClient(); Transaction transaction = new ...
1
vote
1answer
117 views

Can I define a transformation between 2D and 3D in Geotools?

I'm using Geotools, and I need to convert coordinates between 2D and 3D coordinate reference systems. I recognize that there's no universally-correct way to do this: 2D -> 3D means "making up" a Z ...
0
votes
1answer
39 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
155 views

Direct connection from geotools to arcgis 10.3

Is it possible to direcly connect to ESRI 10.3 database using geotools ? I use geotools 13.0 and have ESRI database set up on oracle. Previously I was able to connect to SDE using gt-arcsde-plugin ...
0
votes
1answer
22 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
1answer
60 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
63 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.
0
votes
1answer
173 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?
0
votes
1answer
202 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 ...
-1
votes
1answer
43 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
32 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 ...
0
votes
0answers
26 views

GeoTiff error when building Jar with GeoTools

I'm seeking some help with GeoTools. I've been using it for a school's project, I had almost no problem until now. But now that my project is done, I've tried to build an executable jar with the ...
0
votes
0answers
130 views

Problems with direct connection to ESRI Oracle db for 9.3.1?

I am trying to create a direct connection to ESRI Oracle database for version 9.3.1. When I try to connect I get this error: org.geotools.arcsde.ArcSdeException: Can't create connection to none for ...
0
votes
0answers
23 views

How can I modify the records of geotable and non-geotable in app application with hibernate-spatial and geoTools

I want to develop a GIS application with JAVA. I want to use Spring-4.0.1, and Hibernate-4.3.x. The application’s Database have GeoTable and Non-GeoTable. The records of all tables are modified. I can ...
0
votes
0answers
88 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
64 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
0answers
47 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
0answers
22 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
54 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
0answers
62 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
151 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"); ...
0
votes
0answers
33 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
127 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
94 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 ...
0
votes
0answers
82 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 ...
0
votes
0answers
53 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 ...
0
votes
0answers
88 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
14 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?
0
votes
0answers
151 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" ...
0
votes
0answers
77 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 ...
0
votes
0answers
118 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, ...
0
votes
0answers
122 views

Geotool SwtMapPane draws in view but not in TitleAreDialog

I've written a very basic rcp app to show points and lines in a view. When I tried to move this code to a wizard page, it gave the error below. When I use code that simply loads and displays a ...
0
votes
0answers
36 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 ...
0
votes
0answers
106 views

Calculating scale from tiles using their envelope

I have a few problems I need to solve, and it comes down the the below example. It may be my understanding or the way I am doing it. Can someone please explain why my logic does not work. I am ...
0
votes
0answers
60 views

autocomplete polygon function with geotools

i'm using geotools to develop some GIS features, i don't know how to implement the autocomplete polygon function using Java code. does any one tried to do it before?
0
votes
0answers
194 views

How to make a geo reference image using GeoTool based on a matrix mapped data?

My ultimate objective is to make a geo reference image and make it as a raster layer to overlay the image above my openlayers map. I have a set of geo coordinate data, and each coordinate is assigned ...
0
votes
0answers
180 views

Missing SRS and NoData when writing TIFF rasters in geotools

As I am writing .tif rasters in geotools, the CRS of the written file is not the same of the source (the source raster which I read and processed). My question is : How can I maintain and write .tif ...
0
votes
0answers
142 views

Create shape file with point

I am trying to create a .shp file with Point shapes. I am following this tutorial: http://docs.geotools.org/latest/userguide/tutorial/feature/csv2shp.html I create the project, no syntax error and ...
0
votes
0answers
249 views

How to have polygon labels always display using GeoTools 8?

I'm not able to consistently display labels for polygon features. The label is not displayed, as far as I can tell, unless the polygon is large enough to contain the entire label string. I can ...
0
votes
0answers
350 views

Getting: org.opengis.referencing.NoSuchIdentifierException: No transform for classification “Transverse Mercator Zoned Grid System” with geotools

Using geotools I've been trying to create a referenced envelope after converting/reprojecting from WGS 84 to UTM with specific zones and it seems that either I need to do something with authority ...
0
votes
0answers
81 views

How to load an image to mark the city (instead of point) using GeoTools?

I went through the Image Tutorial in http://docs.geotools.org/stable/tutorials/raster/image.html and was able to load image and get the output. But I need to load the image without use of world file ...
0
votes
0answers
99 views

How to pass in a database created on the fly in code to Quick_Export in arcpy?

So I am trying to programmatically use quick_export through the arcpy package in an arcmap tool, and so I referenced the quick_export tool's dialog box that comes up when it is executing for the ...
-3
votes
0answers
37 views

How to export shapefile as KML file using GeoTools?

I have a shapefile i need to export the shapefile as a *.kml file to fit in Google Maps how can i do with GeoTools. Please help me with at least one simple example or procedure to do that? ...