Skip to main content

Questions tagged [geotools]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
28 views

How to create layers from mongo collection with more than one geometry field in MongoDB plugin

I'm using the MongoDB GeoTools plugin on GeoServer 2.25. I can successfully expose one if my collections as a layer in GeoServer with a single geometry in it. However, I want to expose a collection ...
cbrautigam's user avatar
0 votes
0 answers
33 views

GeoMesa Custom iterator

I am looking to create a custom iterator under GeoMesa’s library in Scala. Will this iterator run at Accumulo’s tablet server level? I want to ensure that the processing of the custom iterator runs at ...
Flame's user avatar
  • 1
0 votes
1 answer
17 views

Parsing shapefile from InputStream rather than from disk file using Geotools

I upload shapefile.zip from local to backend of Springboot. Now I can write this shapefile.zip to disk firstly and unzip it. Then to read the shapefile from disk and convert it to ShapefileDataStore ...
George's user avatar
  • 11
-2 votes
1 answer
26 views

Why are my layers not showing up in MapContent?

I'm entering the last few hours to defend my thesis (for college). I have written everything, but a huge problem is happening, why are the Layers not displayed when I add them to the MapContent from ...
Sergej Lav Bojanić 2022's user avatar
-1 votes
1 answer
32 views

Why is my CursorTool not working?

Now I want to draw lines, and I tried the advice from @ianturton, but the extension of CursorTool doesn't work for me. The onMouseClicked method does nothing when the mouse is pressed, I check this by ...
Sergej Lav Bojanić 2022's user avatar
1 vote
1 answer
31 views

Storing SimpleFeatureStore to shapefile when the attribute names are longer than 10 characters

When I, with the code below, try to export a SimpleFeatureSource to a SHAPEfile attribute names with more the 10 characters will be truncated, due to the shapefile format (e.g FEATURE_TEXT -> ...
Paul Malm's user avatar
-1 votes
1 answer
31 views

Ensuring geometries read from shapefile contain only Coodinate objects instead of CoordinateXYZM using Java GeoTools

I recently upgraded GeoTools library from version 22.1 to 31.1. Since upgrading, I'm getting lots of exceptions "Invalid ordinate index: 3" during my program execution. After some ...
Martin's user avatar
  • 87
0 votes
1 answer
45 views

Accumulo/GeoMesa GeoTools API Iterator

Is there a way to call an Accumulo(https://github.com/apache/accumulo/tree/2.1/core/src/main/java/org/apache/accumulo/core/iterators) or GeoMesa (https://github.com/locationtech/geomesa/tree/main/...
Flame's user avatar
  • 1
0 votes
0 answers
44 views

Can't parse this CRS_WKT

When I try to load EPSG:6871 i get the folowing error code: Failed to get coordinate reference system for code 6871 Question: Instead I would like to try this (see below) WKT-CRS (copied from QGIS) ...
Paul Malm's user avatar
0 votes
1 answer
35 views

Can GeoTools parse GML geodetic shapes?

I am trying to parse different GML definitions, according to the geodetic shapes defined in RFC-5491. Points and polygons are parsed OK with GeoTools parser: Configuration configuration = new ...
llmarti's user avatar
  • 11
1 vote
0 answers
26 views

Geotools checkCoordinatesRange() not throwing exception for certain CRS?

I am having trouble understanding how the function checkCoordinatesRange(Geometry, CoordinateReferenceSystem) works (Geotools to JTS). I was expecting it to throw an error when the coordinates are ...
zhak6751's user avatar
1 vote
1 answer
29 views

How to use GeoTools GML types in pidf-lo generated classes

Using shape classes generated from opengis https://schemas.opengis.net/gml/3.1.1/profiles/geoshape/0.1.0/ results in classes using this generated values, i.e: public class PrismType extends ...
llmarti's user avatar
  • 11
0 votes
1 answer
32 views

Geotools GML 3.2 Parsing to Geometry - does geotools suport all GML3.2 types?

currently I'm trying to parse a couple of GML3.2 data to Geometry. Example 1: <gml:Ring xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
Aleksandar Mitev's user avatar
0 votes
1 answer
28 views

How to calculate the shortest geodetic(orthodomic?) distance from a Point to LineString using GeoTools?

First of all, sorry if used wrong terms. I have a LineString on and I need to calculate the shortest distance to it from a Point using java GeoTools library. I don't need just geometric distance, ...
acanthite's user avatar
1 vote
0 answers
13 views

How to render PGRaster with overviews?

I've imported testimp.tif into my PostGis database with raster2pgsql (overviews 2,4). The raster tables I now have in my db are testimp, o_2_testimp and o_4_testimp. This is how I add the raster in my ...
Paul Malm's user avatar
0 votes
1 answer
17 views

Can't find PGRasterConfig

When I shall create a PGRasterReader I must first create a PGRasterConfig, but I can't Import this class. PGRasterReader is imported ok. Isn't PGRasterConfig included in gt-postgis-raster? public ...
Paul Malm's user avatar
0 votes
1 answer
23 views

what artifactID shall I use in pom

I'd like to try org.geotools.gce.pgraster but I cant find wich ArtifactId I shall enter in my pom.xml. How can I find out this?
Paul Malm's user avatar
0 votes
0 answers
23 views

How to load a StyledLayer with raster data from PostGIS

I have created a table in PostGIS with raster data. I can't find any information about how I can create a StyledLayer with that rasterdata? I've tried this... but its not the correct way: ...
Paul Malm's user avatar
0 votes
1 answer
17 views

Reprojecting GeoTools TileLayer

I connect to a tileService (OpenStreetMap) which I understand is in Mercator projection. This shown correct in EPSG:3395 and EPSG:4636. then I zoom in to a view inside the extent of UTM33N and change ...
Paul Malm's user avatar
0 votes
1 answer
21 views

How to make a (GeoTools) StyleLayer from a (Geotools) TileLayer

I'm trying to connect to OpenStreetMap by connecting a GeoTools gt- tileService to the URL = http://tile.openstreetmap.org, but an excepion accurs when I'm trying to cast the layer to a StyleLayer . ...
Paul Malm's user avatar
3 votes
1 answer
89 views

How to connect to OpenStreetMap WMTServer

I'm trying to connect to OSM, via the URL "https://tile.openstreetmap.org/{z}/{x}/{y}.png", with GeoTools WMTS (gt-wmts-28.0.jar). I can connect to a WebMapServer, but now I'd like to add ...
Paul Malm's user avatar
0 votes
2 answers
45 views

Cannot parse OGC WKT2 file

I am trying to parse a OGC WKT 2 string downloaded from https://epsg.io/5822 (shows in the Export - OGC WKT 2 section of the page) I tried to parse it using geotool's org.geotools.geometry.jts....
Vladimir Smogitel's user avatar
1 vote
1 answer
39 views

What is wrong with my CQL-filter

Im making a simple test with CQL in my GeoTools application. This is the first time I'm trying to use CQL, and I cant get it to work. String filterText = "IN ('TIA.7','TIA.6','TIA.8','TIA.9','TIA....
Paul's user avatar
  • 475
1 vote
1 answer
28 views

Is there a function in GeoTools to remove unnecessary break points?

I have a layer with LineStrings, those lines contains "unnecessary" break points which I would like to remove (it's a projected map). Is there a function for this in GeoTools, perhaps with ...
Paul's user avatar
  • 475
0 votes
0 answers
21 views

Achieving ArcGIS Dissolve result with GeoTools

I want to merge two or more adjacent lines (within a XY tolerance) to one line. The result from Dissolve in ArcGIS is what I aim for. How can I do that in GeoTools? See figure below.
Paul's user avatar
  • 475
1 vote
0 answers
25 views

GeoTools - cropping a coverage doesn't remove rings/holes. Is there a way?

Cropping a GeoTools coverage using a polygon geometry works well, for example, WKTReader wktReader = new WKTReader(); Geometry polygon = wktReader.read("Polygon ((-44.84843762765495967 23....
Simon Laws's user avatar
2 votes
1 answer
97 views

How can I determine point coordinate sysystem?

I downloaded GIS data from IPUMS NHGIS. The polygons points are for example: "[-1967092.8957,1446306.6612]" I attempted to convert automatically in https://mapshaper.org/ using "-proj ...
Jeryl Cook's user avatar
1 vote
0 answers
56 views

Geotools coverage warp

I have some small JPEG images that I wish to load as an image mosaic. I have programmatically created JGW files for each JPEG, and the files display correctly in QGIS. However, the affine transform ...
Chris Morgan's user avatar
0 votes
1 answer
36 views

Does Geotools support isobaric and isotherm lines drawing?

Is there any way to draw isobaric and isotherm lines with Geotools? Are there any examples how to do this in the official documentation or not?
rishab's user avatar
  • 3
0 votes
2 answers
533 views

Transforming geometry from EPSG:4326 (source CRS) to EPSG:3857 (target CRS - Leaflet's OSM default CRS)

My problem is I tried transforming from EPSG:4326 to WGS84, and it worked (just swap the axis order), and I also tried transforming from EPSG:4326 to EPSG:3875, and it worked too (the coordinates ...
Harry's user avatar
  • 11
0 votes
0 answers
67 views

How to print a map with gridlines and lables with geotools

I have create a map with geotools but the gridlines i don't know how to lable it. I saw a similar links Print a map with Geotools by @Youssef but did not get the full source code. Here is my code. 1. ...
John Assiamah's user avatar
0 votes
2 answers
115 views

GeoTools GML 3.2 serialization - how to access GMLConfiguration and GML namespace

I am using code similar to the sample below to serialize JTS geometries to GML 3.2. That works fine, but I can't see how to access the underlying configuration in order to control aspects of GML ...
Gunther's user avatar
  • 101
-1 votes
2 answers
123 views

Automate transects within polygon

I have a river polygon file and want to make transects parallel to the flow of the river. Transects can be any length, but must be 100 m apart from each other. I need enough transects to "cover&...
Jill's user avatar
  • 1
0 votes
0 answers
42 views

How to do Neighborhood Summary Statistics by Year in ArcGIS Pro

I am attempting to calculate neighborhood summary statistics for groups of administrative polygons for each year between 2002 and 2018 in ArcGIS Pro. In ArcGIS Pro the Neighborhood Summary Statistics ...
Matt's user avatar
  • 93
0 votes
0 answers
31 views

Read GML file with GeoTools 29.0 [duplicate]

I am trying to read the sample GML file in Java using GeoTools 29.0 but getting issue for finding data store. Can you share a sample on how to read GML file or parse it to WKT/GeoJSON in Java using ...
Vaishnav Kshirsagar's user avatar
0 votes
0 answers
48 views

Remove water ways and 'hug' the shores of polygon (postal boundaries)

I am trying to produce postal polygons that 'hug' the mainland instead of the polygon overlapping bodies of water. What is a good way to accomplish this? I've tried searching for 'water ways' ...
Jeryl Cook's user avatar
0 votes
1 answer
81 views

GeoTools error NumericConverterFactory and GeoServer 2.22.2 with Java 17

We've upgraded to GeoServer 2.22.2 (GeoTools 28.2, Java 17, Postgres 12.7 RDS, PostGIS 3.0.3, Tomcat 9.0.10). Everything runs well except that we get a GeoTools error for a WFS request with a Filter ...
Aleda Freeman's user avatar
1 vote
1 answer
52 views

Mismatch between individual point transformation and bounding box transformation

My goal is to transform a bounding box from EPSG:4326 to EPSG:32632. For the bounding box a ReferencedEnvelope is used. After the transformation I noticed that the resulting ReferencedEnvelope does ...
gillesB's user avatar
  • 149
0 votes
0 answers
158 views

Issue while reading single-band UInt16 GeoTIFF file using Geotools

I'm facing a strange issue while trying to open GeoTIFF files using Geotools library. Following simple code works for reading coverage in Byte, but raises an exception when I try to open UInt16 ...
Nicolas VILA's user avatar
0 votes
1 answer
129 views

Adding point features to an existing FeatureLayer

I have a FeatureLayer (point) to which I would like to digitize some points and add them to this layer. The FeatureLayer can have some attributes, e.g fid (int, primary key), Name (string) and ...
Paul's user avatar
  • 475
1 vote
1 answer
70 views

How to manually draw a line in Geotools Map Viewer example application

I would like to digitize a LineString in a "temporary" layer in GeoTools MapViewer example. I know that this is not a specific GeoTools problem I have, rather a java swing problem. But I ...
Paul's user avatar
  • 475
0 votes
0 answers
37 views

Rendering cursor image

How do I get the CURSOR_IMAGE (/org/geotools/swing/icons/mActionZoomIn.png) to be rendered as nice as the ICON_IMAGE(/org/geotools/swing/icons/mActionZoomIn.png) in GeoTools map example application? /...
Paul's user avatar
  • 475
1 vote
1 answer
177 views

Geotools GeoJSONWriter setEncodeFeatureCollectionCRS not giving any output

I have a very simple Test Class where I try to parse a simple Shapefile (just a few points) to a GeoJson. public class ShapefileToGeoJSON { public static void test() throws IOException { /...
geoidiot's user avatar
1 vote
0 answers
78 views

What rendering hints shall I use to get the map smoother?

I would like to render my maps a bit smoother. I use the shape file viewer example from GeoTools. And I would like to render it more like QGIS. Geotools origianally: QGIS: GeoTools and ...
Paul's user avatar
  • 475
0 votes
1 answer
34 views

How do I get the status of the StatusBarItem-Check box

I would like to add a checkBox for toggle drawing of a map grid (on/off) as a StatuBar item. the map grid should be drawn if the checkbox is set and if there has been an update of the mapPane. How can ...
Paul's user avatar
  • 475
0 votes
1 answer
24 views

How to add a new object in GeoTools JMapStatusBar

In Geotools map viewer example I'm trying to add a new object (ScaleBar) in the lower status bar (under the map window). I'm trying this: private static JMapStatusBar doCreateDefaultStatusBar(MapPane ...
Paul's user avatar
  • 475
1 vote
0 answers
29 views

Exception when defining Grid lines, using OrthLine [closed]

I've tried Ian's solution for question: Label coordinate position of Grid lines, but gets an exception when executing: SimpleFeatureSource grid = Lines.createOrthoLines(gridBounds, lineDefs, ...
Paul's user avatar
  • 475
4 votes
1 answer
145 views

WKT not using "metre" as measure unit in SLD

After solvig this question, seems WKT is not respecting my intent to use "metre" as measure of distance. I have this SLD: <FeatureTypeStyle> <Rule> <...
Magno C's user avatar
  • 2,150
0 votes
1 answer
45 views

Access and change SLD elements by code

Lets say we have this SLD in a file called "vessel.sld": <NamedLayer> <Name>Vessel Layer</Name> <UserStyle> <Title>GeoServer SLD Cook Book: ...
Magno C's user avatar
  • 2,150
1 vote
1 answer
66 views

Update Layer as I create new Features

Already read this but can't found any solution since many links are broken and coudn't find the "Flying Source Demo". My goal is to create a empty Layer at first and them going to put ...
Magno C's user avatar
  • 2,150

1
2 3 4 5
16