Questions tagged [java]
An object-oriented cross-platform programming language developed by Sun Microsystems.
874
questions
2
votes
0
answers
76
views
Format used by GDAL ReadRaster
I'm trying to display a GeoTIFF raster in a Java SWT widget. Here is a sample of the original TIFF file, opened in QGIS:
I'm using GDAL to get the information out of the image, but I'm struggling to ...
0
votes
1
answer
18
views
Java - GeoServer WPS - how to return TIFF file?
I'd like to return a TIFF created with a Java WPS process (this part works fine) but GeoServer seems don't recognize byte[] or File response type as I expected.
If I return a base64 encoded string, ...
2
votes
0
answers
18
views
Geotools coverage warp
I have some small JPEG images that I wish to load as an image mosaic. I have programmatically created JGW files for each JPEG, and the files display correctly in QGIS.
However, the affine transform ...
0
votes
1
answer
22
views
Does Geotools support isobaric and isotherm lines drawing?
Is there any way to draw isobaric and isotherm lines with Geotools? Are there any examples how to do this in the official documentation or not?
0
votes
1
answer
75
views
GeoServer 2.24.0 JavaError at accessing ServerStatus
i recently set up geoserver 2.24.0 with Eclipse Temurin JDK with Hotspot 17.0.8.1+1 (x64) on a newly installed Windows Server 2019 Standard (fully patched).
The installation succeeded without any ...
0
votes
1
answer
16
views
GeoTools - Add new operation with CoverageProcessing
I follow the Coverage/Grid tutorial, and try to create a new Operation to calculate diff between two TIFF files (MNT data). As explained here, it seems possible :
https://docs.geotools.org/latest/...
0
votes
2
answers
40
views
Array: No numbers in 'values', must provide a type
I'm trying to extract the pixel value of the first image of the Modis Aqua chlor_a product but when applying the code I used to do this with the Landsat dataset I'm having an error : Error in map(ID=...
0
votes
1
answer
37
views
Exporting pixel value of a dataset
I'm trying to export the value of a dataset for each pixel.
I made it this way :
var chloa_4kmOnly = chloa_4km.select("Chloa_OC3").clip(geometry)
print(chloa_4kmOnly)
var chloaFeatures = ee....
0
votes
1
answer
38
views
Expected type : List<element> Actual type ; List<Float>
I'm facing an issue while extracting each pixel value of a band:
And here's the code I'm using :
var chloaFeatures = ee.FeatureCollection(ee.List(chloa_4kmOnly
.reduceRegion({
reducer : ee....
0
votes
0
answers
25
views
How to print a map with gridlines and lables with geotools
I have create a map with geotools but the gridlines i don't know how to lable it.
I saw a similar links Print a map with Geotools by @Youssef but did not get the full source code. Here is my code.
1. ...
0
votes
1
answer
33
views
Get the IP address of GeoServer from WPS
I am creating a custom WPS process. The process needs to do WFS and REST requests to the same server (GeoServer). Currently, the client needs to provide the IP and port of the server as a parameter.
...
0
votes
0
answers
25
views
Geoserver WMS breakpoint
I just started developing geoserver extension and i need help about WMS requests.
I want to print hello to the terminal when a WMS request comes. Context of my class:
package org.geoserver.wms.cluster;...
2
votes
1
answer
36
views
Geospatial data quality check and business rules in GeoServer WFS-T
I need to check Geospatial and alpha numeric data quality and check spatial business rules before to update/insert/delete the data.
Actually we have postgis and geoserver deployed and java devloppers ...
1
vote
1
answer
362
views
Solve invalid endian flag value encountered exception on PostGIS and Quarkus
I am trying to run a simple example with PostGIS but I am getting the error:
Caused by: java.lang.NoSuchMethodError: 'void org.hibernate.dialect.PostgreSQL81Dialect.registerColumnType(int, java.lang....
0
votes
0
answers
59
views
How to convert byte array to a shapefile in Java
I have a function that is calculating/creating Isogonic lines for certain area. This function returns array of type byte[]. I would like to convert this array into a shapefile (not single .shp file ...
0
votes
1
answer
48
views
GeoTools error NumericConverterFactory and GeoServer 2.22.2 with Java 17
We've upgraded to GeoServer 2.22.2 (GeoTools 28.2, Java 17, Postgres 12.7 RDS, PostGIS 3.0.3, Tomcat 9.0.10). Everything runs well except that we get a GeoTools error for a WFS request with a Filter ...
0
votes
0
answers
32
views
MaxEnt error java.util.NoSuchElementException
I am new to using MaxEnt (and Java) and after selecting my presence-only data in .csv and my environmental variables in .asc, when I try to run the analysis, I get this error message:
Error reading ...
1
vote
1
answer
95
views
Geotools GeoJSONWriter setEncodeFeatureCollectionCRS not giving any output
I have a very simple Test Class where I try to parse a simple Shapefile (just a few points) to a GeoJson.
public class ShapefileToGeoJSON {
public static void test() throws IOException {
/...
0
votes
0
answers
34
views
Calculate volume of pit with geotools
I have DEM data in .geotif file. I want to calculate volume of pits. In geotools library implemented geotiffreader on 28 version. Can I calculate?
0
votes
0
answers
73
views
A minimalistic Python\Java library for HOSTING WMS content
Colleagues of mine have developed an algorithm that, given a bunch of parameters, outputs a colormap. The initial version was integrated as a QGIS plugin. However now we need to create an ArcGIS ...
0
votes
0
answers
72
views
Draw an area having only a point and distances to the 4 borders
Using Geotools with Swing GUI.
Is it possible to somehow create a shape having only one coordinate (Lat,Lon) and four distances in meters to the borders?
Lets say we have only the "C" point ...
-1
votes
1
answer
716
views
GeoServer Error 500 Javax.servlet.ServletException [closed]
I installed GeoServer 2.22.2 and Java 17 as recommended. I have connected and the admin functions is available, but if I want to acced in the servers status, there is error HTTP ERROR 500 Javax....
0
votes
0
answers
134
views
GeoServer does not display images of layers in layer preview
Problem - no images appear in 'Layer Preview' screens - just the frame.
I have had no previous installation of GeoServer on Windows - so I followed the steps recommended.
First, I installed Java using ...
1
vote
0
answers
47
views
Open zipped shapefiles in Java GDAL [closed]
I have a .zip shapefile containing all the formats (cpg, dbf, prj, shp, shx) and I wanted to access them using GDAL. I've tried:
ogr.RegisterAll();
Driver driver = ogr.GetDriverByName("ESRI ...
1
vote
1
answer
97
views
GeoTools WFS Transaction modifyfeatures problem: WFSException: Invalid value for property the_geom
I'm using GeoTools WFS package to update features in GeoServer. I don't have any problem with updating literal attributes, but when I tried to modify the geometry of features I got the following error ...
1
vote
0
answers
302
views
Expose list of GeoJSON through REST API in a Java Spring Boot project
We need to expose APIs which would list uploaded GeoJSONS at S3 bucket for a particular user.
I plan to take below steps
Storing all GeoJSONs to S3 bucket
As USER logs in
Read his GeoJSONs from S3 ...
0
votes
0
answers
35
views
Error when opening GeoMondrian schema file and using MDX query in GeoMondrian Workbench
I'm having trouble using the GeoMondrian Workbench on my Ubuntu 18.04 LTS system. I've followed the installation instructions and have installed the following:
Oracle Java 8
PostgreSQL 9.5
PostGIS 2....
1
vote
0
answers
105
views
Java GDAL: Permission denied when trying to open an file geodatabase (gdb)
I'm trying to get the layers of a file geodatabase (.gdb), but I'm having problems with permissions. My Java code is like this:
import org.gdal.gdal.gdal;
public static void main(String[] args) {
...
0
votes
0
answers
60
views
GDAL WriteRaster() in JAVA has datatype does not match JAVA datatype problem
I want to convert a 16bit data to 8bit. JAVA does not have unsigned datatype, I want to use short instead of byte to represent 8bit data.
But When I use dataset.WriteRaster() to write data to a ...
1
vote
1
answer
108
views
Geotools unable to transform EPSG:5359 to EPSG:4326 , returns NAN for coordinates
I am using geotools to transform a set of point in chile EPSG:5359 to world EPSG:4326
I am using below code
transform("6884327.77", "447076.76");
static Coordinate transform(...
0
votes
1
answer
212
views
Create a 256x256px tile with Geotools like GeoServer
I have a TIFF file and add it to GeoServer. A WMS request is as follows:
http://localhost:8080/geoserver/Qadir/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png8&...
0
votes
1
answer
157
views
NIR.subtract is not a function?
var image = S2.filterBounds(lago)
.filterDate('2022-07-20', '2022-07-22'); //[1 image]
var RED = image.select('B4');
var NIR = image.select('B8');
var NDVI = NIR.subtract(RED).divide(NIR.add(RED));...
0
votes
0
answers
42
views
Algorithm for breaking polygon into squares [duplicate]
We've got some code in our Java application that breaks up polygons into grids for a bunch of reasons. One is to more efficiently spatially index coastal regions (the bounding box tends to cover the ...
0
votes
0
answers
115
views
Java code to join lines in PostgreSQL : No results were returned by the query
I have a line layer named verlegte_trasse in PostgreSQL that contains a lot of lines. I want to join the lines that are connected and have same value in attribute field 'bemerkung' in a new table ...
0
votes
0
answers
205
views
Using Gdal warp on shapefiles with GDAL Java Bindings
I am trying to write a method in Java that transforms from one CRS to another using GDAL's Java Bindings. Specifically from 3857 to 4326 (and a few others will be common to my use cases).
Here is my ...
0
votes
0
answers
19
views
What shall I do when a negative double cant be stored in the database? [duplicate]
I have read (from a binary file) negative coordinates e.g 34.651248820000035 -11.570042012999878, 34.61672896300007 -11.57831024199993... etc, which I shall store in the PostGis database as e.g. a ...
0
votes
0
answers
26
views
GeoServer Error while trying to start the service: java.security.PrivilegedActionException [duplicate]
I installed Geoserver 2.22.0 on Windows 10 with JAVA SE 11.0.16.1
Everything went well during installation. Then, I started geoserver and I had the following errors in CMD:
Welcome to GeoServer!
...
1
vote
0
answers
44
views
gis2web plugin in QGIS
when i use Leaflet, in gis2web plugin, and select Match project CRS my Open Street Map disappears however when i use OpenLayers option then number from the depth lines disappear (although not all)
...
2
votes
1
answer
293
views
Bulk writing to GeoPackage with GeoTools
I have a hard time figuring out how to write features to a geopackage file with geotools without committing after adding each feature (which makes the writing process unbearably slow).
What I would ...
0
votes
0
answers
83
views
GeoNetwork 4.2.1 (Debian) install : error message
I work on a Linux Debian server. I downloaded the last war file v4.2.1. I pasted it into /var/lib/tomcat9/webapps. I have checked the permissions and i configured the postgresql DB. The GeoNetwork log ...
1
vote
0
answers
134
views
GeoServer GeoWebCache - disk quota subsystem disabled error
Getting this message on my GeoServer (2.13.0):
I'm using OpenJDK Java:
openjdk version "1.8.0_352" OpenJDK Runtime Environment (build 1.8.0_352-8u352-ga-1~18.04-b08) OpenJDK 64-Bit Server ...
1
vote
2
answers
338
views
Read a PNG and JPEG image with world file in Java
I have a program where given an image I want to read the coordinates for each pixel.
I have implemented the code if the given image is a TIFF image and it works fine. The code that gives me the object ...
-2
votes
2
answers
193
views
GeoNetwork 4.2.1 (Debian) : install error message
I'm a newbie with GeoNetwork. I work on a Linux Debian server. I downloaded the last war file v4.2.1. I pasted it into /var/lib/tomcat9/webapps. The GeoNetwork log is below. What could be wrong?
...
1
vote
0
answers
153
views
How to extract segment of LineString depends on given first and last Point
I am finding the Sub Segment on line String
I am having the First and Last point from Longer Line String, trying to extract the sub Line string from longer Line String, where new line string contains ...
0
votes
0
answers
242
views
How to execute ogr2ogr.exe through a java process in Windows 10?
I've tried to run the program ogr2ogr.exe through a java process, the process command executes fine in a cmd-window but not from my java program. The error code I get is:
ERROR 1: PQconnectdb failed.
...
0
votes
0
answers
41
views
Safely fix coordinate precision without causing intersections/gaps between feature collections
This might be a rather broad question because I am not sure if it points to a specific technology or tool.
I am working on a dataset that has mixed precision coordinates and the polygons drawn have ...
0
votes
1
answer
368
views
GeoServer 2.21.1 installation on Windows HTTP 404 error
I am brand new to the world of servers and am trying to set up an open source solution. When I tried to set-up GeoServer it finished it's installation, but I am getting the dreaded "HTTP Status ...
1
vote
1
answer
724
views
Tomcat GeoServer HTTP/2: ERR_HTTP2_PROTOCOL_ERROR
It is stated that Tomcat supports HTTP/2 (see doc).
I have enabled HTTP/2 support in Tomcat 9.0.65 (see doc):
<Connector port="8443" protocol="org.apache.coyote.http11....
2
votes
0
answers
132
views
Read CSV file with geotools library Java [closed]
I found in the geotools documentation this code for reading CSV file and extract geometry
seems not working for me even with the data test they have in the web site.
feature.getDefaultGeometryProperty(...
1
vote
1
answer
756
views
Geotools Transform to new coordinate system not working
I'm trying to convert from EPSG 26191 to WGS, here is the code im using to transform but it still prints for me when I get the SRID as 26191.
CoordinateReferenceSystem sourceCRS = CRS.decode(&...