Questions tagged [geotools]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
109 views

How create String primary key with GeoTools?

I'm developing a gis app with geotools 19-SNAPSHOT. I want to get some gis data from another app. After getting data, save them in local db. Received data has a String primary key as follow: @Id ...
1
vote
0answers
108 views

Geotools quickstart tutorial not displaying map

I am getting started with the Geotools quickstart guide: http://docs.geotools.org/latest/userguide/tutorial/quickstart/eclipse.html I have followed every step but when I run the application I get a ...
1
vote
1answer
35 views

Geoserver/geotools DB2 extension support

I'm evaluating the migration of a postgis/postgres database to a DB2 spatial db. A Geoserver instance is connected to the postgis datasources, so I know there is an extension available for making the ...
1
vote
1answer
101 views

GeoTools TileServer implementation for Google Maps [closed]

GeoTools TileServer has implementations for OSM and Bing. Is there one for Google Maps?
2
votes
1answer
186 views

Geotools: Rendering map with sld to svg

I am generating the SVG file and then use it in jasper report print. When I try to render the map with no sld everything works great, but when I use sld there is this error: 2017-11-30T13:28:36.634+...
3
votes
0answers
144 views

Java GeoTools read VRT file

I am trying to read a GDAL VRT file. I have included <!-- VRT Format (reader) --> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-...
1
vote
1answer
428 views

Geotools always return Multipolygon type for shapefile

I want to know the true type of Geometry using GeoTools (point, polygon, multipolygon). GeoTools always returns me as a MultiPolygon, and my object has this format for example: "geometry": {"type": "...
5
votes
2answers
341 views

SLD - break in hatch

When I use rotated horline or vertline like @Ian Turton suggested in his answer to question Rendering sld style(buffer) SEVERE null java.lang.NegativeArraySizeException, then I get breaks in the hatch,...
1
vote
1answer
207 views

Rendering sld style(buffer) SEVERE null java.lang.NegativeArraySizeException

Can somebody help me with this error, it throws it when rendering an object and styling it with use of a buffer (sld style, wkt string). So I suppose that some problem is with buffering but was unable ...
3
votes
1answer
553 views

Why does geotools DataStoreFinder return null jdbc dataStore

I want to create a JDBC DataStore with these parameters: Map<String,Object> params = new HashMap(); params.put("dbtype","postgis"); params.put("host","localhost"); params.put("port",5432); ...
2
votes
1answer
138 views

Interpolate no data values

I have GridCoverage2D object built from the two-dimensional float array: float[][] myData = new float[dataH][dataW]; ... // fill myDdata array ... ReferencedEnvelope env = new ReferencedEnvelope(-...
4
votes
1answer
632 views

WFS geotools Hashmap can not be parsed to SimpleFeature

I'm trying to implement a WFS client in Java using the Geotools. But everytime I tried to read the actual features I get following Error java.lang.ClassCastException: java.util.HashMap cannot be cast ...
1
vote
1answer
43 views

Comparing crses with geotools

none of these two unit tests runs fine but they both were supposed to. public class CompareCrses extends TransformationTest { @Test public void comparingCrses() throws Exception { ...
2
votes
1answer
128 views

Thiessen Polygon - geotools

I need to create Thiessen Polygon from a point collection and then intercept them with other polygons. I need to do this from a java program. I'm using the Geotools library. I was able to load the ...
1
vote
1answer
154 views

Reprojecting envelopes tests runs fine on eclipse but fails on maven

I'm trying to reproject an envelope from EPSG:4326 to EPSG:32632. I code down some tests and run them. They works, fine. Then I run again my tests with mvn clean test and they fails. This is weird. ...
0
votes
1answer
206 views

Erroneous transformation with Geotools

I encountered a very odd result while reprojecting simplefeatures with Geotools: I have data of Vienna (Austria) from Open Street Maps in SRID:4326 (WGS84) in a shapefile. I load the data into a ...
0
votes
1answer
322 views

Angle between 2 lines with each line represented by set of lat/lon pairs

I'm really new to GIS and i'm interested in finding angle between 2 lines. Each line is represented by start location(lat/lon) and end location(lat/lon). Could some one point to an algorithm or any ...
3
votes
1answer
186 views

GeoTools extract band

I have a tiff image with 4 bands (Red, Green, Blue and Infrared) and I need to extract two of them. I want to input one image and split it and make two images. I want to do it with GeoTools since I ...
3
votes
1answer
40 views

PolarStereographic cannot set latitudeOfOrigin (standardParallel) in Geotools

We have geotiff file with metadata as below, and we are not able to create the proper PolarStereographic coordinate system. PROJCS["unnamed", GEOGCS["WGS 84", DATUM["WGS_1984", ...
1
vote
0answers
71 views

Encode a shapefile in gml 3.2 [duplicate]

I am not so seasoned about gis and geotools, I am trying to encode a feature collection obtained by a shapefile in gml 3.2. Here is my code: @Test public void transformAccumuliDiFranaShapeToGml32() ...
1
vote
0answers
30 views

How to get the value of longitude/latitude if I already know one of them for a road on a map of roads contained in a shapefile using java? [closed]

I've shapefiles containing a map of roads. I need to get the value of latitude on a given road if I already have the longitude in java. Similarly, the value of longitude if I already have it's ...
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 ...
4
votes
1answer
460 views

Reproject features with geotools

is there a way to reproject a feature collection into a new one with another coordinate reference system? I am trying to achieve this by using geotools's reprojector: SimpleFeatureSource ...
0
votes
2answers
124 views

Build tiles from a feature collection

I am trying to create tiles given a collection of features. UPDATE Let's say I got two tiles per zoom level 1 and my features are about a small area near Berlin. I expect one of the two tiles empty ...
1
vote
0answers
237 views

Getting Error on GeoServer :Error obtaining new data store and Exception [closed]

Here is i added GeoServer Log WARN [data.store] - Error obtaining new data store Caused by: java.lang.NumberFormatException: For input string: "9090/mapd" at java.lang.NumberFormatException....
1
vote
0answers
19 views

Can I create extension for mapd database? [duplicate]

I want to create extension for mapd database to access from geoserver. so I want to make sure mapd support GeoServer or not?
1
vote
0answers
14 views

How to use JDBC based database extension of GeoServer for other JDBC based database? [duplicate]

I'm doing R&D on GeoServer for my project requirement to access JDBC based Database(MapD). So to do that GeoServer provided some extension for particular database access extension like JDBC based ...
3
votes
1answer
135 views

How to connect and access Mapd Database by GeoServer

In my project requirement to access table data from Mapd Database on GeoServer Mapd(GPU Based database) Database documentation link: https://www.mapd.com/docs/latest/mapd-core-guide/users-and-...
0
votes
1answer
163 views

Deal with large GML files with GeoTools

I am not so seasoned at GeoTools libs, I am trying to transform a large (near 60K features) GML file. I want to change its CRS and features coordinates accordingly. The code I have is basically this: ...
2
votes
0answers
215 views

reading .tif and .tif.aux.xml as a whole using geotools

I have sample.tif, sample.tif.aux.xml, sample.qml files in a directory. The .qml and .xml files contain classification data about .tif file. For example my .xml file is something like this: <...
0
votes
1answer
346 views

Communicating with Java Class from OpenLayers 3 UI?

I have an OpenLayers 3 map and I am using Geoserver to host that map. So far, I have mostly frontend related tasks for my mapping application. Now, I need to include zonal statistics feature in my ...
0
votes
1answer
195 views

Convert GeoJSON to GML using an old GeoTools library

I'm trying to convert a GeoJSON file to GML 3.1.1 using an old org.geotools lib. geotools lib are 2.7.0 version. Sadly, upgrading is not an option. Here is the relevant part of my code: ...
0
votes
1answer
362 views

Converting images to different file formats using GeoTools

After searching through GeoTools documentation and following their tutorials, I have failed to find a class that can convert images to different format (for example translate a .tif to .jpg). Does ...
1
vote
1answer
178 views

JMapPane doesn't update after adding new layer

After adding a new layer it doesn't show inside JMapPane, is there a way to force this? I already tried using MapLayerEvent styleSld = Stil.createFromSLD(inputStream); layer = new FeatureLayer(...
0
votes
1answer
43 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 { ...
2
votes
1answer
665 views

Transform for geometry in JTS

I am using JTS in my application, and I want to transform the geometry from longitude and latitude to pixel. And the algorithm for this translation has been providered by an interface: public double[...
1
vote
0answers
99 views

Problem with parseWKT : projection mercator-2SP

1 -CoordinateReferenceSystem crss = CRS.parseWKT("PROJCS[\"Mercator\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\"," + "SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]]," ...
3
votes
1answer
252 views

Problem importing KML generated with geotools into qgis

I have a problem importing an kml 2.1 file generated with geotools 17.1 into qgis 2.8. Qgis refuses to import, google earth imports it and if I save it in google earth qgis is willing to import it. ...
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 ...
0
votes
0answers
67 views

Cropping GeoTIFF with GeoTools - remove NO_DATA border

I have a raster with borders full of NO_DATA value. Is it possible to crop a raster over a "minimum" bounding rectangle, Legend: * - no data, + - data ******* * ++** -> ++ * ++** ++ *****...
1
vote
1answer
173 views

Gridded CSV to Raster using Geotools

Could someone please point me in the right direction for creating a geotiff DEM with Geotools that from gridded X,Y,Z coordinates. I am currently doing this with: GridCoverage2D coverage = new ...
3
votes
1answer
167 views

Understanding gdalwarp reprojection

My file is Driver: GTiff/GeoTIFF Files: 0001.TIF Size is 8512, 8622 Coordinate System is: PROJCS["WGS 84 / UTM zone 31N", GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",...
3
votes
1answer
253 views

Why is the use of memory mapped buffers in shapefile data stores not recommended on Windows?

When creating a shapefile data store, you have the option to enable 'memory mapped buffers'. Both GeoServer and GeoTools recommend to disable this on Windows. GeoServer docs: Enables the use of ...
3
votes
1answer
351 views

Adjust GeoServer/Geotools Heatmap code, to show it as tiled WMS

I try to change the GeoTools HeatmapProcess.java and HeatmapSurface.java classes (https://github.com/geotools/geotools/tree/master/modules/unsupported/process-feature/src/main/java/org/geotools/...
0
votes
1answer
773 views

ID for Feature in GeoJSON

The geotools library's GeoJSON plugin requires an ID to generate a Feature type. The specification of GeoJSON says it is a SHOULD and not a must. I'm trying to get rows from a database like SQL Server ...
4
votes
1answer
448 views

Using GeoTools to open Esri File Geodatabase (FileGDB)?

How can I open an Esri File Geodatabase (FileGDB) in GeoTools?
1
vote
1answer
471 views

Geotools Point to Text with srid

Can I convert a geometry point to wkt including the srid formatted. See below the example. "SRID=4326;POINT(-43.9725637435913 -19.9411078674228)". Although I tried to put point.toText() only return ...
2
votes
0answers
76 views

Using Geoserver extension CSVDataStore alters existing data store types [closed]

I am trying to create a custom extension into Geoserver which will act as a datastore. Being new to GeoServer, I have started with the CSVDataStore tutorial from the GeoTools website. I have ...
1
vote
2answers
494 views

How to read geopackage tiles using Geotools

I want to read tiles from a geopackage file using Geotools (v. 17.0). I found the class GeoPackageReaderTest.java on GitHub and modified the example to read tiles from my file: // try to read ...
1
vote
1answer
360 views

Java GeoTools: Creating Shapefile - FeatureCollections deprecated

I'm trying to create & populate Shapefile in Java using GeoTools. Basically following this link (quite similar to the official documentation & other tutorials specifically for the point I'm ...