Questions tagged [geotools]

GeoTools is an open source Java library that provides tools for geospatial data (http://geotools.org). Questions about programming using GeoTools are on topic here, while questions on geographic issues (while using GeoTools) should be asked on https://gis.stackexchange.com.

For questions about how to complete geographic tasks using the GeoTools library you may want to ask on https://gis.stackexchange.com/ to get answers, if your question focuses on programming issues with GeoTools then ask on this site.

565 questions
3
votes
1 answer

Converting ECQL from geotools to SQL

Is there a java library for converting ECQL(geotools) to SQL ? CQL and ECQL CQL (Common Query Language) is a query language created by the OGC for the Catalogue Web Services specification.
Fiz
  • 59
  • 4
3
votes
1 answer

Error loading polygon geometries using shape file data store with geotools 24.0

I have recently upgraded my geotools dependencies from 23.2 to 24.0 i have the following error when i try to load a FeatureCollection from a shape file data store with a polygon geometry,seems this problem was introduced in 24.0 geotools release…
3
votes
1 answer

How to split a JTS polygon

I have a big polygon and I want to find intersecting features with the polygon but since polygon is too big, I am getting timeout exception. I was trying to look into JTS methods but couldn't get how to use it. final List coordinates =…
user1298426
  • 3,467
  • 15
  • 50
  • 96
3
votes
2 answers

Geotools create CRS from polygon and dimensions

I have some grid data (2d array) that has some geospatial metadata associated with it. The bounds are in a jts polygon with WSG84 lon lat coordinates. The polygon is a rectangle, but is not axis aligned (not a bounding box). I am trying to create a…
Brian Clements
  • 3,787
  • 1
  • 25
  • 26
3
votes
2 answers

geotools and maven for normal users

I was trying to get started with using (not making contributions to) the geotools lib yesterday,but i ended up trying to figure out what purpose does maven serve when it comes to someone that just wants to build a small/medium app based on…
Trimmer
  • 31
  • 2
3
votes
1 answer

Request a map from WMS and save it to the disk as a PNG image

I have to write code using java and GeoTools to do a WMS request, get the image and save it to a specific location on my computer. I've followed the GeoTools WMS tutorial and the code compiles without errors, but I don't know how to check if it had…
3
votes
1 answer

NoSuchAuthorityCodeExcpetion in geotools program (gradle build) converting between coordinate systems

I have a java geotools program to convert a coordinate between two coordinate systems. It attempts to convert between coordinate system ESPG:4326 and ESPG:5179. I receive the following exception when trying to execute this line in my…
ditkin
  • 6,774
  • 1
  • 35
  • 37
3
votes
1 answer

Programming Geoserver 2.0.2 to add a new data store and layer without the UI

I have a directory of imagery that will be updated continually. From this imagery, I am making Image Pyramids using the Geotool's PyramidBuilder utility. I need to setup a cron job to automatically add new datastores and layers to Geoserver without…
rb92
  • 31
  • 3
3
votes
1 answer

How do I extract the latitude and longitude values from GeoTIFF image using java?

I have a satellite image on which I have to work. I have read the file so far using ImageIO and JAI. I now wish to find the latitude and longitude values corresponding to each pixel that is stored in the TIFF file. Thanks in advance.
3
votes
1 answer

Transform coordinates from EPSG:4326 to EPSG:31467 in Java /GWT server side

I have been using the following code from https://ariasprado.name/2012/08/13/quick-and-dirty-coordinate-transforming-using-geotools.html#comment-792 on my GWT server side and have attached all the required jars exactly as stated . Error logs…
3
votes
1 answer

Geotools fails to parse a GeoJSON file with custom properties

I am using geotools 17.2 to parse a GeoJSON file as follows: try (FileInputStream is = new FileInputStream(routeFile)) { FeatureJSON io = new FeatureJSON(); return io.readFeatureCollection(is); } The GeoJSON file that I am using is the…
Krassi
  • 2,336
  • 3
  • 22
  • 30
3
votes
1 answer

Show direction of linestring on map - auto zoom on map

I have this code, which plots on a map a linestring which is the track of 2 coordinate points that the user supplies. public class Quickstart { public static void main(String[] args) throws Exception { // display a data store file chooser…
George
  • 5,808
  • 15
  • 83
  • 160
3
votes
1 answer

How to include geoscript as a dependency in Scala intelliJ project?

New to Scala and sbt; coming from a python world, and rather confused by library dependencies, versioning, and what sbt can and cannot automatically download (i.e. when a .jar needs to be manually placed in /lib). I want to use classes from the…
EyeWrite
  • 233
  • 2
  • 6
3
votes
1 answer

Geotools get Feature Info

I am working with the geotools library. My goal is to input a coordinate and in return get the Feature's info that contains it. Geotools Quickstart tutorial's map does exactly what I want with the button I circled in red below. However, I couldn't…
jjgl
  • 387
  • 1
  • 5
  • 10
3
votes
1 answer

Transform cartesian pixel-data-array to lat/lon pixel-data-array

I have an image (basically, I get raw image data as 1024x1024 pixels) and the position in lat/lon of the center pixel of the image. Each pixel represents the same fixed pixel scale in meters (e.g. 30m per pixel). Now, I would like to draw the image…
Kiamur
  • 125
  • 1
  • 11