Questions tagged [geotools]

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

109 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
504 views

Cropping a layer to an input raster

I have layers based on GeoTIFF files, provided by GeoServer, that are displayed as overlays over base maps from OpenStreetMaps, Bing, Google via OpenLayers. I want to mask out areas from the GeoTIFF ...
3
votes
0answers
144 views

Java GeoTools read VRT file

I am trying to read a GDAL VRT file. I have included <!-- VRT Format (reader) --> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-...
3
votes
0answers
41 views

Conic projection view transformation

I am building a custom map viewer, part of meteorological production system, using Java language and GeoTools library. I have prepared a custom map renderer, using OpenGL, that allows to display maps ...
3
votes
0answers
35 views

Is there still CoverageStack object in GeoTools?

This is the first time I'm dealing with Geotools 18. I need to work with a GridCoverage Stack object. I saw that there was one in a very old release (until v2.7.4 CoverageStack). Is there a similar ...
3
votes
1answer
111 views

Geotools : Getting currently click layer from MapLayerTable

I've added a MapLayerTable to my application, and I'm loading multiple layers using shape files successfully. Now I would like to select features on the map of the selected layer. For this, I would ...
2
votes
1answer
19 views

Geotools set a style for a map,but not work

I use the example of the official website to load the shpfile file, but the style only works in the frame, it does not work in the jMapPane. public void openShpFile(JMapPane mapPane) throws Exception ...
2
votes
1answer
27 views

GeoTools KML export with Document@name

I've been able to export features as KML using GeoTools. However, I would like to insert a name attribute at the top level (e.g. Document, though a Folder would be fine too). (Example of what I'd like ...
2
votes
0answers
25 views

Save GridCoverage2D to JPG

I am using following code to save a Goverage2D to JPG: File tmpJpgFile = File.createTempFile("temp", ".jpg"); Iterator<ImageWriter> writers = ImageIO.getImageWritersBySuffix("jpg"); ImageWriter ...
2
votes
1answer
139 views

How can I label the coordinate position of the grid coordinate lines

I need to display the coordinates of the grid lines. I saw this article 'Fun with Graticules', which has much common with that I want to do. But I still have a question. How did you create the new ...
2
votes
0answers
84 views

GeoServer's shared DB connection

I have a PostgreSQL/PostGIS table "geometry_table" that has a 1-to-many relation to another table "properties_table", where each geometry has many properties. These properties hold style values of ...
2
votes
1answer
53 views

Adding filter functions in place of a literal expression in GeoTools?

I'm writing some code to use filter functions in geotools. (attName >= replacementFunc() AND title LIKE replacementFunc()) AND attName2 = replacementFunc() In the area that says LIKE I get a ...
2
votes
0answers
216 views

Handling NetCDF with geotools

I'm experimenting about netcdf and how to convert them in a feature collection. My primary tool is geotools ver. 17.2. Moving my very first step was to bring these two dependencies: ... <...
2
votes
0answers
215 views

reading .tif and .tif.aux.xml as a whole using geotools

I have sample.tif, sample.tif.aux.xml, sample.qml files in a directory. The .qml and .xml files contain classification data about .tif file. For example my .xml file is something like this: <...
2
votes
1answer
185 views

Convert Esri ASCII grid raster to WKT polygons efficiently

I need to transform a large number of Esri ASCII grid files to polygonized WKT format, e.g. as CSV. Currently, I use GeoTools with the ArcGrid reader and a polygon extraction process. For parallelism ...
2
votes
0answers
274 views

H2 connection error using Geotools

I am using geotools (v 17.0) to connect to a H2 database (v 1.4.193) table. My h2 maven dependencies: <dependency> <groupId>org.geotools.jdbc</groupId> <artifactId>gt-...
2
votes
0answers
69 views

How to determine the right strategy for WFS requests with Getotools?

I found that the strategy is selected in the determineCorrectStrategy() method in org.geotools.data.wfs.internal.WFSClient. I don't know how reliable the suggestions are for all the strategies but e....
2
votes
0answers
134 views

set bounds for pointLayer based on another layer size

I am creating a simple method for drawing Points on map, and have problem with full extent. I create a new point layer and add it to mapContent, and the problem is that it set bounds somewhere around ...
2
votes
1answer
87 views

Using filters to filter a variable value with GeoTools

I have a Java Swing application which loads a line shapefile and draws a map. I'm using a filter and a rule to filter out the lines in the shapefile where the attribute "traffic" is greater than 500. ...
2
votes
0answers
83 views

GridCoverage2DReader not reading 16 bit grayscale?

I have a geotiff that has 16-bit gray scale pixels and GridCoverage2DReader instance only returns the nodata value. Yet both QGIS and uDig show the image and I see WGS 84 and EPSG:4326 for the geotiff ...
2
votes
0answers
150 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 ...
2
votes
0answers
801 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 ...
2
votes
1answer
1k views

Geotools, output to kml and convert meters

I have a complex problem. I'm using geotools 10.* I have input data: latitude, longitude (WGS_84), radius in meters, start angle (12 o'clock), end angle (clockwise, i.e. turn to the right). I need ...
2
votes
0answers
289 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 Citations....
2
votes
0answers
1k views

How to open image file saved with JAI in Geotools?

I need to find NDVI and other vegetation indices and then find changes in time with tif images. I've been using Geotools for this. I took 2 tiff images, then using QGIS I changed them to PNG because ...
2
votes
0answers
163 views

Geotools throws “Cannot encode multilinestring (yet)” while Shape import on Linux

I've encountered a strange platform-dependent SHP import problem. Everything works fine on Windows, shapefiles are converted fine to database. There is although small little warning: [[ACTIVE] ...
2
votes
0answers
374 views

How to programatically add KML Icons to Placemark generated from SimpleFeatures using GeoTools?

I have successfully generated a set of (unstyled) placemarks in a KML file using the GeoTools framework, and the Encoder class. The file renders fine in Google Earth with standard balloon placemarks. ...
2
votes
0answers
393 views

GeoTiff specs for coordinate transformation definition

I would like to define a GeoTiff coordinate transformation by a set of GCPs only. The intention is to publish the GeoTiff as a coverage in GeoServer. However if I specify tie points only, GeoServer ...
1
vote
0answers
32 views

How to create group of coordinates and check if a coordinate is within the group?

I am looking for a way to relate two or more types of open data from the Valencia Open data portal. This portal offer data like a traffic jam, noise, and air pollution. All these data have coordinates ...
1
vote
0answers
24 views

Getting stripe across tiles without buffering image?

I am new to geotools. I need to get a horizontal stripe of bytes from the image data without buffering the whole image. I've looked at the various envelopes and pretty sure I could use just ...
1
vote
0answers
34 views

Topology Error building polygon

I retrieve a response from the wfs_gnde from BKG in Germany using the following URL and request. http : // sg.geodatenzentrum.de / wfs_gnde <GetFeature version='1.1.0' service='WFS' ...
1
vote
1answer
29 views

Summing mulitple GridCoverage Objects using GeoTools?

I'm working in Java and GeoTools to process some ASCII rasters. At present, I'm trying to get the rasters summed onto one large grid. I've tried a couple of methods but I seem to be having some ...
1
vote
1answer
93 views

Create dynamic circle/polygon from specific lat/long using GeoTools

I have a dataset of lat/long that I would like to match on dynamically generated circle/polygon from specific point with different radius. I have already completed how to match lat/long with custom ...
1
vote
0answers
64 views

Inaccurate results when converting coordinates to EPSG:53004 with geotools and

I am not very well aquainted with geographic data, but I'm working on a student project, where I have to position points from GPS coordinates around Warsaw on a particular shapefile map. It came with ...
1
vote
1answer
49 views

Add geometry line to the map

I'm trying to test the code example on the page http://docs.geotools.org/stable/userguide/tutorial/geometry/geometrycrs.html I copied this example into eclipse Transaction transaction = new ...
1
vote
1answer
49 views

Generate Dbf file according to the modified differenced FeatureCollection

I am working on geotools where I had created a FeatureCollection having the difference of the other two FeatureCollection s. I referred below link for this Comparing two shapefiles(layers) and ...
1
vote
0answers
39 views

Automatic slice of polygon

I have a data source, that sometimes returns geometries which are not properly cleaned e.g. the pink polygon is only 0.02 cm wide and is always on the edge of the whole geometry which consists of the ...
1
vote
0answers
65 views

GeoTools: grid transformation using NTv2Transform - error locating grid file

I'm trying to use GeoTools library to calculate the grid coverage based on NTv2 .gsb file. However, I'm unable to create the instance of NTv2Transform. When I use this piece of code: File gridFile =...
1
vote
1answer
92 views

FilterFactory2 overlaps/intersects

I am creating WPS for measuring area of two overlapping polygons. Its working fine but now I want to implement FilterFactory2 . I am not sure if use Overlap or Intersect method and than, how to feed ...
1
vote
0answers
80 views

Grid shift transformations based on GSD and GDX files (like cs2cs does)

My main goal is to achieve the same conversion as to the following command using geotools. cs2cs -f "%.7f" +init=epsg:23700 +nadgrids=etrs2eov_notowgs.gsb +geoidgrids=geoid_eht2014.gtx +to +init=...
1
vote
1answer
153 views

Speeding up rendering of GeoTiff images

I use the GeoTools API to read and render a compressed JPEG GeoTiff file: AbstractGridFormat format = new GeoTiffFormat(); format.accepts(rasterFile); //this is a bit hacky but does make ...
1
vote
1answer
68 views

CQL to XML with string substitution using geotools?

I have some cql attr > PLACEHOLDER that I want to convert to valid XML using geotools. I have heard of terms like filter functions that can somehow replace the placeholder with a function, but not ...
1
vote
0answers
38 views

Use GeoTools to read WaterML files

I want to read WaterML 2.0 time series. I am totally new to WaterML but I read it rely on GML 3.2. It would be great to use GeoTools to do that, maybe extending the GML classes. Is there some docs or ...
1
vote
0answers
118 views

CQL query from PostGIS using GeoTools

I have a shapefile (points) loaded in PostGIS. What I want to do is execute an ECQL query using geotools filtering points within a certain radius (10 kilometers) from a specific point (user input). ...
1
vote
0answers
109 views

How create String primary key with GeoTools?

I'm developing a gis app with geotools 19-SNAPSHOT. I want to get some gis data from another app. After getting data, save them in local db. Received data has a String primary key as follow: @Id ...
1
vote
0answers
108 views

Geotools quickstart tutorial not displaying map

I am getting started with the Geotools quickstart guide: http://docs.geotools.org/latest/userguide/tutorial/quickstart/eclipse.html I have followed every step but when I run the application I get a ...
1
vote
0answers
99 views

Problem with parseWKT : projection mercator-2SP

1 -CoordinateReferenceSystem crss = CRS.parseWKT("PROJCS[\"Mercator\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\"," + "SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]]," ...
1
vote
1answer
318 views

Cropping GeoTIFF with GeoTools using integer indexes

I know how to crop a raster by providing coordinates in a CRS: Envelope envelope2D = new ReferencedEnvelope(envelopeStartX, envelopeEndX, envelopeStartY, envelopeEndY, obj.targetCRS); GridCoverage2D ...
1
vote
0answers
94 views

Map display issues when exporting to SVG with Geotools

I am using geotools to display a map, convert the map coordinates to screen coordinates, and export it back out as an SVG file. So far everything works fine, however I have run into two issues I could ...
1
vote
0answers
133 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
28 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 ...