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
9 views

Factory error while trying to build DataStore with GeoTools

The project: Creating a simple java program that will handle the response of my WFS OGC server and display the image behind a given link. The link I use for generating an image: http://localhost:8180/...
1
vote
1answer
47 views

Buffer line between two coordinates with meters

I am trying to build a polygon (with long/lat coordinates) over a line between two points (long/lat as well). Basically what I used is line buffering with meters as an distance. However I have noticed ...
1
vote
1answer
56 views

Fix/Repair invalid Geometry

I'm loading a shapefile in an app through a frontend with OpenLayers and trying to save the geometry to an Oracle Database with Hibernate Spatial. The shapefiles that have valid geometry (validated ...
0
votes
2answers
56 views

Unexpected performance for OpenFileGDB driver compared with PostGIS

I am using GeoTools with OGR plugin to read .gdb data, and I found that the performance is rather horrible: Test code: public static void main(String[] args) throws MalformedURLException { ...
1
vote
1answer
25 views

Setting the charset with GeoTools in Java

I have a well-made geojson file. Of course it is well made with shapefiles. I want to set the charset when creating the shapefile. Below is part of the code. File outFile = new File("D:\\geojson....
1
vote
1answer
28 views

Validating schema of my XSD wth GML with GeoTools

I would like to control if my GML file is valid with my actual XSD using GeoTools. I found something here: GML2 Parsing TestSchema Example. But I don't know if it's a good way to do what I want. ...
1
vote
1answer
13 views

GeoTools and JTS dependency match

I currently use outdated versions of JTS and GeoTools in my Java application. GeoTools is used for parsing GML structures into JTS Geometry objects. However, I do not know how to update the libraries ...
1
vote
0answers
26 views

Exporting shapefile to DWG

I need export a shapefile to DWG using Java. I have seen many examples of how to export a DWG file to PDF, but I have not found any that directly export from shapefile to DWG . Is it possible to do ...
5
votes
1answer
32 views

How to add a legend, banner to shp file exported in PDF

I need add a legend, banner and signature to my shp file which is exported in PDF. My code: HashMap<String, Object> params = new HashMap<>(); params.put(ShapefileDataStoreFactory....
0
votes
1answer
17 views

Convert NIFC GeoJSON daily data to KML file using GeoTools

I am not able to convert the daily NIFC GeoJSON data into KML file using GeoTools lib. I am pretty new to GIS data. Sample GeoJSON data : https://opendata.arcgis.com/datasets/...
-1
votes
1answer
49 views

Convert shapefile to PNG using GeoTools

I need to know how to export a .shp file to .png in Java using geotools. I found an example here: Convert geojson to png. But I need convert shapefile to PNG.
4
votes
0answers
74 views

IndexOutOfBoundsException when using “in” function in GeoServer

I have trouble with the in filter function in SLD submitted to GeoServer. The root cause seems to be within the geotools. Currently we're using GeoServer Version 2.15.2 and GeoTools Version 21.2. The ...
1
vote
0answers
32 views

Reading, displaying and modifying a raster using Java

I am new to the Geotools library. The idea is to display and be able to modify a raster in java with the said library. I referred to the code of MARK. According to the description of the test class, ...
2
votes
1answer
45 views

Creating locationtech Geometry using org.geotools.geojson.geom.GeometryJSON

I am trying to create org.locationtech.jts.geom.Geometry from a json string using org.geotools.geojson.geom.GeometryJSON. import org.geotools.geojson.geom.GeometryJSON; import org.locationtech.jts....
2
votes
1answer
59 views

Error sld generated for mbstyle in GeoServer

I have activated the mbstyle plugin for GeoServer. This is part of a mbstyle, it contains a filter: "filter": ["all", [">=", "scalerank", ["zoom"]]], Which means I want to render only those ...
2
votes
1answer
41 views

How generate ID uniquely in two featureStores with GeoTools?

I have a PostGIS datastore in GeoTools as follow: JDBCDataStore dataStore = ... and I have 2 tables(or FeatureStore in GeoTools) as follow: SimpleFeatureStore table1Store = (SimpleFeatureStore) ...
2
votes
1answer
63 views

GeoTools ShapefileReader “Random Access not enabled” when trying to read files edited by QGIS 3.12?

I have some code where the relevant part looks like this: private static List<GisShape> shapes(String shapefile) { DataStore dataStore; try { dataStore = getDataStore(...
1
vote
1answer
33 views

Save MapContent issue with latitude/longitude lines

All labels for longitude lines at bottom and latitude lines on left and right of the map look fine when viewed in JFrame like the one used in https://docs.geotools.org/latest/userguide/tutorial/...
1
vote
1answer
115 views

How to parse CRS from shapefile using geotools

I need to retrieve CRS from a shapefile. I have tried to get it using getCoordinateReferenceSystem() which is provided by org.geotools. My code is as follows. URL someURL = new URL("https://github....
2
votes
1answer
33 views

How to retrieve the type of CRS (geographic or projected)?

Is there a way with GeoTools to know whether a CRS is geographic (in degrees) or projected (in meter) ? I have tried empirically with the following code (based on a check of the CRS unit) but I am ...
2
votes
0answers
58 views

Can't find geotools class in jar file/Maven dependency Android app [closed]

I am creating an Android app and using an extension from Maven dependency. This extension use geotools classes but when I compile and execute the app I have the following error: 020-04-20 21:51:52....
1
vote
0answers
26 views

CRS conversion with epsg_operations.properties btw. EPSG:32041 and EPSG:3857

I try to correct the visualisation of EPSG:32041 on a Bing map. For that purpose, when i import the 32041 data i use a correction in geotools with epsg_operations.properties. I debugged, which ...
3
votes
1answer
353 views

Unable to build a custom GeoServer WPS

I am following this example https://docs.geoserver.org/latest/en/developer/programming-guide/wps-services/implementing.html To create a custom GeoServer WPS. I am trying to build the project using ...
1
vote
1answer
123 views

Latitude labels location on map

Following Label coordinate position of Grid lines explanations I was able to create latitude lines every 10 degrees with labels. The values of the latitudes are drawn following the prime meridian (0 ...
2
votes
1answer
32 views

Set meridian label position and orientation

I have followed Label coordinate position of Grid lines to be able to draw meridians and parallels with labels. The meridian labels are placed at the Equator line and oriented in the direction of the ...
1
vote
1answer
45 views

How to pass 2 parameters in wps with jiffle in GeoServer?

I'm trying to send 2 sources to process with jiffle (adding a second input on wps:inputs, in this example both are the same layer so the result should be 0), but when I try to execute a simple task ...
2
votes
1answer
37 views

Convert linear ring to multilinestring and split into segments of x length

I have a linear ring created from points. I would then like to create a multilinestring from that and subsequently split that into segments of 7 metres each. I tried the following but got '...
2
votes
1answer
19 views

Symmetrical difference result in Geotools not drawing correctly

I have two polygons and I perform a symmetrical difference on them but the result doesn't make sense. Can anyone explain what could be going wrong? I suppose its something in the geometry, is there a ...
2
votes
1answer
78 views

Label coordinate position of Grid lines

I read How can I label the coordinate position of the grid coordinate lines but I still do not understand how to use the LineFeatureBuilder class to label the grid lines. Could someone let me know ...
1
vote
1answer
30 views

Polygon not drawing correctly

I have a series of points I would like to connect into a polygon but it isn't drawing correctly, You'll see the problem. Coordinate[] xyarray = xycoords.toCoordinateArray(); ...
2
votes
1answer
21 views

How store feature changes with geotools?

I stored a vector layer in postgis and I can add, remove or update featues successfully. Now I want to store feature change log(This means if a feature property changed, we can access new and old ...
4
votes
1answer
28 views

Compute the azimuth between two UTM32N points using Java GeoTools

I am using Java GeoTools to compute the azimuth between two UTM32N points, e.g. between POINT(496383,5419109) and POINT(528196,6070949). Is it possible to do so without converting the points to WGS84 ...
3
votes
1answer
173 views

.prj files from ESRI aren't WKT

We are seeing .prj files from our users that don't look like the normal WKT formatted ones we've seen up to this point, instead, they match the format illustrated at "Esri Grid format". When we ...
3
votes
2answers
35 views

Geotools Point in Polygon incorrect result vs QGIS

I need to find the point in a polygon to get the corresponding feature and the result does not match the display in QGIS. QGIS shows the information correctly but with geotools I can't get it right. ...
2
votes
1answer
327 views

Read GML using Java

I have a use case on reading and extracting data from GML (Geography Markup Language) using Java. There is a sample file in GitHub by clicking here. The imported packages in Java were as follows ...
0
votes
0answers
42 views

How fix lengthen tile created by geo tools?

I use gdal2tiles.py for creating tiles from a tif with EPSG:4326. The geotiff information in qgis is as follow: For zoom=0, x=0 and y=0 it create a tile as follow: I followed this tutorial to ...
1
vote
1answer
54 views

Point placement between midpoint and endpoint

I have a line with a, Mid Point End Point I'm trying to return a coordinate that's LENGTH away from Mid point (on the same line) and between end and mid (oppose to between Midpoint and the ...
3
votes
1answer
61 views

Cannot decode CRS from executable JAR with GeoTools

I decode a CRS from its EPSG code using: CoordinateReferenceSystem crs = CRS.decode("EPSG:3035"); This works like a charm, but when the same line of code is executed from an executable *.jar program,...
1
vote
0answers
283 views

Can I use Geotools in Android Studio?

I want to use Geotools in Android Studio but get this error: Could not resolve org.geotools This is part of build.gradle allprojects { repositories { maven { url "http://repo.boundlessgeo.com/...
1
vote
2answers
570 views

Creating tiles from GeoTIFF?

I have a big GeoTIFF(25GB) and I want to create tiles from it. I know GeoServer have the feature, but I can't use it. I found GeoTools example for cropping tif files here, but it just create some ...
1
vote
1answer
37 views

Apply Point style in JMapFrame GUI

I've managed to create a Point shapefile creating a SimpleFeature and outputting it as Test_Point.shp, public static final SimpleFeatureType POINT = createPointType(); private static SimpleFeature ...
0
votes
1answer
34 views

Convert Point to Arrow (SymbolizedPoint)

So I managed to get a point to show up at the center of my line, I'm hoping to convert the point into an arrow pointing in the direction of my line public static final SimpleFeatureType POINT = ...
4
votes
1answer
81 views

Calculate difference of two LineString

The tool I'm developing is written in Java with Spring Boot, using PostgreSQL as database (PostGIS extension). I also make use of GeoTools. I want to calculate the geometrical difference between two ...
1
vote
1answer
51 views

Creating a useable Geometry for GeoTools

Just getting into using the GeoTools framework, after having done a lot of things manually. One of my previously-written functions transforms a given lat/lon/height between CRS. I found this link: ...
1
vote
1answer
207 views

Creating a shapefile with SQL Query Using Geotools Hibernate and Java

Here is my context : 1] I have geometries in an postgresql database 2] My application uses JAVA/Hibernate 3] I Currently use Geotools to create a shapefile How I do it ? First i retrieve my ...
1
vote
1answer
111 views

Extracting GDAL Metadata field but using Geotools in Java with TIFF files

I am trying to extract Metadata field from a TIFF file using GeoTools in Java, since I can't use GDAL to achieve that on the deployment platform. I downloaded a TIFF sample file and used gdalinfo ...
1
vote
1answer
62 views

Use high precision to convert image from one EPSG defined CRS to another

This question is based on another question: I'm converting multiple images (.jpg or .png) from one EPSG defined CRS system to another, e.g. from EPSG:31255 to EPSG:25833 (on a server within a Java app)...
1
vote
0answers
41 views

WFS GetFeature request with box failed on OGR datastore [closed]

I prepared an OGR datastore and imported features from a GeoJSON data set using REST. If I now send a wfs?request=GetFeature&bbox=....., I get an error message: java.lang.NullPointerException: ...
1
vote
1answer
46 views

GeoTools GML parser sorted features collection

I am using the following code to parse GML file in java: File gmlFile = new File("path/to/gml/file"); InputStream gmlInStream = new FileInputStream(gmlFile); GML gml = new GML(Version.WFS1_0); ...
2
votes
1answer
73 views

List of available transformations between two coordinates system in epsg using geotools

How we can have the list of available transformation between two coordinate systems using geotools? e.g. the list provided of epsg.io between EPSG:32066 and EPSG:4326 https://epsg.io/32066 Java ...

1
2 3 4 5
13