Questions tagged [java]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
21 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
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-...
0
votes
1answer
23 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
0answers
21 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
13 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
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 ...
0
votes
0answers
28 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
42 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
7 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
39 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
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 ...
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 ...
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.
0
votes
1answer
19 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
64 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
39 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
20 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
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 ...
1
vote
0answers
18 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
77 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
39 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
65 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
83 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
86 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
72 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 ...
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&...
2
votes
0answers
41 views

Can't print WMS in MapFish

I am trying to set up a template in jasper reports to send to MapFish print. I am specifying the map layers in the requestData.json file. I am testing with a single layer, and have tried map services ...
3
votes
1answer
223 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 ...
0
votes
0answers
62 views

Creating and saving OpenStreetMap locations within GeoJSON file?

I am not experienced in working with OpenStreetMap, but I am wanting to collect points. All points that the user collects will be saved inside a GeoJSON file, however whenever I use this, the file is ...
1
vote
2answers
58 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
168 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
13 views

Seeking Java libraries that encapsulate HGT files download and returning elevation data on demanded area?

The googling of Java HGT libraries recovered processing libraries only, not covering the selection of the HGT files of the desired area and accessing them from their hosts. Is there something ...
0
votes
0answers
59 views

Quadtree based polygon indexing? (Python/Java)

I was wondering how to best represent the inside of any given polygon (GeoJSON coordinates) with some sort of indexing, like a grid or quadtree? See image below for an approximation of what I have in ...
1
vote
2answers
677 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":...
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 ...
1
vote
1answer
105 views

How to create unit and quantity “amount per area unit” in JSR-363? [closed]

I am trying to integrate units and quantity with JSR-363. I know and understand how to create SI and NONSI units and convert e.g. Areas units from one to another. But, in a kind of geographic ...
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 ...
1
vote
0answers
67 views

Clipping TIFF raster image using bounding box with GDAL in Java

I would like to know how can I clip a raster image using a bounding box with GDAL in Java. I can do it with the binary file gdal_translate: gdal_translate -projwin -75.3 5.5 -73.5 3.7 -of GTiff ...
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 ...
2
votes
1answer
146 views

How can I label the coordinate position of the grid coordinate lines

I need to display the coordinates of the grid lines. I saw this article 'Fun with Graticules', which has much common with that I want to do. But I still have a question. How did you create the new ...
1
vote
1answer
430 views

Converting GeoJSON to shapefile using GeoTools Java

I am implementing a web service in Java which takes a GeoJSON file as input and converts it into a shapefile. My code looks something like this :- @RequestMapping(value = "/uploadFile", method = ...
0
votes
0answers
96 views

cloudless maximum-value NDVI-composite and saturating values

My aim is to compose cloud free maximum-value NDVI-composite from Svalbard, Norway. Composite is based surface reflectance collection, filtered with dates (growth period) and region of interest. When ...
0
votes
0answers
32 views

epsg_operations.properties

I am trying to include an epsg_operations.properties definition into my Java /Geotools Project. I thought it would be the best solution to include the gsb-File for a GRID-Transformation. So I inserted ...