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
0answers
10 views

How convert OSM relation to GeoJSON -based all kind of 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
0answers
27 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
31 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
6 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&...
-1
votes
0answers
16 views

How to export all Layer from MapContent have multi layer to only shapefile [closed]

Some body help me package org.geotools; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.io.IOException; import javax....
2
votes
0answers
25 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
74 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
15 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
15 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
30 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 ...
0
votes
1answer
23 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
51 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
8 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
37 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 ...
0
votes
2answers
142 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
23 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
53 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
21 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
32 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
31 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
52 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
189 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
48 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
22 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 ...
0
votes
1answer
60 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
62 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
12 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
33 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
49 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
32 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
41 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
43 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
113 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
135 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
36 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
120 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
85 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
49 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
2answers
107 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
73 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
59 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
28 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
573 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
36 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
198 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
37 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
48 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
25 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
90 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
64 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 ...