Questions tagged [java]

An object-oriented cross-platform programming language developed by Sun Microsystems.

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

Can't change store dir or create new raster store on GeoServer 2.16. Failed to create reader from file: data/

I tryied to change raster source for existing raster store, but face it: Could not list layers for this store, an error occurred retrieving them: Failed to create reader from file:data/...
1
vote
1answer
51 views

Convert image from GeoJSON

I am trying to convert feature collection GeoJSON into image. I want to use geotools to convert. I tested the soultion from this post here. But I am really noob that I ran into some errors like this: ...
0
votes
1answer
53 views

Add legend in a SplitPanel in Google-Earth Engine

I have made a code with a Split Panel (1) , now i what to add a legend like this example: https://code.earthengine.google.com/b5d35a19689ec5698e59f36a9b3ae6f8 this is my original code that I want to ...
3
votes
1answer
23 views

GeoTools: java.util.{List, Map} in SimpleFeature

I'd like to add a List(Map) as Attribute to a SimpleFeature when using the PostGIS datastore: SimpleFeatureTypeBuilder simpleFeatureTypeBuilder = new SimpleFeatureTypeBuilder(); ...
3
votes
1answer
24 views

Adding attribute to a feature type?

I need to do something apparently simple: adding a new attribute to an existing simple feature type. Something like: SimpleFeatureType sft = DataUtilities.createType("", "the_geom:Point:srid=3035,ex:...
2
votes
1answer
39 views

Reading through shapefile table with Geotools

Goal: Read through a shapefile table with Geotools. I'm confused about FeatureSource, FeatureCollection, and FeatureIterator in Geotools. In ArcGIS, I can open a table in an existing shapefile, and ...
0
votes
1answer
38 views

Geonetwork startup. Raised exception while starting the application

I'm encountering a problem that prevents the proper startup of Geonetwork Opensource. It always worked up to now but honestly, I don't remember any system change that might have caused that. Linux ...
0
votes
0answers
23 views

GDAL installation required for users?

I'm writing a little Java program to read some shapefiles & spit out the result of some calculations. I'm using GDAL, as the arcObjects.jar for ArcGIS Desktop is too restrictive for what I need (...
0
votes
2answers
32 views

GeoServer 2.16: Null object returned for expression: legend.width for setting value: 0 on: StyleInfoImpl[test_osm:rf] [closed]

I don't really understund how and why, but when I tried to save CSS changes on Style page of GeoServer GUI (by Apply or Submit) I saw it: java.lang.IllegalStateException: Cannot access /opt/tomcat/...
0
votes
0answers
23 views

GDAL - Class File Editor: Source not found, The source attachment does not contain the source for the file osrJNI.class

Trying short java code example through gdal in eclipse, which fails. link: https://trac.osgeo.org/gdal/browser/trunk/gdal/swig/java/apps/OSRTest.java code: import org.gdal.osr.SpatialReference; ...
0
votes
0answers
22 views

ArcCatalog doesn't run program

I've designed a program in which: user selects their input directory, the source of the shapefiles user selects their output folder, where their file will end up user names their resulting Excel ...
1
vote
0answers
12 views

ArcObjects and JavaFX [closed]

I am trying to export my ESRI add-in to ArcCatalog. I have access to ArcGIS for Desktop. I do not use Arc Runtime. I have created a java small program, and I'd like to kick it off with a button. ...
1
vote
0answers
38 views

Mapbox Android basics: import com.mapbox.mapboxandroiddemo.R

I am trying to rebuild the example code of the Mapbox first steps tutorial for Android Studio (https://docs.mapbox.com/help/tutorials/first-steps-android-sdk/). But I am struggeling with an import ...
0
votes
1answer
19 views

Updating geomesa record using Geomesa-Accumulo and Spark with Java API?

I have found here how to save data using spark and geomesa accumulo. But I can't find anywhere how to update existing records. I know that Accumulo is under the hood. Accumulo provides data ...
0
votes
1answer
88 views

gdal.jar cannot find gdalalljni on Ubuntu

I'm trying org.gdal library on Ubuntu. <dependency> <groupId>org.gdal</groupId> <artifactId>gdal</artifactId> <version>2.3.3</version> </dependency&...
0
votes
0answers
46 views

Warp using Java GDAL API

I am trying to warp a dataset using Java GDAL API. However, it is not documented and it is unclear which options WarpOptions take. I feed -tr 15 15 just like for gdalwarp. This results in Option not ...
0
votes
2answers
69 views

Get all city information (roads, buildings, ..etc) in OpenStreetMap via Overpass API

I want to draw a city (Avignon, France) with JavaFX and OpenStreetMap (via Overpass API). What is the QL request that I have to send to Overpass API to get this information?
0
votes
1answer
44 views

GeoServer complex WTMS/TMS/GWC trouble: No such operation gwc null service

I trying to solve a issue from replaced data dir on GeoServer. When I choose a WMTS / TMS services in GeoServer's 2.16 GUI I see this: and 400:null too for TMS: <ows:ExceptionText>No such ...
0
votes
0answers
16 views

Create Geotiff from JPEG or PNG [duplicate]

I'm working on creating maps using Cesium. Now my client needs to export the viewport map to an image. I'm already exporting to PNG/JPEG but now I need to create a GeoTiff. Is there any way to ...
1
vote
2answers
79 views

How to designate a polygon as range on a TIFF file and take the raster data which in this range?

In GeoTools, GridCoverage2D.evaluate(DirectPosition coord, int[] dest) can get the raster data in specified location. It's powerful, but I want to get some raster data in a spatial range. I try to ...
0
votes
0answers
24 views

What is appropriate coordinate transformer for Lambert Azimuthal Equal Area to Google maps in Geotools?

I need to extract the coordinates from the GeoTiff file (that was provided by European Soil Agency for Spain) and display them in Google Maps. For that, I wrote simple Java code public static ...
2
votes
1answer
41 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-...
0
votes
1answer
33 views

Duplicating feature layer with ArcObjects?

After opening a MxD document and getting the main map then a feature layer, I want to duplicate the layer with ArcObjects in order to inherit its properties (symbology, layer def and labelling). Then, ...
1
vote
1answer
63 views

Java - Conversion from NAD27 to WGS84

I'm in the process of adding automatic CRS conversion to a Spark application and running into some problems with the implementation. Each row in a dataframe that is being converted will contain ...
1
vote
0answers
16 views

Within returns results despite there is no points inside the selected polygon

I have a method that uses within function, in order to check if a point is within a polygon: public List<PointsEntity> findPointsIntoAnExistingPolygon(PolygonEntity polygon) { ...
1
vote
1answer
40 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 ...
0
votes
0answers
49 views

GeoServer cached layers and WMTS aren't working (Error!)

After restarting Tomcat I face unworking WMTS: 400: null page on path local:3000/geoserver/gwc/service/wmts?REQUEST=GetCapabilities and unworking cached layers path of GeoServer GUI. Log: UPD error ...
1
vote
2answers
142 views

Calculate new coordinate based on distance traveled between two other coordinates

We have two coordinates (latitude, longitude) and let's assume we want to travel along a straight line between them. After traveling a certain distance along this line, we would like to calculate a ...
0
votes
0answers
21 views

Clustering markers on a map ON THE SERVER SIDE with Java and MapTiler Cloud?

How can I cluster map markers on the (Java) server side of my website? I am planning to use Leaflet.js with Open Street Map data and OpenMapTiles (MapTiler Cloud - https://www.maptiler.com/cloud/) ...
1
vote
0answers
118 views

An illegal reflective access operation has occurred: Problem trying to merge changefile with .pbf data

After downloading a changefile (525.osc.gz) and a planet file (planet-latest.osm.pbf) I am trying to merge the changes with the following command: osmosis --read-xml-change file="525.osc.gz" --read-...
0
votes
0answers
13 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
60 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
59 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 ...
0
votes
1answer
32 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
50 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 ...
0
votes
0answers
27 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.
0
votes
1answer
26 views

Read only a specific value in LC_Type1 Class Table for MCD12Q1.006 MODIS Land Cover Type Yearly Global 500m

I have defined a specific area to look at but now I want to only read the data for the water. MCD12Q1.006 MODIS Land Cover Type Yearly Global 500m has a LC_Type1 Class Table and I only want to read ...
0
votes
1answer
90 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 ...
2
votes
0answers
63 views

Reprojecting British National Grid (27700) coords to Mercator (3857) using Proj4j

On epsg.io https://epsg.io/transform#s_srs=27700&t_srs=3857&x=327420.9886680&y=690284.5471100 the BNG easting/northing coodinates 327420.988668 690284.547110 reproject correctly to -352695....
0
votes
0answers
22 views

How to make sure GDAL Java binding doesn't crash my whole application?

I'm using GDAL Java binding to convert some files (ogr2ogr), such as shapefile to GeoJSON. The problem is when something goes wrong it crashes the whole application and I have to start it up again. ...
1
vote
0answers
63 views

Why coordinates are saved like “0101000020110F00003CDBA337DCC351C06D37C1374D374840” in db? [closed]

On my DB, the data looks like this: In the DAO I am executing a query: public Object login(UserEntity user) { StringBuffer sb = new StringBuffer(); sb.append("SELECT user FROM ...
1
vote
1answer
70 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 ...
1
vote
0answers
20 views

Memory management in offline routing with n waypoints?

I am trying to build an offline routing system with a map database on a portable Android device. Since I am still doing some research, I am stuck on what I think is a fundamental problem. To find the ...
2
votes
1answer
90 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 ...
2
votes
0answers
68 views

Creating GeoJSON REST service

I'm trying to create a GeoJSON REST service from a PostgreSQL connection. First I fetch GeoJSON as a string from PostgreSQL: import java.util.*; import java.sql.Connection; import java.sql....
1
vote
1answer
191 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. ...
0
votes
0answers
141 views

How convert OSM relation to GeoJSON -based all kind of relation member roles

I just want to convert OSM data to GeoJSON where it is pretty simple with node and way tags of OSM data, but relation which is giving complex can't find the logic to convert OSM relation to GeoJSON ...
1
vote
1answer
138 views

Sending geographic data from Postman?

I am trying to create a GIS app using Java, Spring and Hibernate. I send a JSON from Postman like this: { "pointName":"any location", "geom":"POINT(-71.060316 48.432044), 3857" } The JSON ...
2
votes
1answer
128 views

Get weird result when calculating distance between two points, using latitude longitude?

I use algorithm (see: calculating distance between two points) to calculate distance between two points. but it get wrong result, see Java code: /** * group1:set latitude to 89 */ // set ...