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 [geotools]

GeoTools is an open source Java library that provides tools for geospatial data.

1
vote
1answer
32 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. ...
2
votes
3answers
43 views

Projection fails when ran with assertions enabled [on hold]

The following minimal example runs fine only when assertions are disabled: src/main/kotlin/main.kt: package com.regions import org.geotools.geojson.feature.FeatureJSON import org.geotools.geometry....
0
votes
0answers
8 views

When I try to get the layer using Geotiffreader, I get a black background image

GeoTiffReader geoTiffReader = new GeoTiffReader(filePath); StyleBuilder sb = new StyleBuilder(); GridReaderLayer layer = new GridReaderLayer(geoTiffReader, sb.createStyle(sb.createRasterSymbolizer()));...
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&...
3
votes
1answer
261 views

Which algorithm (Vincenty or Haversine) is used to calculate distance in GeoTools?

I want to use GeoTools library to calculate geographic distance by using GeodeticCalculator (as mentioned in here http://docs.geotools.org/stable/userguide/library/referencing/calculator.html ). Does ...
1
vote
0answers
12 views

Save GridCoverage2D to JPG

I am using following code to save a Goverage2D to JPG: File tmpJpgFile = File.createTempFile("temp", ".jpg"); Iterator<ImageWriter> writers = ImageIO.getImageWritersBySuffix("jpg"); ImageWriter ...
3
votes
1answer
80 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
17 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 ...
2
votes
1answer
32 views

Get nearest feature points from memory

I have a set of features (a few hundreds, can grow to a couple of thousands), which have a latitude and longitude. They are not stored in a database because they change frequently (another system is ...
1
vote
2answers
31 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
24 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
58 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
31 views

GeoTools and PostGIS coordinate transformation gets different result [duplicate]

I've got a problem transforming coordinates. The result differs in PostGIS and GeoTools. I want to transform from EPSG:4326 to EPSG:3398. PostGIS: indicia=> select ST_AsText(ST_Transform(...
2
votes
1answer
18 views

Compare two points and conclude direction

Is there a simple method in geotools or JTS to conclude the direction between two geospatial points? I would like to conclude if point A is (north, south, east, west, NW, NE, SW, SE) when compared ...
0
votes
1answer
11 views

Geotools Runtime error in web application environment?

Eclipse+Maven+Tomcat. I have some Geotools code that runs fine when run as "Java Application". The same code fails when running within a servlet. So it must be an issue with the Jar Loader of geotools....
0
votes
2answers
165 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
vote
1answer
44 views

Modifying coordinate values of MultiPolygon using GeoTools?

I can already get the vertex coordinates of the polygon, but I want to modify the coordinates and write it back to the source file. This is part of the code I read the coordinates. try{ while (...
0
votes
0answers
32 views

KML parser in GeoTools won't parse TimeStamp

.... <Folder> <name>FooName</name> <Placemark id="3"> <description><![CDATA[ Foo HTML stuff ]]></description> <TimeStamp> ...
0
votes
2answers
31 views

Java GeoTools API: getInteriorPoint does not work on an intersection between Polygon and MultiLineString

I'm working on a Java project using GeoTools API that want to get the interior point getInteriorPoint(), from the geometry coming from an intersection between a Polygon and a MultiLineString. Please ...
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 ...
0
votes
1answer
29 views

GeoTIFF / Geotools / Mollweide / customer projection not recognized

Although I got a hint from Ian, I still have a problem to read a GeoTIFF in Geotools. I ask this as a new question so that I can put all info. The GeoTIFF is from http://cidportal.jrc.ec.europa.eu/...
2
votes
2answers
26 views

Geotools CQL to OGC filter

I'm trying to convert a CQL filter to OCG. I followed this example: https://blog.ianturton.com/geotools/code/ogc/2015/03/18/Generating-OGC-Filters.html In line with org.geotools.xml.Configuration ...
2
votes
1answer
26 views

Geotiff Mollweide and geotools

I am new to GIS and I want to read population data from a GeoTiff Grid using the java geotools library. The following throws a runtime error GridCoverage2D image = new GeoTiffReader(f); gives ...
2
votes
1answer
40 views

Specifying EPSG transformation method in GeoTools?

I am a software developer who knows a bit about Gis/Geodesy, but I am not an expert so I might misuse terminology somewhat. I have been tasked to extend an app in Java and have a need to transform ...
1
vote
1answer
22 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 ...
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
26 views

GeoTools change buffer style

Is it somehow possible to change the buffer style of the build in GeoTools buffer() function? Or is there a User Definded Function for that? I just saw a different buffer function where one could ...
0
votes
1answer
33 views

Creating custom Operation for encapsulating some map algebra using GeoTools?

In GeoTools, I need to perform a one-to-one pixel computation between a bunch of GridCoverage2D. In short: some map algebra. As I understood I can do things like summing values of coverages using: ...
0
votes
1answer
36 views

GeoTools reprojecting SimpleFeatureCollection return invalid datatypes

Hard to wrap the question into a title. I build a custom ReprojectionClass today to transform a whole SimpleFeatureCollection into a different CRS (currently hard coded to EPSG:3857 The ...
2
votes
1answer
58 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
199 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 = ...
1
vote
1answer
50 views

Create dynamic circle/polygon from specific lat/long using GeoTools

I have a dataset of lat/long that I would like to match on dynamically generated circle/polygon from specific point with different radius. I have already completed how to match lat/long with custom ...
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 ...
1
vote
1answer
62 views

Distance between a line and a specified waypoint in lat long

I'm based in the UK and I'm trying to determine the distance in meters between a line (created via a set of lat lng waypoints) and a specific point (also defined in lat lng).I've had a look at a ...
2
votes
2answers
516 views

GeoJSON to KML conversion

Is it possible to convert GeoJSON to KML format using geotools. I am trying to figure out this using Java but I can get results only using node js.
1
vote
1answer
25 views

Coordinate Reference System change problem in GeoTools

I try to convert some coordinates from ETRS89-LAEA (EPSG:3035) to WGS84 (EPSG:4326) with geotools. Here is the code: Coordinate c = new Coordinate(3847988.7, 3161178.2); MathTransform mt = CRS....
0
votes
1answer
84 views

GeoServer s3-geotiff module with custom S3 provider fails

I'd like to use the s3-geotiff module within GeoServer with a custom provider (Minio). The minio server is running properly and I could reach the tiffs in the bucket from a variety of s3 tools. ...
0
votes
1answer
61 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?...
2
votes
1answer
35 views

Homolosine projection with GeoTools

I would like to use Goode's Homolosine projection with GeoTools. This projection is fully supported by both PROJ and GDAL. However, when I try to create a CoordinateReferenceSystem object with this ...
1
vote
2answers
47 views

GeoTools correct use of ReprojectingFeatureCollection

I have trouble understanding the use of the function ReprojectingFeatureCollection. Here is my code: try { Double buffer = 500.0; String attributeBuffer = ""; ...
0
votes
1answer
46 views

Converting bulky shapefiles (54 MB) to GeoJSON

I am trying to convert my shapefile to GeoJSON using the below code snippet: StringWriter writer = new StringWriter(); String geoJson = null; FeatureJSON fjson = new FeatureJSON(); fjson....
0
votes
0answers
26 views

How we can get respective WMS layer from a WFS layer?

We need to get the respective WMS layer here, ArcGIS Server WMS layer names do not match to WFS names so name matching doesn't work import org.geotools.data.DataStore; import org.geotools.data.ows....
0
votes
0answers
27 views

Geotools access attribute table on Geoserver

I want to access the attribute table of a SimpleFeatureCollection I have created within a WPS process by clipping it out of a Vectorlayer stored on Geoserver. How can this be done? Is using an ...
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 ...
0
votes
0answers
33 views

Custom Geotool function that access a GeoServer's Datastore

I'm following this tutorial to implement a custom Geotools function: http://docs.geotools.org/latest/userguide/tutorial/function.html I want to implement a custom Geotools function that should access ...
2
votes
0answers
80 views

GeoServer's shared DB connection

I have a PostgreSQL/PostGIS table "geometry_table" that has a 1-to-many relation to another table "properties_table", where each geometry has many properties. These properties hold style values of ...
1
vote
1answer
141 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
39 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
1answer
77 views

Geoserver How to call existing functions inside new WPS process

I am pretty new to Geoserver and programming processes for it. I having trouble to find the information I need. Is it possible to call a existing function inside my own WPS class? I want to clip some ...
1
vote
1answer
43 views

Extra file generated while writing exporting collection to csv

I am exporting csv file from simple feature collection with help of gt-csv the feature collection is coming from db. Export is working fine but i am seeing another temp file generated in the same ...