Questions tagged [geotools]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
31 views

GeoServer - longitude/latitude is out of bounds

We could see the below error from GeoServer when zooming out the map, because the bbox sending request more than the MONGO DB accepted range(-180,-90,180,90). "Query failed with error code 2 and ...
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
35 views

Read M value (CoordinateXYZM) from shapefile with geotools

After successfully writing M values into a shapefile (.shp, only points for now), I now also want to read the generated file and print the full coordinate set (x, y, z and m) using geotools (23-...
1
vote
1answer
29 views

Write M value into shapefile with geotools

I'm using the Java 1.8 library geotools (version "23-SNAPSHOT") to generate a shapefile. Opening the resulting .shp file with QGIS was successfull and I noticed that the gemeotry was apparently ...
1
vote
1answer
24 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
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
38 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: ...
2
votes
1answer
25 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
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
1answer
42 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
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
25 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
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 ...
0
votes
0answers
24 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.
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 ...
0
votes
1answer
61 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
21 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
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' ...
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
100 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
33 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
62 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
17 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
76 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
62 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
73 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
23 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
293 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 ...
2
votes
0answers
27 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
220 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
35 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
86 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
57 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
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
167 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
36 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
30 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
21 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
664 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
50 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
42 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
56 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
34 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
41 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
44 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
35 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
69 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
27 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
36 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 ...