Questions tagged [java]
An object-oriented cross-platform programming language developed by Sun Microsystems.
782
questions
1
vote
1answer
21 views
Accessing shapefiles using Java in OpenShift
I have shapefiles in my resources directory and see them in the jar. After executing my service, the logger in OpenShift shows this: "Read lock: file:/opt/app-root/src/file:/opt/app-root/src/mars-...
0
votes
1answer
24 views
Convert Mapinfo files into KML files, to check if coordinates are inside a polygon
Sorry for my absolute ignorance, I have 1 day of experience in GIS systems (I'm just a Java developer).
Our client did provide us a compressed file with huge .TAB, .MAP, .ID, and .MAP files, and wants ...
0
votes
1answer
9 views
Can not cast class javax.measure.unit.Unit (tec.uom.se.unit.BaseUnit and javax.measure.unit.Unit)
I am having an issue with the below exception being thrown, not sure how to solve it.
Measure distance = .....
Unit<Length> unit = distance.getUnit();
CoordinateReferenceSystem origCRS = CRS....
0
votes
0answers
17 views
Maxent Fatal error: java.lang.ArrayIndexOutOfBoundExceptions: 44
I have come across a fatal error for some of the species I am modeling:
Fatal error: java.lang.ArrayIndexOutOfBoundExceptions: 44 (or other numbers).
The error only occurs when I am selecting "...
0
votes
0answers
16 views
Creating Quadtree/Space Filling Curve Index atop GeoTiFF
I'm a complete beginner in GeoTiFF manipulation. I'd like to get some help in possible Java/Python/Scala project which performs spatial indexing (Quadtree, Space Filling Curves) atop given image(s). I ...
0
votes
0answers
11 views
Place marker on map - GeoTools 25-SNAPSHOT - Java 11 [duplicate]
I am using GeoTools 25-SNAPSHOT in my application. I have displayed a map in my application (raster). Now I want to place a marker (image or simple colored dot) on a map at a specific latitude, ...
-1
votes
1answer
67 views
GeoJSON custom marker for different data sources
I need help how to show markers with two different colors for two different GeoJSON data sources.
Here's first source geojson.php:
{
"type": "FeatureCollection",
"...
1
vote
1answer
47 views
Transform coordinates [duplicate]
I have two shapes, one called bike_stations and another one called quite_streets, both contains geographic information about elements in Madrid, Spain and each one come from two different sources.
The ...
0
votes
0answers
7 views
The Java API bindings: Band.GetActualBlockSize
The Java API bindings are missing Band.GetActualBlockSize: https://gdal.org/java/org/gdal/gdal/Band.html
I have several questions:
Is it possible to reproduce the code for https://gdal.org/api/...
0
votes
1answer
30 views
Maxent can't get past “javalang.ClassCastExeption: [D cannot be cast to [F” error message
I have turned all stones I can think of how to solve this, and it feels like it should be something simple I am missing, but I just can't get Maxent to work.
When Maxent (v.3.4.3) reaches the step &...
2
votes
1answer
23 views
JTS transform leads to strange results
I'm trying to transform a JTS geometry from EPSG 3035 to 4326 with the code attached below. However, when I'm just reading the geometry from a WKT, the results are different from the expected value (...
1
vote
1answer
54 views
How to save/import .shp file data to a PostGIS table in Java
Ok, I've searched and at a loss as to why I cannot find anything on how to save a shapefile to PostGIS with Java. Thought GeoTools might be helpful, but doesn't seem to be there either.
So here's the ...
2
votes
1answer
41 views
Plotting grib file in Java GeoTools
I'm fairly new to Java and GeoTools and I'm trying to plot this grib of meteorological data; I have the code for shapefiles, but I don't know where to go from here:
File file = JFileDataStoreChooser....
1
vote
0answers
38 views
Logarithmic Relationship for Chart in Google Earth Engine?
In the below code, how can I compute logarithmic trendlines? Google Earth Engine just computes linear, exponential and polynomial automatically. In other words I need slope and offset values in ...
1
vote
0answers
46 views
How can I access Scripts in GeoServer [closed]
I am facing a problem while accessing Script menu in GeoServer. I have downloaded a .jar file somewhere from the extensions. I placed it in Webinfo Libraries. When I open GeoServer I can see the ...
0
votes
1answer
38 views
How to extract coordinate from GML File in Java using geotools with STAX
I would like to extract all coordinates from my GML file and convert them in geometry type:
<geometrie>
<gml:MultiCurve srsName="EPSG:3944" srsDimension="3"...
0
votes
0answers
40 views
Spatial indexing of GeoTIFF images (Java Library)
I have a requirement to spatially index each pixel of GeoTIFF images and store them in a scalable database. I intend to perform this in the following manner.
Divide each GeoTIFF into smaller tile ...
0
votes
0answers
231 views
Can't start GeoServer although environment variable has been set on Windows 10
Yesterday, I started the GeoServer server and it worked perfectly, so I stopped the server by closing the command window.
Today, I want to start again, by running "startup.bat"
(as admin)
in ...
0
votes
0answers
87 views
PostGIS SQL error in Java: no spatial operator found for st_contains
I'm quite new in PostGIS, and I'm trying to run an SQL query. I use this query to obtain a subset of segments from table roads in a group of polygons, then put the result in a separate table.
There ...
1
vote
1answer
143 views
Buffer line between two coordinates with meters
I am trying to build a polygon (with long/lat coordinates) over a line between two points (long/lat as well). Basically what I used is line buffering with meters as an distance.
However I have noticed ...
0
votes
1answer
73 views
out of memory error: Java heap space
I have installed GeoServer 2.5.5 on Win 7. When I try to view a raster pyramid I see this message:
OutOfMemoryError : Java heap space.
I google it, but it wasn't useful because I don't use Tomcat ...
0
votes
0answers
10 views
Use layer from Luciad
I am trying to use a layer from LuciadFusion using the interface ILcdLayer.
https://dev.luciad.com/portal/productDocumentation/LuciadFusion/docs/reference/LuciadFusion/index.html?com/luciad/format/...
-1
votes
1answer
53 views
Converting a GeoJSON file to vector tiles compatible with CesiumJS in Java
When I explored on google, I found a lot of packages in Github which were in JavaScript or NodeJS. Did anyone has written a code or came across a library in Java to convert GeoJSON to tiles?
1
vote
1answer
49 views
Validating schema of my XSD wth GML with GeoTools
I would like to control if my GML file is valid with my actual XSD using GeoTools.
I found something here: GML2 Parsing TestSchema Example. But I don't know if it's a good way to do what I want.
...
1
vote
0answers
37 views
Exporting shapefile to DWG
I need export a shapefile to DWG using Java.
I have seen many examples of how to export a DWG file to PDF, but I have not found any that directly export from shapefile to DWG .
Is it possible to do ...
2
votes
1answer
72 views
How to remove a vertex from a MultiPolygon and return the bounding polygon in JTS
I'm trying to complete a code implementing the Kirkpatrick algorithm in Java using JTS and it's literally the first time doing working with such tools. There's a part that I need to remove a known ...
0
votes
0answers
10 views
start-geonetwork.sh is not found
I want to set the heap for Geonetwork and as the doc says, I need to add this line to the start-geonetwork.sh script :
java -Xms1g -Xmx1g -Xss2M -XX:MaxPermSize=128m -Dgeonetwork.dir=/app/...
2
votes
1answer
67 views
Casting LineString to Polygon results in ClassCastException when y coordinates are the same
final WKTReader wktReader = new WKTReader();
String geomString = "MULTILINESTRING ((-98.753985 34.63093, -98.7555568 34.63093))";
MultiLineString geom = (MultiLineString)wktReader.read(...
3
votes
0answers
82 views
How do I read the GPS data from a GPS device using Java
I want to read data from a GPS device connected to my laptop and find the latitude and longitude. I searched a lot about it but could only find Android related programs.
How do I read the GPS data ...
0
votes
0answers
8 views
How to fix Cannot create PoolableConnectionFactory (FATAL: password authentication failed for user ) [duplicate]
I am working on project using GeoServer, PostgreSQL and docker. I am newbie in all these technologies.
I publish new layer in GeoServer and when I try to preview, my browser tries to download instead ...
1
vote
0answers
47 views
Reading, displaying and modifying a raster using Java
I am new to the Geotools library.
The idea is to display and be able to modify a raster in java with the said library. I referred to the code of MARK.
According to the description of the test class, ...
1
vote
0answers
30 views
Detecting if a geocoordinate point is land or ocean in Java
I'm trying to find whether a given location with latitude/longtitude is a land or water. Is there any library in Java that gives me a result of my question?
1
vote
0answers
247 views
How to deserialize geoJon input to locationtech.jts.geom.Geometry [closed]
I have following input to a Spring ReST endpoint:
{
"featureType": "feature",
"geometry": {
"type": "Point",
"coordinates&...
1
vote
0answers
327 views
Error while creating PostGIS entity with Hibernate and GeometrySerializer : No qualifying bean of type 'GeometryParser<?>'
I tried to create a simple application with a geometry persistent layer (Spring boot with hibernate-spatial)
Here is my Entity class :
// Annotations from lombok project
@NoArgsConstructor
@...
5
votes
3answers
439 views
Remove/Fill holes in Polygons from a MultiPolygon using JTS Topology Suite programmatically
There are several questions/answers using ERIS,etc.
like:
Remove holes from polygon
But I am having a challenge applying the solution programmatically using the JTS Topology suite only.
Below is an ...
0
votes
0answers
102 views
Enable Mosaic Native Acceleration in GeoServer 2.17
I am trying to optimise my server's GeoServer configuration for serving WMS. My server is running Ubuntu 19.10. I'm following the 'GeoServer on steroids' guide which recommends enabling 'Mosaic Native ...
0
votes
0answers
44 views
getting convert X and Y to lat and long
I have a table called IK_TEMP and it contains columns called data, range .
String sql = "SELECT DATA, RANGE FROM IK_TEMP";
try (Connection conn = this.connect();
...
1
vote
1answer
93 views
Tomcat 8.0 and GeoServer 2.17 on Windows Server, trouble upgrading JDK to latest version [closed]
I have Windows server running Apache Tomcat 8 and GeoServer 2.17. The JDK installed when setup is older, JDK 1.8.0_73.
I've now installed JDK 1.8.0_251. I changed my global env variable JAVA_HOME=C:...
3
votes
0answers
72 views
Calculate meter offset around decimal degree position
I have a position given in decimal degrees (x.xxxxxxxx and y.yyyyyyyy). I need to draw a rectangle around it. The center of the rectangle matches the position. The dimensions of the rectangle is given ...
2
votes
1answer
77 views
GeoTools ShapefileReader “Random Access not enabled” when trying to read files edited by QGIS 3.12?
I have some code where the relevant part looks like this:
private static List<GisShape> shapes(String shapefile) {
DataStore dataStore;
try {
dataStore = getDataStore(...
2
votes
1answer
37 views
How to retrieve the type of CRS (geographic or projected)?
Is there a way with GeoTools to know whether a CRS is geographic (in degrees) or projected (in meter) ?
I have tried empirically with the following code (based on a check of the CRS unit) but I am ...
2
votes
0answers
82 views
Can't find geotools class in jar file/Maven dependency Android app [closed]
I am creating an Android app and using an extension from Maven dependency. This extension use geotools classes but when I compile and execute the app I have the following error:
020-04-20 21:51:52....
0
votes
0answers
145 views
Inserting X,Y to Geometry in Spring Boot and PostgreSQL?
I use @query to Insert X,Y to Geometry in PostgreSQL.
@Modifying
@Query(value = " insert into mypoints (name,geom) values (:name,SRID=4326;POINT(:x :y))", nativeQuery = true)
@Transactional
void ...
0
votes
0answers
9 views
GeoProcessor Dissolve problem with java
I used to write a dissolve method with C#, it worked well.
But, when I try to rewrite it by java, the problem came.
That's the code:
IGpValueTableObject pObject = new GpValueTableObject();
...
0
votes
0answers
19 views
ArcGIS SDK JAVA How to display only raster (and not basemap)
I wouldike to display only raster file on my application and not basemap.
So I let the constructor of ArcGISMap empty like this :
// create a map with a basemap and add it to the map view
map = ...
0
votes
1answer
56 views
Problems to deploy latest version via Java installer and Tomcat8 inside OSGeoLive 13 VM [closed]
For a presentation of Geonetwork in our group I wanted to have the latest version of GN (v3.10.2) instead of the one implemented in the VM (3.2.1?) that was working flawlessly. (Awesome work to be ...
1
vote
1answer
32 views
Polygon not drawing correctly
I have a series of points I would like to connect into a polygon but it isn't drawing correctly, You'll see the problem.
Coordinate[] xyarray = xycoords.toCoordinateArray(); ...
0
votes
1answer
116 views
Alternate of intersects ?# operator in postgres
Is there any way to find if a path is intersecting with a box in postgres without using ?# or using an alternative?
I have this query below and hibernate's EntityManager is throwing an exception ...
4
votes
1answer
38 views
Compute the azimuth between two UTM32N points using Java GeoTools
I am using Java GeoTools to compute the azimuth between two UTM32N points, e.g. between POINT(496383,5419109) and POINT(528196,6070949). Is it possible to do so without converting the points to WGS84 ...
-3
votes
1answer
52 views
Adding ortho images in Java project ArcGIS (SDK ArcGIS)
I would like to use my orthophoto in my project. I'm using ArcGIS SDK Java and the component:
ArcGISMap map = new ArcGISMap(Basemap.createStreetsVector());
My orthophoto size is 4 GB (.7z)