Questions tagged [geotools]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
192 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
80 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
306 views

Convert OSM into shapefile with GeoTools?

Is it possible to convert the OSM file to shapefile with GeoTools in Java?
1
vote
1answer
149 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 ...
1
vote
1answer
112 views

Return A Path from multiple point in Geomesa

I am trying to visualise the historic of a vehicle in a specific area , I am writing now a query to get all points off a this vehicle in this area with this : FeatureStore feature = (...
0
votes
1answer
107 views

Is there any method to create WMTS GetCapabilities response in xml using java libraries?

I am creating WMTS server side. The problem is that I cannot find any solution where I will be able to generate GetCapabilities xml response in java using some libraries like geotools or similar. Can ...
1
vote
1answer
125 views

GeoTools: Encode into GML 3 not working

I want to use GeoTools to convert collection of SimpleFeature objects to GML 3.2.1 geometry. However, I'm dealing with this: Creation of XSD works with both GML 2 and 3. Creation of GML works only ...
0
votes
1answer
90 views

Taking an arbitrary object in Java and creating a shapefile out of it?

Let's say I have a data class in Java that essentially has title geo (WKT String) Other irrelevant metadata I want to create shapefile from lists of these types of objects using something like ...
0
votes
2answers
72 views

How to combine multiple mysql tables data resultset for geoserver?

I need to extract data from multiple tables, choose whether to remove duplication or add up according to the business rules. I have read some related GeoTools documents, such as ContentDataStore. But ...
1
vote
0answers
73 views

GeoTools: grid transformation using NTv2Transform - error locating grid file

I'm trying to use GeoTools library to calculate the grid coverage based on NTv2 .gsb file. However, I'm unable to create the instance of NTv2Transform. When I use this piece of code: File gridFile =...
4
votes
1answer
164 views

Geotools FeatureReader - Initial memory consumption problem

I am using a FeatureReader to access features from a PostGis source using the following code: DataStore dataStore = DataStoreFinder.getDataStore(postgisParams); Transaction transaction = new ...
0
votes
1answer
70 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
217 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);...
1
vote
1answer
157 views

Geotools 12.3 - Create DataStore from WFS Service ArcGIS Server

I'm trying to create a DataStore in Java with Geotools 12.3. With WFS services in geoserver works fine, but with WFS services in ArcGIS doesn't work at all. This is the exception: WARNING [net....
2
votes
1answer
82 views

Geotools & Natural Earth finding lat/lon not always accurate

I am trying to take a lat/lon and find which country the lat/lon is located in. Below is a boilerplate of code I found to accomplish this, which was found in this post (Reverse Geocode latitude ...
1
vote
0answers
49 views

Geotool Shapefile onto Unfolding Maps [closed]

Are there any ways to add a Shapefile layer using Geotools onto a map which created by Unfolding Maps? Or do I need to convert the shapefile(.shp) into other forms first?
2
votes
2answers
994 views

GeoServer:Rendering process failed java.lang.AbstractMethodError

I'm using GeoServer2.13.1 with SQLServer DataSet and war deployed on Tomcat8.5.31. After configuring dataStore while the preview Layer getting the following Exception: Rendering ...
1
vote
1answer
138 views

SimpleFeatureType.getCoordinateReferenceSystem() == null after building type

I tried to build new type, but SimpleFeatureType.getCoordinateReferenceSystem() returns null //create polygon GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory( ); ...
1
vote
1answer
617 views

Geometry from wkt/polygon using geotools

I have polygon string ,how can I find geometry by giving polygon as input,Is there any function like we have ST_GeometryFromText('POLYGON ....) in postgis ,which give geometry.
1
vote
1answer
123 views

Geotools creating polyhedral surfaces from polygons

I have polygon geometries that represent building footprints in a shapefile and I want to extrude them according to an attribute "height" and turn them 3B objects as polyhedral surfaces via extrusion. ...
3
votes
1answer
71 views

Problem while closing a geotiff file

I have a method where I open a geotiff file and print its dimensions public void parseAndSaveFile(String pathFileToParse) throws IOException, Exception { GridCoverage2DReader reader = ...
1
vote
1answer
95 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 ...
1
vote
1answer
411 views

Closing shapefile using org.geotools.data.shapefile.ShapefileFeatureReader gives warning?

When working with shapefiles, i get this "warning" WARNING: There is code leaving shapefile readers unclosed, this might result in file system locks not being cleared. File is: chranene_uzemi_cr ...
1
vote
1answer
399 views

Not able to parse ExtendedData from KML file using geotools

We are trying to parse below KML file to retrieve simpleData and geometry. <?xml version="1.0" encoding="utf-8" ?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Document><Folder&...
0
votes
1answer
127 views

What is the projection of my raster?

Continuing what is written in this post, I show gdalinfo output Size is 1200, 1400 Coordinate System is: PROJCS["unnamed", GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",...
1
vote
1answer
93 views

Failing to use GeoTools to transform from WGS84 UTM 43N to WGS84

I am trying to transform a Polygon from EPSG:32643 to EPSG:4326 using GeoTools version 15.1. However doing so, I seem to get incorrect values, and I cannot work out what is going wrong. The source ...
2
votes
1answer
819 views

GeoTools (Java) read properties from ESRI shapefile at specific coordinates

This is my first time using GeoTools and I have a 3 simple things I need to get from .shp files which I'm reading with my program. I need to know in specific coordinates (latitude/longitude). ...
2
votes
1answer
422 views

Obtaining longitude and latitude from GeoTIFF with geotools

Continuing what is written in this post, I have another question: for each point (X, Y) of my GEOTIFF file I extract the coordinates as follows: Envelope2D pixelEnvelop = geometry.gridToWorld(new ...
1
vote
0answers
93 views

Grid shift transformations based on GSD and GDX files (like cs2cs does)

My main goal is to achieve the same conversion as to the following command using geotools. cs2cs -f "%.7f" +init=epsg:23700 +nadgrids=etrs2eov_notowgs.gsb +geoidgrids=geoid_eht2014.gtx +to +init=...
1
vote
1answer
590 views

Reading GeoTIFF with geotools

I have a geotiff file and I use geotools library for parsing it. This is my code: File f = new File("myFile.tif"); ParameterValue<OverviewPolicy> policy = AbstractGridFormat.OVERVIEW_POLICY....
1
vote
1answer
180 views

GeoTools includes repeated prefix in GML output

When attempting to write out GML encoded features that were originally collected using the Geotools WFS plugin (gt-wfs-ng), it looks like the GML output is incorrectly duplicating the feature's prefix ...
2
votes
1answer
107 views

geotools hillshading dem

I'm currently trying to apply shade relief effect to dem raster layer(geotiff format, one band with float samples, min and max are around 77 and 100) using geotools. I've tried diffrent parameters ...
1
vote
1answer
132 views

Converting polygon geometries to polygonz geometries using GeoTools?

I have a shapefile which contains a lot of polygon records. These polygon geometries contains points which has x and y coordinate pairs. I want to add z values (z=0) for every polygon points thus I ...
1
vote
1answer
622 views

How can I extract bbox of polygon geometries in a shapefile using geotools

I have a shapefile which has building footprints as polygon features. I want to read shapefile and extract these bbox of these polygon features using geotools. So far I read shapefile but I don't know ...
1
vote
1answer
172 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 ...
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 ...
1
vote
1answer
69 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 ...
2
votes
2answers
260 views

Geoserver: Can't add a JPG MBTiles file

I have an MBTiles map that is created by MOBAC, its tile format is JPG. I'm trying to add this map as an MBTiles store to Geoserver, but I'm receiving the following error when I'm clicking "Save" the ...
3
votes
1answer
121 views

Color polygons in different colors using geotools

I need to color polygons in different colors, ensuring that polygons sharing boundaries do not have the same color (the well-known four color theorem). Is there a way to do that using GeoTools?
4
votes
1answer
1k views

Combining neighbor polygons (NOT touching) making one using JTS/GeoTools?

This question is similar to: Combining touching polygons, keeping all attributes from Class "A" feature, using ArcGIS Desktop? and Combining adjacent polygons sharing similar trait into ...
2
votes
3answers
2k views

JTS GeometricShapeFactory generate an ellipse properly

This is what use to get a circle: GeometricShapeFactory shape = new GeometricShapeFactory(gf); shape.setCentre(new Coordinate(40.748754,-73.985460));//Empire Sate Building shape....
2
votes
1answer
663 views

Remove intersect/touch from polygons, to making one with JTS/GeoTools

Is there a way to remove an overlap from multiple polygons to make one final polygon?..programmatically, I am using the GeoTools or/and OpenGIS/JTS.. any ideas to put me on the right path... example ...
3
votes
1answer
344 views

Extracting Z-Values from SHP with geotools and vividsolutions?

I use the java libraries geotools and vividsolutions to extract xyz data from a shapefile (Vienna from this example). This works perfectly fine for x and y data, but all coordinate values for z are ...
1
vote
0answers
39 views

Use GeoTools to read WaterML files

I want to read WaterML 2.0 time series. I am totally new to WaterML but I read it rely on GML 3.2. It would be great to use GeoTools to do that, maybe extending the GML classes. Is there some docs or ...
2
votes
0answers
223 views

Handling NetCDF with geotools

I'm experimenting about netcdf and how to convert them in a feature collection. My primary tool is geotools ver. 17.2. Moving my very first step was to bring these two dependencies: ... <...
1
vote
1answer
124 views

GeoTools performance achivments

I use 9 base map layers from .SHP, .SLD, .DBF and etc. files. Their common HDD-size is 134 MB. And I faced with a perfomance issue on my PC. It takes aboout 20-25 seconds to zoom or to move the map, ...
2
votes
1answer
2k views

Geotools with maven: java.lang.noclassdeffounderror while starting app's jar

In my Idea everything works fine but when I try to start my jar which was built by maven there are some errors: 1 - Caused by: java.lang.RuntimeException: Exception in Application start method 2 - ...
1
vote
1answer
538 views

Getting WFS features with filter case insensitive?

My goal is to perform search using filtered WFS attributes. I am using GeoServer 2.5, WFS version 1.0.0, GeoTools version 8.7. I found two solutions that should work according to the description that ...
2
votes
1answer
52 views

Geotools RPFTOCReader NegativeArraySizeException in reading raster

System: Eclipse IDE in Windows 10 VM Java 8 My code segment that the exception is being thrown: private void displayLayers(File rasterFile) throws Exception { Hints hints = new Hints(); ...
1
vote
2answers
261 views

GeoTools UnsatisfiedLinkError in display raster layer of RPF data

Background: Used this tutorial as base System: Eclipse IDE in Windows 10 VM So I have some RPF data that I'd like to display within a JFrame. Right now I'm trying to figure out a way of just ...