Questions tagged [geotools]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
17 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
47 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
35 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
51 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
32 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
48 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
24 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
24 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
210 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
76 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
28 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
35 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
29 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
18 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
54 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
24 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
20 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
22 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
96 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
33 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. ...
0
votes
0answers
32 views

Error in parsing GML using Java

Error while parsing GML throws an error like following org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.VerifyError: Bad type on operand ...
0
votes
0answers
35 views

Unable to find the exact packages for org.geotools

The following imports did'nt works for me import org.geotools.wfs.GML; import org.geotools.wfs.GML.Version; Find the screenshot from my Eclipse IDE IDE is telling me "The import org.geotools.wfs....
2
votes
1answer
186 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
38 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
51 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
45 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
135 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
245 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
34 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
33 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
52 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
24 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
124 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
61 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
52 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
34 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
36 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
49 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
vote
1answer
147 views

Convert image from GeoJSON

I am trying to convert feature collection GeoJSON into image. I want to use geotools to convert. I tested the soultion from this post here. But I am really noob that I ran into some errors like this: ...
3
votes
1answer
28 views

GeoTools: java.util.{List, Map} in SimpleFeature

I'd like to add a List(Map) as Attribute to a SimpleFeature when using the PostGIS datastore: SimpleFeatureTypeBuilder simpleFeatureTypeBuilder = new SimpleFeatureTypeBuilder(); ...
3
votes
1answer
29 views

Adding attribute to a feature type?

I need to do something apparently simple: adding a new attribute to an existing simple feature type. Something like: SimpleFeatureType sft = DataUtilities.createType("", "the_geom:Point:srid=3035,ex:...
1
vote
1answer
32 views

Identify projection and set Bursa wolf params

i have a shapefile with .prj : PROJCS["NAD_1927_UTM_Zone_17N", GEOGCS["GCS_North_American_1927", DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0], ...
1
vote
1answer
113 views

Reading through shapefile table with Geotools

Goal: Read through a shapefile table with Geotools. I'm confused about FeatureSource, FeatureCollection, and FeatureIterator in Geotools. In ArcGIS, I can open a table in an existing shapefile, and ...
0
votes
1answer
66 views

Reading GeoPackage file with GeoTools: Error on missing gpkg_contents database

I am trying to read a GeoPackage file using GeoTools with: GeoPackage gp = new GeoPackage(new File("myFile.gpkg")); FeatureEntry fe = gp.features().get(0); SimpleFeatureReader fr = gp.reader(fe, ...
2
votes
1answer
21 views

Getting RasterSymbolizer from a StyledLayerDescriptor?

We are using Geotools for a Java GIS project. I have an org.geotools.styling.StyledLayerDescriptor object created from a XML stream and would like to create an org.geotools.styling.RasterSymbolizer ...
1
vote
1answer
50 views

How to get path cost in A* shortest path finder of GeoTools?

I am computing a shortest path with A* algorithm of GeoTools: AStarShortestPathFinder pf = new AStarShortestPathFinder( myGraph, nodeFrom, nodeTo, myAstarfun); pf....
1
vote
2answers
124 views

How to designate a polygon as range on a TIFF file and take the raster data which in this range?

In GeoTools, GridCoverage2D.evaluate(DirectPosition coord, int[] dest) can get the raster data in specified location. It's powerful, but I want to get some raster data in a spatial range. I try to ...
0
votes
0answers
44 views

What is appropriate coordinate transformer for Lambert Azimuthal Equal Area to Google maps in Geotools?

I need to extract the coordinates from the GeoTiff file (that was provided by European Soil Agency for Spain) and display them in Google Maps. For that, I wrote simple Java code public static ...
1
vote
1answer
274 views

GeoServer - longitude/latitude is out of bounds

We could see the below error from GeoServer when zooming out the map, because the bbox sending request more than the MONGO DB accepted range(-180,-90,180,90). "Query failed with error code 2 and ...

1
2 3 4 5
13