Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [java]

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

0
votes
2answers
29 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":...
-1
votes
0answers
9 views

Write coordinates to the polygon of the shapefile by gestools [closed]

I have an array of coordinates and how to replace the existing coordinates in the polygon with it.
-1
votes
0answers
35 views

How to validate angle in Geotools

I have a point layer, I need to calculate angle at each point. Labelled are the angles which I got by using this with example triple set of points (13.984696149844021 80.08592760033726), (13....
0
votes
0answers
51 views

GeoServer and Java 11 - What are the benefits or upgrading? [closed]

We are currently running GeoServer 2.12 I am considering upgrading to 2.16 and also upgrading to Java 11, will I see any benefits? Has anyone come across any issues with the new builds?
0
votes
1answer
17 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
34 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
16 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 ...
0
votes
0answers
16 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
25 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
27 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
86 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
23 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
19 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 ...
1
vote
1answer
42 views

Save geometry as image

I want to save the geometry as image. This geometry should look like ICAO areas, but I have got the whole world map. Is it possible in Geotools to save exactly that part of the world map which I need, ...
0
votes
1answer
56 views

Troubles with reprojection

I want to draw a polygon on the world map in different map projections, for example, in mercator proj or stereographic one. They must correspond to ICAO ares G (https://aviationweather.gov/satellite?...
0
votes
0answers
43 views

Generating a Map (like Google Maps) using HGT files

I'm doing a programming project. It consists of generating a Map (like Google Maps) from height files .HGT Currently, I can read each file .hgt (each .hgt file have 1201 * 1201 elevation data). For ...
0
votes
0answers
10 views

Getting t single layer Latitude and Longitude for constant Time and Depth from NetCDF file in Java?

I am trying to read a NetCDF file with 4 parameters (Time, Depth, Latitude, Longitude), I want to read the file at a constant Time and depth. Right now I am reading the whole file and then getting ...
-1
votes
1answer
25 views

Seeking java code to convert from DLTM (EPSG 3997) to WGS 84 coordinate system?

I want a Java function where I can pass WGS 84 X and Y and then return corresponding DLTM values. I was able to convert to DLTM using ArcGIS JavaScript client SDK, but couldn't get the formula to do ...
0
votes
0answers
45 views

Google Earth Engine pull least cloudy Landsat scene by location using conditional

My goal is to write code that will pull all Landsat 8 scenes available for a given month in a given year for the US, add a cloud score band to each image, and if there are multiple images for the same ...
1
vote
1answer
28 views

Error during MGRS conversion for large latitudes

I'm using Nasa's Worldwind java API to convert MGRS strings to lat/lon. However, when my latitude is greater than 85 degrees or less than -85 degrees I get an error. java.lang....
1
vote
0answers
30 views

Inaccurate results when converting coordinates to EPSG:53004 with geotools and

I am not very well aquainted with geographic data, but I'm working on a student project, where I have to position points from GPS coordinates around Warsaw on a particular shapefile map. It came with ...
2
votes
1answer
33 views

Determining if route self intersects using Java? [closed]

I have a sequence of coordinates (lat,lng) defining a route. How can I determine whether this route is self intersecting? I am trying to implement a Java method for this, but I have been ...
4
votes
2answers
82 views

OSM Line 'way' from PostgreSQL (PostGIS) to Java Linestring (from JTS library)

I would like to read the data from PostGIS OSM database to Java object. I have 'planet_osm_line' table. I'd like to get 'osm_id' and 'way' column read by ResultSet, as here: stmt = con....
1
vote
1answer
96 views

How to set SRS to 'EPSG:4326' in geotools?

I have the following code, referenced from my previous post: https://stackoverflow.com/questions/52554587/add-new-column-attribute-to-the-shapefile-and-save-it-to-database-using-geotools. So what I am ...
1
vote
1answer
35 views

Add geometry line to the map

I'm trying to test the code example on the page http://docs.geotools.org/stable/userguide/tutorial/geometry/geometrycrs.html I copied this example into eclipse Transaction transaction = new ...
1
vote
0answers
82 views

Vector Tiles in a JavaFX application

I currently building a desktop routing application using Java and JavaFX plus MapBox and Leaflet. My problems occured when i try to load a vector tile into a WebView component. If i'm using this HTML ...
1
vote
0answers
58 views

Can be Neo4j Spatial data exposed to GeoServer via the Neo4j Geoserver Plugin being edited via WFS-T protocol?

I'd like to set up some data storage as Neo4j as I need the advantages of graph databases for may data, but I'm not sure that the data would be spatially editable via WFS-T and Geoserver. Does Neo4j ...
0
votes
1answer
33 views

Postgis SQL schema for features expected by GeoTools

I am building a small application which uses postgres and has a couple of tables which have a postgis polygon as one of their columns. I was thinking of using a Geotools DataStore rather than querying ...
3
votes
1answer
88 views

Geotools JTS, find most distant points in polyline or polygon?

is there any convenient API in JTS that would help to find two most distant points in line find two most distant points in polygon
1
vote
1answer
55 views

Get UTM Zone from GeoTIFF (geotools java)

I've loaded a GeoTiff successfully in with geotools (21-SNAPSHOT), but I'm having trouble accessing the referenced UTM zone. The code to read in the file is here: File tiffFile = new File(filePath); ...
0
votes
1answer
52 views

Classification based on NDVI values of two images

I want to find the areas where the NDVI value were higher then 0.4 at the end of April and NDVI values were lower then 0.3 at the end of June. I have tried to make it using below demonstrated script, ...
1
vote
0answers
24 views

Reading backscatter value of each pixel of Sentinel-1A images in Java? [closed]

I am new to working with Sentinel-1A images but have better knowledge of Java. I want to get backscatter value of each pixel of Sentinel-1A image, store it and then get the frequency of each value. ...
3
votes
1answer
353 views

Convert list of Java objects with JTS geom to GeoJson

I have a list of Java POJOs that all have a JTS geometry associated with them (Point) - a list of POIs, basically. I want to output them as GeoJson (FeatureCollection, Feature etc.) jackson-...
1
vote
1answer
31 views

FeatureJSON is not setting bounds

I am using FeatureJSON from geotools to read in a GeoJson file containing a FeatureCollection and convert it to a SimpleFeatureSource. It all works fine except the feature bounds are null, so if I try ...
3
votes
2answers
145 views

Is there a Java API for in-memory geo indexes?

My application is backed by PostGIS. There is a particular set of tables which have one of their columns being a geographic polygon. They are relatively small in size (few thousand rows) and can ...
1
vote
1answer
32 views

Generate Dbf file according to the modified differenced FeatureCollection

I am working on geotools where I had created a FeatureCollection having the difference of the other two FeatureCollection s. I referred below link for this Comparing two shapefiles(layers) and ...
3
votes
1answer
38 views

Geotools: Set custom primary key

I have a script which reload data from dbf file and create a new table in postgres database using geotools plugin. My problem is when geotools reload fields name from the file it adds a new field fid ...
1
vote
1answer
24 views

Create a Feature from a Boundary

I'm attempting to create a Feature based on a Polygon defined by a ReferencedEnvelope of the provided Feature (in this case a country). However I am seeing a CRS error NoSuchAuthorityCodeException: ...
2
votes
0answers
68 views

Add new attribute in shapefile using Java: Geotools [duplicate]

I want to edit my shapefile by adding a new column "ID" and assign a value to it. I am trying to achieve this using Java Geotools. Here is the snippet code: File inFile = new File("/abc".shp"); ...
2
votes
1answer
52 views

Speed up Geotools Vector Grid processing

I am using Geotools Vector Grid on a FeatureSource (shapefile) that been projected to "AUTO:42001". Units for the map are then in one meter increments. When the FeatureSource is a large country (like ...
0
votes
1answer
116 views

Integrate QGIS Plugin with Java Project [closed]

I have a Java Application. I am using QGIS to solve one such module of my Java Application. I have written code in python console within QGIS.Is there any way to integrate both of these? I am ...
1
vote
1answer
86 views

Transforming a single-band GeoTIFF into an RGBA PNG file using GeoTools

I'm fairly new with GeoTools. I'm using it in order to generate GeoTIFF files that have a single band, with values between -1 and 1, or NaN. An example of such a file is available here: https://m-...
0
votes
1answer
91 views

How realistic is it to be able to build a dynamic map with ~50k points that change colour depending on supplied data? [closed]

I'm a programmer, but I'm new to GIS. I want to build a map that displays the status of some IoT devices I work with. My ideal vision is a world map, which would fill the screen, but for now, ...
1
vote
1answer
68 views

Return A Path from multiple point in Geomesa

I am trying to visualise the historic of a vehicle in a specific area , I am writing now a query to get all points off a this vehicle in this area with this : FeatureStore feature = (...
0
votes
0answers
86 views

GT06 Keep Sending Login and Heartbeat Packet

I am creating a GPS track application in Java via scoket programming. After setting up everything, recived login packet and sent response by my server. After sending response GPS sending heartbeat ...
0
votes
1answer
71 views

Is there any method to create WMTS GetCapabilities response in xml using java libraries?

I am creating WMTS server side. The problem is that I cannot find any solution where I will be able to generate GetCapabilities xml response in java using some libraries like geotools or similar. Can ...
0
votes
1answer
53 views

Taking an arbitrary object in Java and creating a shapefile out of it?

Let's say I have a data class in Java that essentially has title geo (WKT String) Other irrelevant metadata I want to create shapefile from lists of these types of objects using something like ...
1
vote
1answer
42 views

OpenTripPlanner API Elevation values unclear

I'm using the OpenTripPlanner Planner API to find directions. The API returns XML with the geometry of the line (2D) and the elevation data separately, for example The 2D line geometry is as ...
0
votes
0answers
43 views

Why 'Simple' example is not giving in Mapfish pdf report?

I am using windows. I installed tomcat 8.5. Then deployed print-servlet 3.9 war. There are some example print apps. I tried to print "Simple", but it didn't build any pdf report, gave some error ...
1
vote
0answers
58 views

Algorithm or library for buffer zone for lat-lon (wgs) coordinates in global scale

Can anyone point to generic algorithm or library for buffer zones if the source data is in WGS84 degrees? The buffer width should be in meters, as buffer in degrees it generally does not make much ...