Questions tagged [geotools]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
20 views

Unioning a set of intersections [closed]

I'm working with two datasets: a set of precincts and a set of census block groups. The census block groups include water; the precincts don't. I would like to trim the census block groups to get only ...
0
votes
0answers
10 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
29 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: ...
1
vote
1answer
22 views

Creating a program using GeoTools to find if a given point is inside the GeoJSON file

I have this GeoJSON file with the coordinates of neighborhoods in Valencia (Spain). Then I am using GeoTools to load the file and check if a given coordinate is inside the GeoJSON file and if YES ...
1
vote
0answers
30 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
1answer
23 views

Measuring distance between two points using GeoTools java lib?

I am using GeoTools to convert X and Y coordinates into points and get the distance between two points. I know that my coordinates are EPSG:32630 Name:WGS 84 / UTM zone 30N (https://epsg.io/32630). ...
0
votes
1answer
24 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
24 views

Can't get Icon by URL [duplicate]

I want to put barbs on my map and everything is ok for the most maps until such error occurred org.geotools.referencing.factory.DeferredAuthorityFactory disposeBackingStore INFO: Disposing class ...
1
vote
0answers
23 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 ...
0
votes
0answers
23 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.
1
vote
1answer
23 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 ...
0
votes
1answer
56 views

Reduce processing time for large GeoTIFF image

I am trying to process large GeoTIFF images (128 MB) using GeoTIFF reader provided by Geotools library. However the processing time is very high, can anyone suggest how to reduce this time. Normal ...
3
votes
1answer
20 views

Understanding GML structure for validation

I'm failing to convert this GML v3.2 XML and I'm not sure why: <?xml version="1.0" encoding="UTF-8"?> <gml:MultiGeometry xmlns:gml="http://www.opengis.net/gml" srsName=""> <gml:...
1
vote
0answers
32 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' ...
0
votes
0answers
7 views

NullPointerException when using geotools org.geotools.xsd.PullParser? [duplicate]

I am using below code to parse a kml file. I am using geotools 21.0 and org.geotools.xsd.PullParser. I am getting a nullpointerexception on line SimpleFeature simpleFeature = (SimpleFeature) parser....
2
votes
1answer
89 views

Converting from UTM to WGS84 using GeoTools?

I have created a function that reads a shapefile file and I get its geographic coordinates well. This works fine. My problem is that I need those coordinates in wgs84 format (latitude, longitude), but ...
2
votes
1answer
31 views

Find the coordinates of the max n values of a raster layer

I have a Geotiff file which is published as a raster layer in Geoserver. I need to be able to calculate the coordinates of the max n values that are inside a given polygon. I have found a WPS called ...
1
vote
1answer
61 views

How to set the viewport the bounds what I need

I need to get the world map on the screen limited to the bounds like such latlon coordinates as below. Is it possible to convert these geocoordinates to pixels and then to set these pixels to the ...
1
vote
1answer
16 views

I can't add a custom label on the map

I want to add a custom label which would contain param1 on the map. So, I created a datastore from the .csv file, added my custom parameters to the SimpleFeatureTypeBuilder as properties and created a ...
2
votes
1answer
75 views

Drawing geometry with fixed scaling?

I drew the wind barbs on the map based on the coordinates data with the step of 2 degrees. But I am not satisfied with the fact that after the map reprojecting the size of the wind barbs changes. Is ...
1
vote
1answer
42 views

Checking if GPS coordinate is in country polygon

In order to check in which country GPS coordinate is in, I've found this github repo, where there is GeoJSON file for each country. I've loaded the files to geojson.io, and they seem very accurate. ...
3
votes
3answers
70 views

Projection fails when ran with assertions enabled [closed]

The following minimal example runs fine only when assertions are disabled: src/main/kotlin/main.kt: package com.regions import org.geotools.geojson.feature.FeatureJSON import org.geotools.geometry....
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()));...
1
vote
1answer
20 views

Retrieve features from WFS using geotools

I am new to GI systems. I am trying to retrieve features from a WFS using geotools: this is my snippet : String url = "http://geodaten.metropoleruhr.de/poi/poi?request=GetFeature&service=wfs&...
3
votes
1answer
291 views

Which algorithm (Vincenty or Haversine) is used to calculate distance in GeoTools?

I want to use GeoTools library to calculate geographic distance by using GeodeticCalculator (as mentioned in here http://docs.geotools.org/stable/userguide/library/referencing/calculator.html ). Does ...
1
vote
0answers
21 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 ...
3
votes
1answer
156 views

GeoTools CRS transformation for EPSG:5514 to WGS84 does not work

I am using GeoTools to transform geometries from Krovak projection (EPSG:5514) to WGS84. I am following GeoTools library documentation - http://docs.geotools.org/stable/userguide/library/referencing/...
0
votes
1answer
31 views

Labeling Ortolines with GeoTools

I want to add labels with geocoordinates on the grid of the map. I have previously asked you this question and you have shared some code with me (How can I label the coordinate position of the grid ...
2
votes
1answer
70 views

Get nearest feature points from memory

I have a set of features (a few hundreds, can grow to a couple of thousands), which have a latitude and longitude. They are not stored in a database because they change frequently (another system is ...
1
vote
2answers
48 views

Performing rigid translation of polygon using GeoTools Java API?

I've been spending some days trying to find the best way to do a "rigid translate" of a polygon in a certain direction and distance, without much luck. To provide an example, consider translate like ...
1
vote
1answer
27 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
148 views

Creating KMZ/KML files with NetworkLink and Regions in Java?

I have already made KML/KMZ files using org.geotools in Java (see below). But now we have got so large files that I need to cut them into regions and use networkLinks. This is mentioned in https://...
0
votes
0answers
34 views

GeoTools and PostGIS coordinate transformation gets different result [duplicate]

I've got a problem transforming coordinates. The result differs in PostGIS and GeoTools. I want to transform from EPSG:4326 to EPSG:3398. PostGIS: indicia=> select ST_AsText(ST_Transform(...
2
votes
1answer
26 views

Compare two points and conclude direction

Is there a simple method in geotools or JTS to conclude the direction between two geospatial points? I would like to conclude if point A is (north, south, east, west, NW, NE, SW, SE) when compared ...
0
votes
1answer
18 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....
1
vote
2answers
502 views

Reading a GeoJSON via Java GeoTools API issue

I'm trying to read this GeoJSON from this string: { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry":...
1
vote
1answer
48 views

Modifying coordinate values of MultiPolygon using GeoTools?

I can already get the vertex coordinates of the polygon, but I want to modify the coordinates and write it back to the source file. This is part of the code I read the coordinates. try{ while (...
0
votes
0answers
38 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
2answers
45 views

Java GeoTools API: getInteriorPoint does not work on an intersection between Polygon and MultiLineString

I'm working on a Java project using GeoTools API that want to get the interior point getInteriorPoint(), from the geometry coming from an intersection between a Polygon and a MultiLineString. Please ...
0
votes
2answers
33 views

Zoom GeoTools JMapPane to retain data area on resize

By intention, when the JMapPane is resized, the contents of the pane do not change [1]. So, as the application window gets narrower, content from the right-hand side is trimmed off. An alternate ...
0
votes
1answer
36 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/...
2
votes
2answers
35 views

Geotools CQL to OGC filter

I'm trying to convert a CQL filter to OCG. I followed this example: https://blog.ianturton.com/geotools/code/ogc/2015/03/18/Generating-OGC-Filters.html In line with org.geotools.xml.Configuration ...
2
votes
1answer
33 views

Geotiff Mollweide and geotools

I am new to GIS and I want to read population data from a GeoTiff Grid using the java geotools library. The following throws a runtime error GridCoverage2D image = new GeoTiffReader(f); gives ...
2
votes
1answer
58 views

Specifying EPSG transformation method in GeoTools?

I am a software developer who knows a bit about Gis/Geodesy, but I am not an expert so I might misuse terminology somewhat. I have been tasked to extend an app in Java and have a need to transform ...
1
vote
1answer
26 views

GeoTools CRS.findTransform suddenly failing

I have a body of users using an Eclipse RCP-based Java desktop app (32-bit JRE1.7, Windows 7) that uses GeoTools for world/screen projection handling. This morning the app has started failing for ...
2
votes
1answer
34 views

How to control output of Jiffle Processes in GeoTools so to return float 32bit instead o double 64bit

While developing custom map algebra in GeoTools, I adopted Jiffle. (see : Creating custom Operation for encapsulating some map algebra using GeoTools?) This allowed very easy implementation of logic ...
2
votes
1answer
36 views

GeoTools change buffer style

Is it somehow possible to change the buffer style of the build in GeoTools buffer() function? Or is there a User Definded Function for that? I just saw a different buffer function where one could ...
0
votes
1answer
39 views

Creating custom Operation for encapsulating some map algebra using GeoTools?

In GeoTools, I need to perform a one-to-one pixel computation between a bunch of GridCoverage2D. In short: some map algebra. As I understood I can do things like summing values of coverages using: ...
0
votes
1answer
49 views

GeoTools reprojecting SimpleFeatureCollection return invalid datatypes

Hard to wrap the question into a title. I build a custom ReprojectionClass today to transform a whole SimpleFeatureCollection into a different CRS (currently hard coded to EPSG:3857 The ...
2
votes
1answer
113 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 ...