Questions tagged [geotools]

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

111 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
137 views

GeoTools Schema from empty GeoJSON Set

I'm attempting to create a schema for some user-provided input GeoJSON so that I can store this data using PostGIS transactions. I am experiencing a problem with input that is a completely empty ...
1
vote
1answer
29 views

Read Pre defined Style in MapinfoTab File in Geotools

We have open a MapInfoTab File using OGRFeatureSource the file open on map successfully. But one question we have there is a function named GetStyleString in OGRLibrary of Ogr2Ogr but in our OGRSource ...
1
vote
0answers
75 views

Specify data type when writing a GeoTIFF

I'm using org.geotools.gce.geotiff.GeoTiffFormat to write a GeoTIFF. I would like to use Float32 instead the default Float64. I've tried: OutputStream output = ... Hints hints = new Hints(...
1
vote
0answers
100 views

Add a Mapinfo TabFile in Geotools goes wrong [Automatically Converts my Integer values to Byte]

we have read Mapinfo Tab file in Geotools using JniOGRDataStoreFactory, but when we execute filter statement on feature collection it give some vague values so we decide to investigate it and found ...
1
vote
1answer
75 views

Removing same name layers from layer table in geotool?

I am making a geotool application in which I read the data from postgresql database. In this application if i make a buffer on a selected polygon then a buffer is created and buffer layer shown in ...
1
vote
0answers
116 views

StreamingRenderer

I have a problem in my code (Java Geotools). When I draw in my carte map a LineString sometimes when I run my program an errors apears and I don't understand what does it means. Error: avr. 14, ...
1
vote
0answers
599 views

Print a map with Geotools

I want to print a map with a raster image as base-map using Geotools. The problem is that the raster image doesn't take the margins into consideration and starts always at the point (0,0) as you can ...
1
vote
0answers
1k 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 ...
1
vote
0answers
46 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
278 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
133 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 ...
1
vote
0answers
155 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 xmlns="http://www.w3.org/...
1
vote
0answers
294 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 = ...;/...
1
vote
0answers
100 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
0answers
119 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 ...
1
vote
0answers
520 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 ...
1
vote
0answers
278 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 ...
1
vote
0answers
164 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: http://www.schleswig-holstein.de/LVERMGEOSH/DE/Service/Download/Testdaten/...
1
vote
0answers
201 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"); ...
1
vote
0answers
430 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 ...
1
vote
0answers
521 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 ...
1
vote
0answers
201 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 ...
1
vote
0answers
45 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
0answers
42 views

Casting problem at CSWClientDemo of geotoolkit

I tried to test CSWClientDemo of geotoolkit but couldn't succeed. Here is a casting problem: GetRecordsResponseType response = ((JAXBElement<GetRecordsResponseType>) um.unmarshal(is))....
1
vote
0answers
268 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 ...
1
vote
0answers
376 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 ...
1
vote
0answers
574 views

GeoTools: SimpleFeatureCollection to KML error CoordinateReferenceSystem

I want to export a SimpleFeatureCollection (Read from a MySQL DB) to a KML file, here is my code used to read the infos into the console: private void featureCollectionToKML(SimpleFeatureCollection ...
1
vote
0answers
243 views

Csv To Shape Error

I have found a usefull tool to convert csv files into shape files with geotools: http : // docs.geotools.org/latest/userguide/tutorial/feature/csv2shp.html#create-a-shapefile-from-a-featurecollection ...
1
vote
0answers
430 views

How to retrieve latitude/longitude from Tiff with Geotools

I am new to Geotools and I have to work on project which includes a set of tiff image maps. In that I need to get latitude/longitude for a given point. Ex: When mouse click occurs I want to get the ...
1
vote
0answers
694 views

GeoTools example for Shapefile export to already existing PostGIS table

I'm a newbie to GeoTool API, and I'm looking for a way to export the specific shapefile to the specific already existing PostGIS table with GeoTools (the underlying problem I face is that PostGIS ...
1
vote
0answers
96 views

CRS centered on the 180 meridian?

The problem I'm dealing with is the old 180 meridian problem, except I'm not trying to plot or render shapes that cross it, I need to do intersections of lines that cross it. The only spherical ...
1
vote
0answers
565 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 ...
1
vote
0answers
398 views

how to create a shapefile for 2 million points with geotools

I have to create a shapefile with the geotools java library for approx. 2 000 000 points and whatever strategy I apply I seem to run into out of memory exceptions as well as everything running super ...
1
vote
0answers
77 views

Visual edit geographic data with geotools

With JMapFrame I have options for to visualize my geographic datas, but I don´t know how to add tools for to edit this data, equals conventional GIS. It´s possible to do this? att, Augusto
1
vote
1answer
411 views

Get centroid of SimpleFeatures in GeoTools8

I've got some SimpleFeatureCollections and now I want to get the Centroid of every SimpleFeature in the collection. Unfortunally I've only found a centroid method for Geometry. Is there any way to ...
0
votes
0answers
21 views

What is appropriate coordinate transformer for Lambert Azimuthal Equal Area to Google maps in Geotools?

I need to extract the coordinates from the GeoTiff file (that was provided by European Soil Agency for Spain) and display them in Google Maps. For that, I wrote simple Java code public static ...
0
votes
0answers
12 views

GeoTiffReader doesn't close the input stream

While using GeoTiffReader provided by Geotools library I am facing disk space issue, the geoTiffReader tries to cache the image at /private/var/folders location locally. It doesn't clears this memory ...
0
votes
0answers
40 views

BandOffsets.length is wrong!

I am trying to process large GeoTIFF images using GeoTIFF reader provided by Geotools library. However while processing the image getting below error: org.geotools.data.DataSourceException: ...
0
votes
1answer
26 views

The image is not rendering while running the jar file

I have very strange problem with rendering the world map as image with geotools when I run my jar file. At the same time, when I compiling my project inside of the NetBeans IDE everything is Ok. What ...
0
votes
0answers
26 views

Difference between S3GeoTiffReader and GeoTiffReader?

What's the difference between S3GeoTiffReader and GeoTiffReader provided by Geotools library? I need to process a GeoTiff image retrieved from AWS S3 bucket.
0
votes
0answers
10 views

When I try to get the layer using Geotiffreader, I get a black background image

GeoTiffReader geoTiffReader = new GeoTiffReader(filePath); StyleBuilder sb = new StyleBuilder(); GridReaderLayer layer = new GridReaderLayer(geoTiffReader, sb.createStyle(sb.createRasterSymbolizer()));...
0
votes
1answer
24 views

Geotools Runtime error in web application environment?

Eclipse+Maven+Tomcat. I have some Geotools code that runs fine when run as "Java Application". The same code fails when running within a servlet. So it must be an issue with the Jar Loader of geotools....
0
votes
0answers
44 views

KML parser in GeoTools won't parse TimeStamp

.... <Folder> <name>FooName</name> <Placemark id="3"> <description><![CDATA[ Foo HTML stuff ]]></description> <TimeStamp> ...
0
votes
1answer
42 views

GeoTIFF / Geotools / Mollweide / customer projection not recognized

Although I got a hint from Ian, I still have a problem to read a GeoTIFF in Geotools. I ask this as a new question so that I can put all info. The GeoTIFF is from http://cidportal.jrc.ec.europa.eu/...
0
votes
0answers
33 views

epsg_operations.properties

I am trying to include an epsg_operations.properties definition into my Java /Geotools Project. I thought it would be the best solution to include the gsb-File for a GRID-Transformation. So I inserted ...
0
votes
0answers
30 views

How we can get respective WMS layer from a WFS layer?

We need to get the respective WMS layer here, ArcGIS Server WMS layer names do not match to WFS names so name matching doesn't work import org.geotools.data.DataStore; import org.geotools.data.ows....
0
votes
0answers
34 views

Geotools access attribute table on Geoserver

I want to access the attribute table of a SimpleFeatureCollection I have created within a WPS process by clipping it out of a Vectorlayer stored on Geoserver. How can this be done? Is using an ...
0
votes
0answers
42 views

Custom Geotool function that access a GeoServer's Datastore

I'm following this tutorial to implement a custom Geotools function: http://docs.geotools.org/latest/userguide/tutorial/function.html I want to implement a custom Geotools function that should access ...
0
votes
2answers
740 views

Draw a point, line and polygon on map using GeoTools?

I am using geotools v20. I want to allow the users to draw the new features using the mouse to click on the map area to draw new points, lines and polygons. The user should be able to draw a point on ...
0
votes
1answer
90 views

Taking an arbitrary object in Java and creating a shapefile out of it?

Let's say I have a data class in Java that essentially has title geo (WKT String) Other irrelevant metadata I want to create shapefile from lists of these types of objects using something like ...