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

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.
1
vote
1answer
14 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
49 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
34 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
18 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
59 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
56 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
13 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
72 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
37 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
38 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
42 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
53 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
51 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
15 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
38 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
121 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
28 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
29 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
37 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
27 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
121 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
11 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
47 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
373 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
30 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
77 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
23 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
53 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
32 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
94 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
300 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
73 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
27 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
83 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
74 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
13 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
43 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
57 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
38 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
52 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
69 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
156 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
184 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
45 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
136 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
89 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
58 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
121 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