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
40 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
53 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
134 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
419 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
91 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
31 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
96 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
971 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
33 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
171 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
97 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
44 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
56 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
50 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
30 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
34 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
64 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
40 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
84 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
240 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
49 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
91 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
46 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 ...
1
vote
2answers
166 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
70 views

Generating legend from sld

I have and SLD with following rule <se:Rule> <se:Name>Primary Pole</se:Name> <se:Description> <se:Title>Primary Pole</se:Title> </se:...
1
vote
1answer
38 views

AUTO:42003 Orthographic projection outside valid area

When running the following code to reproject a epsg:4326 countries file to orthographic: newCRS = CRS.decode("AUTO:42003,1,-100,45"); mapFrame.getMapContent().getViewport()....
0
votes
1answer
33 views

GeoTools MapFrame statusbar set reference system list empty

I'm using geotools.version = 20.0. After debugging the set reference system functionality, the following is executed but the codes list is empty: CRSAuthorityFactory fac =ReferencingFactoryFinder....
0
votes
1answer
73 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
139 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
-1
votes
2answers
165 views

Support for WFS 2.0 in QGIS 3.2.3 or geotools [closed]

I have problem with this WFS server: http://mapy.geoportal.gov.pl/wss/service/PZGIKINSP/httpauth/rest/services/PZGIK/PRG/GeoDataServer/exts/InspireFeatureDownload/service?service=WFS&request=...
1
vote
1answer
115 views

Get UTM Zone from GeoTIFF (geotools java)

I've loaded a GeoTiff successfully in with geotools (21-SNAPSHOT), but I'm having trouble accessing the referenced UTM zone. The code to read in the file is here: File tiffFile = new File(filePath); ...
1
vote
1answer
46 views

FeatureJSON is not setting bounds

I am using FeatureJSON from geotools to read in a GeoJson file containing a FeatureCollection and convert it to a SimpleFeatureSource. It all works fine except the feature bounds are null, so if I try ...
1
vote
1answer
58 views

Identifying dangles and hanging roads in a map in geotools

Is it possible through geotools to identify and mark all the dangles and hanging roads(lines) in a .shp file representing a map. Any example would help me proceed forward. So far I have found the ...
2
votes
1answer
253 views

Creating buffer around features using GeoTools?

I want to develop a simple GIS application using GeoTools. I have looked at the tutorials but i could get to much meaningful from them. I have a simple JMapFrame to which add can add a featureLayer ...
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 ...
3
votes
1answer
69 views

Geotools: Set custom primary key

I have a script which reload data from dbf file and create a new table in postgres database using geotools plugin. My problem is when geotools reload fields name from the file it adds a new field fid ...
1
vote
1answer
148 views

Comparing two shapefiles(layers) and display the differences in features in MapContent object in GeoTools

I am working with GeoTools libraries to implement GIS features. Here, I have two different shapefiles and I want to generate a new separate layer containing the differences between the two shape files....
1
vote
1answer
33 views

Create a Feature from a Boundary

I'm attempting to create a Feature based on a Polygon defined by a ReferencedEnvelope of the provided Feature (in this case a country). However I am seeing a CRS error NoSuchAuthorityCodeException: ...
2
votes
0answers
128 views

Add new attribute in shapefile using Java: Geotools [duplicate]

I want to edit my shapefile by adding a new column "ID" and assign a value to it. I am trying to achieve this using Java Geotools. Here is the snippet code: File inFile = new File("/abc".shp"); ...
2
votes
1answer
100 views

Speed up Geotools Vector Grid processing

I am using Geotools Vector Grid on a FeatureSource (shapefile) that been projected to "AUTO:42001". Units for the map are then in one meter increments. When the FeatureSource is a large country (like ...
1
vote
1answer
88 views

Get area and perimeter of 3D plane using JTS library

is there any Java API in Geotools JTS lib for calculating area of 3D plane? Same about Line, where points have three dimensions.
2
votes
1answer
73 views

Storing geometry from a layer into a geopackage file with geotools plugin

How can I store a geometry to a geopackage file? FeatureIterator<SimpleFeature> fi = getLayer().getFeatureIterator((Envelope) null); GeoPackage geopkg = new GeoPackage(...); geopkg.init(); ...
2
votes
1answer
225 views

Can't export feature attributes to KML

I am trying to export my feature collection to KML using geotools but only the geometry and id(weird id combination of table name + id) is exporting to KML i am getting the data from postgis and then ...
1
vote
0answers
39 views

Automatic slice of polygon

I have a data source, that sometimes returns geometries which are not properly cleaned e.g. the pink polygon is only 0.02 cm wide and is always on the edge of the whole geometry which consists of the ...
0
votes
2answers
706 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
110 views

Get z value for a point of polygon using JTS library?

I have a polygon described with coordinates which have z value. Is there any JTS utility that would allow me to get Z value for a coordinate which is inside the polygon? I have a function for doing ...
1
vote
1answer
167 views

Transforming a single-band GeoTIFF into an RGBA PNG file using GeoTools

I'm fairly new with GeoTools. I'm using it in order to generate GeoTIFF files that have a single band, with values between -1 and 1, or NaN. An example of such a file is available here: https://m-...
4
votes
1answer
69 views

How to get raster metadata use Geotools just as gdalinfo do?

Is there anyway to get raster file's metadata, such as pixel size and nodata value of a GeoTIFF file, use GeoTools in a Java program? Now, I can get the Coordinate Reference System and Envelope's ...
2
votes
1answer
294 views

Convert OSM into shapefile with GeoTools?

Is it possible to convert the OSM file to shapefile with GeoTools in Java?
1
vote
1answer
139 views

geotools vector grids example

I've been going through the GeoTools tutorials and have read the Vector Grids page http://docs.geotools.org/latest/userguide/extension/grid.html I am trying to replicate the maps shown on this page ...