Questions tagged [java]
An object-oriented cross-platform programming language developed by Sun Microsystems.
897 questions
0
votes
0
answers
14
views
GDAL get vsimem file byte array while using Java binding
i have saved a dataset to PNG file.
file = "/vsimem/output.png"; out_drv.CreateCopy(file, dstile, 0, new String[0]);
then I want to get the file's byte array and save the bytes to a ...
1
vote
1
answer
26
views
Get length in meters of a LineString using GeoTools
In another toolset I have used PostgreSQL to get the distance in meters text:
CREATE OR REPLACE FUNCTION length_text(geometry geometry) RETURNS text AS
$$
SELECT CASE
WHEN ST_IsValid(geometry) ...
1
vote
1
answer
50
views
How we generate a COG with Geotools?
I see there are few test cases to generate a tiled and even a BigTiff GeoTiff in GeoTools repository. E.g.
https://github.com/geotools/geotools/blob/d261ee2eec4022cb847d20aa5223e5a6c37992c7/modules/...
3
votes
1
answer
127
views
Not getting INFO-level messages from org.geotools.util.logging.Logging
As a Java beginner, I've inherited a custom Geoserver extension, running in a Windows environment. The plugin contains logging code like this:
import java.util.logging.Logger;
import org.geotools.util....
0
votes
0
answers
68
views
GML to Geometry parsing issue Java
I am converting GML, that includes wrappers, into Geometry objects. Currently I have converting a Point from the GML to Geometry working but the Line strings and polygons are not being parsed ...
3
votes
1
answer
144
views
Cannot compile code against latest stable GeoTools/GeoServer version
I've previously successfully compiled a GeoServer extension against earlier GeoServer/GeoTools versions, but today, I'm getting some dependency issues (Java newbie here).
I am trying to build for ...
0
votes
0
answers
20
views
GDAL.jni error on JENKINS Maven Build
When building our application in JENKINS Pipeline, it is failing with the error,
java.lang.UnsatisfiedLinkError: org.gdal.gdal.gdalJNI.AllRegister()V
at org.gdal.gdal.gdalJNI.AllRegister(Native Method)...
1
vote
1
answer
167
views
GeoServer Tomcat 302 redirect loop or 500 error after attempted upgrade
I'm upgrading a dev instance of Geoserver 2.22.2 to 2.25.2 which is running under Tomcat 9. I can only reach the instance via HTTP.
If I leave the default <session-config> in place in my webapp'...
0
votes
0
answers
75
views
Issue with Opening Sentinel-1 Product in SNAP: GDAL Data Type Error
I am encountering an error when trying to open a Sentinel-1 product in SNAP (Sentinel Application Platform). The error message is as follows:
I am looking for guidance on how to resolve this issue.
...
-2
votes
1
answer
35
views
Why are my layers not showing up in MapContent?
I'm entering the last few hours to defend my thesis (for college). I have written everything, but a huge problem is happening, why are the Layers not displayed when I add them to the MapContent from ...
-1
votes
1
answer
34
views
Why is my CursorTool not working?
Now I want to draw lines, and I tried the advice from @ianturton, but the extension of CursorTool doesn't work for me. The onMouseClicked method does nothing when the mouse is pressed, I check this by ...
0
votes
1
answer
69
views
GDAL-info with Java bindings not working correctly
When making a gdalinfo call on a drone-photo via the GDAL java-bindings api, the resulting string is sometimes being cut-off prematurely. I.e. the last part of result is missing. However if I run the ...
0
votes
2
answers
99
views
Identify outer wall of the floorplan or building [closed]
For the floor plan of the building with 2 rooms (it can have more as well)
Is there Python or Java library which I can use to identify outer-wall (facade) of the building as polygon (a closed shape ...
0
votes
0
answers
95
views
Creating constrained Delaunay triangulations for polygons
I have a set of polygons, some of them are connected, but most are not. Some of them are convex, some are not.
Now I want to build a navigation mesh based on the polygons, and I find most of the ...
0
votes
1
answer
75
views
How to calculate the shortest geodetic(orthodomic?) distance from a Point to LineString using GeoTools?
First of all, sorry if used wrong terms. I have a LineString on and I need to calculate the shortest distance to it from a Point using java GeoTools library.
I don't need just geometric distance, ...
1
vote
0
answers
77
views
Transforming from one CRS to another in Java
I'm trying to have some code that is able to convert a 3D point from one CRS to another using Java. I want to be able to convert data from a compound CRS to another: for instance, a source CRS based ...
0
votes
2
answers
86
views
Cannot parse OGC WKT2 file
I am trying to parse a OGC WKT 2 string downloaded from https://epsg.io/5822 (shows in the Export - OGC WKT 2 section of the page)
I tried to parse it using geotool's org.geotools.geometry.jts....
0
votes
0
answers
51
views
Can't launch GeoServer on my Mac
Starting my career as a GIS dev, I'm dealing with problems on GeoServer. I have jdk version 1.8.0_402 installed on my MacBook. I'm using Tomcat 10.0.8, the last version launched which supports JDK ...
0
votes
1
answer
41
views
How to discard midpoints or only get borders of polygon
I have a List of LatLng objects that I use to make a polygon to represent a road with a buffer, but sometimes exist returns as next image:
shared typescript implementation:
The points in this area ...
1
vote
1
answer
34
views
Java API for changing Tile Caching settings in GeoServer
I am looking for Java APIs to change the highlighted part in the image in the Tile Caching tab in the configuration of a layer.
This is the tab.
This is the filter function that I am interested in.
...
1
vote
1
answer
109
views
GeoNetwork 4.2.8 and Azure Kubernetes Service catalogue-data not persisting
I am trying to run GeoNetwork 4.2.8 on Azure Kubernetes Service but am experiencing an issue with the catalogue-data not being persisted when the pod is restarted.
In Kubernetes I have created a ...
0
votes
1
answer
142
views
'java' is not recognized as an internal or external command, operable program or batch file
When I open the Windows 10 command line and write "java -version" at the cursor, the response is: java version "1.8.0_391"
Java(TM) SE Runtime Environment (build 1.8.0_391-b13)
...
0
votes
0
answers
87
views
How I can know if a point is inside of polygon from Android using Java
I have an app that use osmdroid and previously I make a polygon that is represented as array of points latlng.
I would like know if a point is inside of my polygon from Java Android. Any option for ...
0
votes
0
answers
169
views
Oracle Spatial operator SDO_ANYINTERACT does not work well
DB:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0
I have a table called GRID_POINT_BOUNDARY and one column I am using SDO_GEOMETRY Oracle Spatial type. ...
0
votes
0
answers
17
views
Maven error compiling GeoServer custom WPS [duplicate]
I'm attempting to build a custom GeoServer WPS plugin using Maven but I'm encountering issues during compilation. I've updated my POM file and added all the required dependencies, including GeoServer ...
0
votes
1
answer
113
views
Maven Dependency Resolution Issue for GeoServer GS:WPS
I am encountering an issue while building a GeoServer wps using Maven, and I could use some guidance.
Error Description:
I am attempting to build a GeoServer wps using Maven (mvn clean install). ...
1
vote
1
answer
92
views
How i can get the intersection of lines in java?
I have two rect lines
Line 1 with coordinate1 and coordinate2
Line 2 with coordinate1 and coordinate2
I need found the intersection of lines.
i tryed using funtions but the result is not real :(
...
0
votes
0
answers
64
views
Add database connection DB2/400 (iSerie / IBM i)
We are finding it difficult to connect to the DB2/400 database, it is the same DB2 for IBM i. Usually we use a Java package called jt400.jar that encompasses the JDBC driver to DB2 for IBM i.
The ...
2
votes
0
answers
197
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
43
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, ...
1
vote
0
answers
75
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
39
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
2
answers
486
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
2
answers
136
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
44
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
157
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
89
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
119
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.
...
2
votes
1
answer
62
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
1k
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
135
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
115
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
58
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
219
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
121
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
94
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
1k
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
316
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
118
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 ...
2
votes
1
answer
238
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 ...