Questions tagged [geotools]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
14 views

Change the CRF used in a shapefile , and save the modification with Java Geotools [closed]

I want to write a function in Java using Geotools, to reproject a shapeFile in a specified CRF , and save the modification in the ShapeFile, So the input will be a shapefile using for example ESRG:...
user avatar
  • 1
-2 votes
0 answers
19 views

Using Geotools to develop an online map in a Java desktop application, such as using WMTS or WMS technology [closed]

Recently, I am developing a Java program based on Geotools. Can Geotools support online map technology, such as embedding Google maps or ArcGIS basemaps in the map container, and request code examples....
user avatar
1 vote
0 answers
39 views

Missing fields when importing shapefile to PostgreSQL/PostGIS using Geotools

I want to import shapefiles to database using geotools , the code below worked for only one shapefile ( which was imported successfully ) , so I supposed my code was working fine , but when I ve tried ...
user avatar
1 vote
0 answers
18 views

Read CSV file with geotools library Java

I found in the geotools documentation this code for reading CSV file and extract geometry seems not working for me even with the data test they have in the web site. feature.getDefaultGeometryProperty(...
user avatar
1 vote
1 answer
36 views

Geotools Transform to new coordinate system not working

I'm trying to convert from EPSG 26191 to WGS, here is the code im using to transform but it still prints for me when I get the SRID as 26191. CoordinateReferenceSystem sourceCRS = CRS.decode(&...
user avatar
1 vote
1 answer
16 views

Cannot invoke "org.geotools.data.DataStore.getTypeNames()" because Datastore is null

I would like to import shapefiles to PostGIS. the method I used to work with takes as argument the path of the shapefile ( a string ) , but since I need to link this to my frontend , I can only work ...
user avatar
0 votes
1 answer
53 views

Infinite run after adding osm service in a map content and using the paint method of the StreamingRenderer class

When I add osm service in a mapContent mapContent.addLayer(new AsyncTileLayer(new OSMService("Mapnik", "http://tile.openstreetmap.org/"))); Then when I use the paint method of ...
user avatar
0 votes
1 answer
50 views

Calculating map scale in WGS84

I use the mapViewer from the example of https://docs.geotools.org/latest/userguide/tutorial/map/style.html I would like to present the current scale (it's works ok in projected CRS), when I set WGS 84 ...
user avatar
  • 63
1 vote
1 answer
18 views

Geotools + OGR: FeatureIterator.next() blocks the execution

I am using geotools to read through some vector files in my gis project. I am trying to read FileGeoDatabase files as well as DXF and DWG. The thing is, I am able to create the Metadata for the files, ...
user avatar
1 vote
1 answer
29 views

Delete a shapefile feature without mixing up the feature IDs?

If I open a (shapefile) feature source and delete a feature, something happens with the IDs (some mixup). If I close and open the shapefile again it is still mixed up. But when I close the shapefile ...
user avatar
  • 63
0 votes
0 answers
11 views

Why can't I grab a feature, using filter, from a feature source based in a shapefile

If I use the filter to select features fom a postgis database it is ok. But when I try to do the same procedure on a featureSource based on a SHAPE-file nothing will be found (SimpleFeatureIterator ...
user avatar
  • 63
0 votes
1 answer
15 views

How to see the source data difference between FeatureLayers

I have 2 different FeatureLayers, one from the Postgis database (table name ATZ) and one from the SHAPE file (filename = ATZ.shp). When I search for features with a bounding box filter I get several ...
user avatar
  • 63
0 votes
1 answer
18 views

How do I remove a feature from a SimpleFeatureCollection?

I have a SimpleFeatureCollection (sfc), now I would like to remove an object (states.32) from that collection. Is that possible?
user avatar
  • 63
0 votes
1 answer
25 views

Configuring GeoTools to convert graphic objects to shapefiles without using filesystem?

By default, GeoTools (20.2) tries to convert the graphic objects into shapefiles on the disk. We want to skip this step and have GeoTools keep the file contents in memory (and return it as a byte ...
user avatar
  • 11
0 votes
1 answer
48 views

GeoTools: Geo Transform incorrect

I am transforming a coordinate between Lambert Conformal and WGS84. The values returned by GeoTools do not seem correct. From: PROJCS["unnamed", GEOGCS["Coordinate System imported ...
user avatar
0 votes
0 answers
27 views

geotools GridCoverage2D set the color

When I save my GridCoverage2D as a tif file and search it, the color is white. I want to set the low value to green and the high value to red (green-yellow-red) And save it as a png file by specifying ...
user avatar
3 votes
1 answer
20 views

<geotools/HeatmapProcess> convert GridCoverage2d to BufferedImage

I got the heatmapprocessTest code from geotools github However, I can't confirm that the heat map is coming out well. Ultimately I want to create and save the heatmap as a BufferedImage. (png) For ...
user avatar
3 votes
0 answers
80 views

NetCDFs with more than 4 dimensions in GeoServer

I have two very similar NetCDFs. "temp_4.nc", that I can load into GeoServer, and "temp_5_e.nc", that I can't. Both file have a single data variable "temp". In the first ...
user avatar
0 votes
1 answer
42 views

GeoServer create UI for datastore to ask for configurations

We are using Vertica for geospatial data analysis. We need to integrate Vertica database with GeoServer so that we can fetch and use Vertica's data in GeoServer. How do I create an UI for the ...
user avatar
0 votes
1 answer
51 views

GeoServer: Can I connect GeoServer with any geospatial database by adding data store?

I want to connect geospatial database with GeoServer. GeoServer is not provided the out-of-box facility for the same. But I want to know the possibility to connect GeoServer with other geospatial ...
user avatar
0 votes
1 answer
35 views

Create geotools MultiPoint from java Collection

I would like to create a GeoJSON containing a MultiPoint from a list of WGS coordinates in my custom format (say MyLonLat). I wanted to use geotools library to simplify this, but I can't find a nice ...
user avatar
  • 101
2 votes
0 answers
43 views

GeoTools slow pane drag problem

I've created a map using GeoTools IntelliJ Quickstart. When I move the displayed map on the screen with the pane tool, non visible parts become visible on the screen appears as a blank white area ...
user avatar
0 votes
1 answer
89 views

Adding features to featureCollection does not update the map

I am trying to draw lines on the map using GeoTools, and my goal here is to prevent reloading the window when I draw lines on the map every time. I created a layer based on a featureCollection and ...
user avatar
0 votes
0 answers
52 views

Using org.geotools.renderer.lite.StreamingRenderer

We have a GIS application to view Map(like Google) developed in Java, using PostgreSQL DB & GeoServer/OpenLayers as backend. This application is deployed on OpenShift post which users started ...
user avatar
  • 1
0 votes
1 answer
175 views

Where can I find all same version of Geotools packages in same place?

I'm trying to use some Geotools packages but it is a nightmare to configure repositories to find all versions in same place. This is my dependencies and repositories: <!-- https://mvnrepository....
user avatar
  • 1,846
0 votes
1 answer
54 views

Addlayer method reloads screen and the white screen seems in Java desktop application using GeoTools

I am trying to draw lines on map using GeoTools. Firstly I added a map layer, and while the program still is running, the user draws a line with mouse clicks. But every time addLayer method calls, the ...
user avatar
1 vote
1 answer
35 views

Inaccurate results when converting coordinates from shapefile(dynamic projection system file) to EPSG:3857 using geotools

I have created a functionality where I get the geometry data from the shapefile and display it on the map and table structure. Here there is no restriction like that only some specific files can ...
user avatar
  • 11
1 vote
0 answers
89 views

How to flip axis order in WKT/CRS with GeoTools

I'm trying to generate some WKT for a CRS where we've flipped the axis order to make it play nicely with shapefiles. For example, we've got some points in EPSG:2193 (NZ transverse mercator, in yx ...
user avatar
1 vote
2 answers
47 views

Dependency issues when executing gt-imagemosaic-jdbc-23.5.jar to import tiles into postgres db

After creating tiles, I'm trying to insert these tiles into postgres db which I had created earlier. Here's the procedure. Now when trying to import these tiles to database, I have to execute this ...
user avatar
3 votes
1 answer
69 views

How to create shapefile size greater than 2GB using GeoTools

I am using GeoTools for merging my individual shapefiles but I get an exception when the size of the shapefile increases beyond 2GB. How can I do this using Geotools?
user avatar
2 votes
1 answer
22 views

Create Style from SimpleFeatureCollection

Is it possible to create a Style from a SimpleFeatureCollection and SimpleFeatureType. I noticed that StyleBuilder has, public Style buildClassifiedStyle(SimpleFeatureCollection fc, ...
user avatar
  • 187
2 votes
1 answer
72 views

Searching shapefile for zone containing coordinates in lat/lon format using GeoTools

I'm new to GeoTools and GIS generally. I have a shapefile containing feature polygons representing NY City taxi zones. I also have the coordinates in latitude and longitude for the pickup and drop-off ...
user avatar
  • 121
2 votes
2 answers
74 views

GeoTools read shapefile without EPSG in prj file

I'd like to improve the accuracy of reading a shapefile (password is "helpme") which has no EPSG specified in prj file.When I read the shapefile with geotools 21.0 I get this result (...
user avatar
  • 95
2 votes
3 answers
236 views

Simplify a branching line string

I have been working on developing a GeoTools function to create a central label line for polygons. The idea was to grab the skeleton of the polygon and use that to place my label, however it turns out ...
user avatar
  • 75.1k
1 vote
1 answer
137 views

Reading from PNG file in Java from using GDAL

I've used gdalwarp.exe to project a tif-file from EPSG:4326 to EPSG:32635 and storing it in the PNG-format: gdalwarp.exe -dstalpha -t_srs EPSG:32635 -s_srs EPSG:4326 -if GTiff -of PNG -et 0.125 -r ...
user avatar
  • 63
3 votes
1 answer
182 views

Remove Slivers/Gaps generated after TopologyPreserveSimplification?

I am trying to simplify my geometry using TopologySimplifier to simplify my shapefile , but after this I am getting so many sliver/gaps( even trying with different tolerance (.001 to .005). Below is ...
user avatar
0 votes
0 answers
98 views

Slow performance during Oracle import using GeoTools

This is sample program which reading and shapefile and import into Oracle database. it also trying to rename the the_geom column to GEOMETRY column . But this is taking time to insert into Oracle. It ...
user avatar
0 votes
1 answer
147 views

Error while importing shapefile into Oracle

I am trying to import shapefile into Oracle db using GeoTools, but when I am trying to create a new schema, it will giving me following error. Aug 01, 2021 8:24:13 PM org.geotools.jdbc.JDBCDataStore ...
user avatar
0 votes
1 answer
26 views

Error while importing shapefile into Oracle db using geotools

I am trying to import shape file into Oracle database but I am running TNS listener error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor The Connection descriptor ...
user avatar
0 votes
1 answer
65 views

How to Dissolve by any attribute in geotools

Just like in ArcGIS we have dissolve option by any field. How can we do the same operation using GeoTools/JTS on any attribute.
user avatar
0 votes
0 answers
89 views

ECW support for Java development

I'm trying to add support for the ECW file format in a Java application the last few days without any success. My development env is OS: Windows 10 (x64) JDK: openjdk 15 IDE: Eclipse On my pom I added ...
user avatar
2 votes
1 answer
84 views

How to increase shapefile creation speed from CSV file in GeoTools

I want create shapefile from CSV. Here is my code File file = JFileDataStoreChooser.showOpenFile("csv", null); if (file == null) { return; } final SimpleFeatureType ...
user avatar
0 votes
1 answer
37 views

Geo Tools Conformal and Distortion Transform

I'm using WFS service to get geometry values of some Australian land parcels based on the local grid it belongs to. I receive the coordinates in WSG84 and I'm converting it to relevant coordinate ...
user avatar
2 votes
2 answers
149 views

How increase speed of counting CQL.toFilter("CONTAINS(the_geom, POINT (lat lon))") on GeoTools with Java

How can I increase speed of counting? I want to select points which is included by shape (GIS shapefile .shp). I have 5 million points and 10 shape files. qry="CONTAINS(the_geom, POINT (69....
user avatar
1 vote
1 answer
21 views

Selected/non selected items color with geotools map example

I've taken the Geotools example for showing map data. There is a function setting a color (yellow) for selected items. The function sets the rest of the items to a default color even though the layer ...
user avatar
  • 63
0 votes
1 answer
113 views

How to get the the GPS coordinates corresponding to Cartesian pixel coordinates when drawing a PNG image from a GeoJSON file

I'm going to explain my problem. I've a classic GeoJSON file: { "type": "FeatureCollection", "features": [ { "type": "Feature", &...
user avatar
  • 125
0 votes
0 answers
79 views

Enabled Level FINE logger GeoTools/GeoServer

I would like to enable my logger in level FINE with GeoTools. I changed my DEFAULT_LOGGING.properties to : log4j.category.org.geotools=DEBUG log4j.category.org.geotools.factory=DEBUG log4j.category....
user avatar
  • 15
1 vote
1 answer
292 views

Create GeoTIFF images from TIFF image using the coordinates of the four corners

I have several TIFF images which were taken from an aircraft. The images are tilted. Hence, the orientation of the images are not in parallel to the grid system. Please do refer to the below image: (...
user avatar
  • 149
0 votes
1 answer
220 views

GeoTools errors and warnings reading .tif file

I'm trying to read my .tiff image using GeoTools. After reading I intend to perform georeferencing of the image using the four coordinates of the image. Following is my code. public static void main(...
user avatar
  • 149
1 vote
1 answer
393 views

Create GeoTiFF using geotools Java

I have 4000+ raw .tif images. For each image, I have the four corner coordinates in Irish Grid System. I'd like to know how I can use GeoTools to georeference each .tif image using the coordinate ...
user avatar
  • 149

1
2 3 4 5
15