Questions tagged [geotools]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
44 views

JFileDataStoreChooser.showOpenFile does not filter by extension

running GeoTools 15.1 on ubuntu using this code ... import org.geotools.swing.data.JFileDataStoreChooser; public class GeoJson2Shape { public static void main(String[] args) throws Exception { ...
0
votes
1answer
31 views

GeoServer - longitude/latitude is out of bounds

We could see the below error from GeoServer when zooming out the map, because the bbox sending request more than the MONGO DB accepted range(-180,-90,180,90). "Query failed with error code 2 and ...
0
votes
1answer
67 views

Error in Geotools renderer

Here is my Java code that generates an error from Geotools renderer: public class LandmarkLayer { protected static final String LANDMARK_FEATURE_NAME = "landmark"; protected static final StyleFactory ...
0
votes
1answer
44 views

BingService doesn't accept requests for Hybrid and Other Bing Map formats

We have used BingService with the help of following code: String baseURL = "http://ak.dynamic.t1.tiles.virtualearth.net/comp/ch/${code}?mkt=de-de&it=G,VE,BX,L,LA&shading=hill&og=78&n=...
1
vote
1answer
68 views

CQL to XML with string substitution using geotools?

I have some cql attr > PLACEHOLDER that I want to convert to valid XML using geotools. I have heard of terms like filter functions that can somehow replace the placeholder with a function, but not ...
1
vote
1answer
29 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 ...
0
votes
1answer
21 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
1answer
208 views

GeoTools and GDAL: CRS WKT

I would like to achieve the same output as for GDAL using the GeoTools library: CoordinateReferenceSystem crs = CRS.decode("EPSG:32632"); String wkt = crs.toWKT(); System.out.println(wkt);...
2
votes
1answer
19 views

Geotools set a style for a map,but not work

I use the example of the official website to load the shpfile file, but the style only works in the frame, it does not work in the jMapPane. public void openShpFile(JMapPane mapPane) throws Exception ...
1
vote
1answer
318 views

Cropping GeoTIFF with GeoTools using integer indexes

I know how to crop a raster by providing coordinates in a CRS: Envelope envelope2D = new ReferencedEnvelope(envelopeStartX, envelopeEndX, envelopeStartY, envelopeEndY, obj.targetCRS); GridCoverage2D ...
2
votes
1answer
35 views

Read M value (CoordinateXYZM) from shapefile with geotools

After successfully writing M values into a shapefile (.shp, only points for now), I now also want to read the generated file and print the full coordinate set (x, y, z and m) using geotools (23-...
1
vote
1answer
156 views

Speeding up rendering of GeoTiff images

I use the GeoTools API to read and render a compressed JPEG GeoTiff file: AbstractGridFormat format = new GeoTiffFormat(); format.accepts(rasterFile); //this is a bit hacky but does make ...
1
vote
1answer
29 views

Write M value into shapefile with geotools

I'm using the Java 1.8 library geotools (version "23-SNAPSHOT") to generate a shapefile. Opening the resulting .shp file with QGIS was successfull and I noticed that the gemeotry was apparently ...
0
votes
2answers
711 views

Draw a point, line and polygon on map using GeoTools?

I am using geotools v20. I want to allow the users to draw the new features using the mouse to click on the map area to draw new points, lines and polygons. The user should be able to draw a point on ...
2
votes
1answer
281 views

Line between outside and inside polygon - geotools

I have two polygons, one inside another, and one draw it on the map there is a line connecting vertices of outside and inside polygon. I am trying to draw it like multipolygon using Polygon[] ...
2
votes
1answer
87 views

Using filters to filter a variable value with GeoTools

I have a Java Swing application which loads a line shapefile and draws a map. I'm using a filter and a rule to filter out the lines in the shapefile where the attribute "traffic" is greater than 500. ...
1
vote
1answer
410 views

Get centroid of SimpleFeatures in GeoTools8

I've got some SimpleFeatureCollections and now I want to get the Centroid of every SimpleFeature in the collection. Unfortunally I've only found a centroid method for Geometry. Is there any way to ...
0
votes
1answer
26 views

The image is not rendering while running the jar file

I have very strange problem with rendering the world map as image with geotools when I run my jar file. At the same time, when I compiling my project inside of the NetBeans IDE everything is Ok. What ...
2
votes
1answer
27 views

GeoTools KML export with Document@name

I've been able to export features as KML using GeoTools. However, I would like to insert a name attribute at the top level (e.g. Document, though a Folder would be fine too). (Example of what I'd like ...
1
vote
1answer
24 views

Unioning a set of intersections [closed]

I'm working with two datasets: a set of precincts and a set of census block groups. The census block groups include water; the precincts don't. I would like to trim the census block groups to get only ...
1
vote
1answer
93 views

FilterFactory2 overlaps/intersects

I am creating WPS for measuring area of two overlapping polygons. Its working fine but now I want to implement FilterFactory2 . I am not sure if use Overlap or Intersect method and than, how to feed ...
2
votes
1answer
1k views

Geotools, output to kml and convert meters

I have a complex problem. I'm using geotools 10.* I have input data: latitude, longitude (WGS_84), radius in meters, start angle (12 o'clock), end angle (clockwise, i.e. turn to the right). I need ...
0
votes
1answer
41 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/...
0
votes
0answers
12 views

GeoTiffReader doesn't close the input stream

While using GeoTiffReader provided by Geotools library I am facing disk space issue, the geoTiffReader tries to cache the image at /private/var/folders location locally. It doesn't clears this memory ...
3
votes
1answer
111 views

Geotools : Getting currently click layer from MapLayerTable

I've added a MapLayerTable to my application, and I'm loading multiple layers using shape files successfully. Now I would like to select features on the map of the selected layer. For this, I would ...
0
votes
0answers
38 views

BandOffsets.length is wrong!

I am trying to process large GeoTIFF images using GeoTIFF reader provided by Geotools library. However while processing the image getting below error: org.geotools.data.DataSourceException: ...
2
votes
1answer
25 views

Creating a program using GeoTools to find if a given point is inside the GeoJSON file

I have this GeoJSON file with the coordinates of neighborhoods in Valencia (Spain). Then I am using GeoTools to load the file and check if a given coordinate is inside the GeoJSON file and if YES ...
1
vote
0answers
32 views

How to create group of coordinates and check if a coordinate is within the group?

I am looking for a way to relate two or more types of open data from the Valencia Open data portal. This portal offer data like a traffic jam, noise, and air pollution. All these data have coordinates ...
1
vote
1answer
42 views

Measuring distance between two points using GeoTools java lib?

I am using GeoTools to convert X and Y coordinates into points and get the distance between two points. I know that my coordinates are EPSG:32630 Name:WGS 84 / UTM zone 30N (https://epsg.io/32630). ...
1
vote
2answers
171 views

Which is the right version maven repository for geotools postgis?

The documentation seems to indicate that the right maven repository to use is: <repository> <id>osgeo</id> <name>Open Source Geospatial Foundation Repository</...
1
vote
1answer
62 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 ...
0
votes
0answers
25 views

Can't get Icon by URL [duplicate]

I want to put barbs on my map and everything is ok for the most maps until such error occurred org.geotools.referencing.factory.DeferredAuthorityFactory disposeBackingStore INFO: Disposing class ...
1
vote
0answers
24 views

Getting stripe across tiles without buffering image?

I am new to geotools. I need to get a horizontal stripe of bytes from the image data without buffering the whole image. I've looked at the various envelopes and pretty sure I could use just ...
0
votes
0answers
24 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
75 views

Removing same name layers from layer table in geotool?

I am making a geotool application in which I read the data from postgresql database. In this application if i make a buffer on a selected polygon then a buffer is created and buffer layer shown in ...
1
vote
1answer
747 views

Converting geometry to geography using org.geotools.geometry.jts.JTS?

I'm trying to convert com.vividsolutions.jts.geom.Geometry to geography, using the GeoTools package - org.geotools.geometry.jts.JTS. This is my code: public Geometry getGeography() { Geometry geo ...
2
votes
1answer
142 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
94 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
1answer
61 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 ...
3
votes
1answer
21 views

Understanding GML structure for validation

I'm failing to convert this GML v3.2 XML and I'm not sure why: <?xml version="1.0" encoding="UTF-8"?> <gml:MultiGeometry xmlns:gml="http://www.opengis.net/gml" srsName=""> <gml:...
1
vote
0answers
34 views

Topology Error building polygon

I retrieve a response from the wfs_gnde from BKG in Germany using the following URL and request. http : // sg.geodatenzentrum.de / wfs_gnde <GetFeature version='1.1.0' service='WFS' ...
2
votes
1answer
53 views

Adding filter functions in place of a literal expression in GeoTools?

I'm writing some code to use filter functions in geotools. (attName >= replacementFunc() AND title LIKE replacementFunc()) AND attName2 = replacementFunc() In the area that says LIKE I get a ...
0
votes
1answer
64 views

Weird behavior using org.geotools Filter

I am using filter to catch all the features who fall into a specific polygon. My collection is in EPSG:32632 coordinate reference system and it is located somewhere in this bounding box: xMin, yMin ...
2
votes
1answer
33 views

Find the coordinates of the max n values of a raster layer

I have a Geotiff file which is published as a raster layer in Geoserver. I need to be able to calculate the coordinates of the max n values that are inside a given polygon. I have found a WPS called ...
0
votes
0answers
7 views

NullPointerException when using geotools org.geotools.xsd.PullParser? [duplicate]

I am using below code to parse a kml file. I am using geotools 21.0 and org.geotools.xsd.PullParser. I am getting a nullpointerexception on line SimpleFeature simpleFeature = (SimpleFeature) parser....
2
votes
1answer
100 views

Converting from UTM to WGS84 using GeoTools?

I have created a function that reads a shapefile file and I get its geographic coordinates well. This works fine. My problem is that I need those coordinates in wgs84 format (latitude, longitude), but ...
1
vote
1answer
23 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
1answer
185 views

Convert Esri ASCII grid raster to WKT polygons efficiently

I need to transform a large number of Esri ASCII grid files to polygonized WKT format, e.g. as CSV. Currently, I use GeoTools with the ArcGrid reader and a polygon extraction process. For parallelism ...
1
vote
1answer
17 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
1answer
49 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 ...