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

Convert Esri ASCII grid raster to WKT polygons efficiently

I need to transform a large number of Esri ASCII grid files to polygonized WKT format, e.g. as CSV. Currently, I use GeoTools with the ArcGrid reader and a polygon extraction process. For parallelism ...
3
votes
2answers
225 views

Shapefile problem using new version of GeoTools

I have had a Java issue trying to convert a CSV to a shapefile using Geotools 17. This works to the point where it creates the shapefile with an attribute table, but it is not physically showing the ...
2
votes
2answers
374 views

JTS GeometryClipper returns wrong results

I have envelopes and a polygon and I want to split that polygon using the envelope geometries. My code is like this: val arr = new ArrayBuffer[Polygon] for (h in polygons){ val ex = h.envelope ...
1
vote
1answer
153 views

Geomesa accumulo storing null Point for geometry

I am using Point geometry type in geomesa for strong lat-long details in feature type. In one of the use case while storing a new feature I don't have value for lat-long so I tried sending null object ...
1
vote
1answer
651 views

Latitude is too close to a pole while converting from EPSG:3857 to EPSG:4326

I am trying to convert EPSG: 3857 to EPSG: 4326 with geotools. Here is my code : public void convertEPSG3857toEPSG4326() throws FactoryException, TransformException { try { ...
1
vote
1answer
111 views

geotools filter CQLException: Encountered “t”

I am querying a simple feature type schema: r:Long:index=join,*g:Point:srid=4326,di:Integer:index=join,al:Float,s:Float,b:Float,an:Float,he:Float,ve:Float,t:Float,m:Boolean,i:Boolean,ts:Long;geomesa....
2
votes
2answers
190 views

Adding Geotiff tags

I am using Geotools GeoTiffWriter to write geotiff and it is working well for the most part. I have found an issue writing images with NAD83 2011 projections. gdalinfo shows the projection information....
2
votes
0answers
274 views

H2 connection error using Geotools

I am using geotools (v 17.0) to connect to a H2 database (v 1.4.193) table. My h2 maven dependencies: <dependency> <groupId>org.geotools.jdbc</groupId> <artifactId>gt-...
1
vote
1answer
1k views

GeoTools Provider org.geotools.referencing.operation.projection.AzimuthalEquidistant$Provider could not be instantiated"

I'm trying to define a custom projection by parsing a Wkt string. I mistakenly developed my test app against gt2-referencing, gt2-main and gt2-geometry from Maven and it worked. I believe the latest ...
2
votes
1answer
281 views

Line between outside and inside polygon - geotools

I have two polygons, one inside another, and one draw it on the map there is a line connecting vertices of outside and inside polygon. I am trying to draw it like multipolygon using Polygon[] ...
-1
votes
1answer
188 views

GeoTools compilation error

I am build geoserver on Windows 7 first time and follow https://www.seegrid.csiro.au/wiki/Infosrvices/GeoserverDevelopmentSetup. Installed Git, Java, Maven 3, Eclipse and set the path as follows in ...
3
votes
0answers
41 views

Conic projection view transformation

I am building a custom map viewer, part of meteorological production system, using Java language and GeoTools library. I have prepared a custom map renderer, using OpenGL, that allows to display maps ...
0
votes
1answer
539 views

Creating graphical marker/point on Geotools map in Java? [duplicate]

I'm writing a program that tracks the International Space Station, and plots its current position on a geotools map. I currently have a geotools map that pops up, and I have the current location of ...
1
vote
0answers
93 views

Map display issues when exporting to SVG with Geotools

I am using geotools to display a map, convert the map coordinates to screen coordinates, and export it back out as an SVG file. So far everything works fine, however I have run into two issues I could ...
3
votes
0answers
35 views

Is there still CoverageStack object in GeoTools?

This is the first time I'm dealing with Geotools 18. I need to work with a GridCoverage Stack object. I saw that there was one in a very old release (until v2.7.4 CoverageStack). Is there a similar ...
3
votes
1answer
170 views

How to create a WCS GetCapabilitiesType using Geotools?

I want to get the Capabilities of a WCS using Geotools (16.2) net.opengis.wcs20.GetCapabilitiesType. I found a WCS 2.0 test class on GitHub but was not able to use the code in the same way because ...
1
vote
0answers
133 views

GeoTools Schema from empty GeoJSON Set

I'm attempting to create a schema for some user-provided input GeoJSON so that I can store this data using PostGIS transactions. I am experiencing a problem with input that is a completely empty ...
1
vote
1answer
28 views

Read Pre defined Style in MapinfoTab File in Geotools

We have open a MapInfoTab File using OGRFeatureSource the file open on map successfully. But one question we have there is a function named GetStyleString in OGRLibrary of Ogr2Ogr but in our OGRSource ...
2
votes
1answer
2k views

Converting Map coordinates to Screen

I am trying to convert world coordinates to pixel coordinates. The problem is, some files (shapefiles) do not convert as it should. The lines are slanted or moved, they should look exactly as when I ...
0
votes
1answer
46 views

Iterators on the same FeatureCollection provide different results

I have a WFSDataStore, which is based on Geoserver. The data are coming from one Database table (with columns ID (unique), NAME, YEAR) I created a FeatureCollection with following code: ...
4
votes
2answers
1k views

GeoTools: Calculate length along line from start vertex up to some point on the line?

I have single LineString and some Point (outside the line), I snapped it to the Line (using DistanceOp so as far as I understood the snapped point should lay on the line). How can I calculate length ...
3
votes
1answer
578 views

Display a map using geotools java in a javafx application

i have added geotools java to my Netbeans IDE and now i want to display this map in my javafx application.I have downloaded its geotiff from the same site and it's a zip file (176 mb) which contains ...
0
votes
1answer
42 views

BingService doesn't accept requests for Hybrid and Other Bing Map formats

We have used BingService with the help of following code: String baseURL = "http://ak.dynamic.t1.tiles.virtualearth.net/comp/ch/${code}?mkt=de-de&it=G,VE,BX,L,LA&shading=hill&og=78&n=...
6
votes
1answer
395 views

Using Math in SLD file - wkt

Is it possible to use math in SLD file in Geotools? I want to get Orientation for lines and calculate its sine/cosine and then multiply it with some value. But when I do this nothing shows up. Here is ...
3
votes
1answer
2k views

SLD polygon graphic fill - hatch

I am trying to create an SLD to style a polygon; the goal is to create hash fill for polygon but to leave empty space between hatch and bounds of the polygon, something like this: I am using this to ...
4
votes
2answers
884 views

Looking for the simplest way to get elevation for a give wgs84 coordinate

I started a project and write an application in java using geotools. I have an simple geoobject with the attributes latitude, longitude and altitude. Now i have to determine, wheather the geoobject is ...
0
votes
1answer
97 views

GeoTools SVG with viewbox doesn't show

Is it possible to use SVG with defined viewbox in GeoTools? I am trying to use SVG for styling layer features but if view box is defined it doesn't show up on the map. Here is SVG that I am trying to ...
1
vote
1answer
167 views

GEOTOOLS - FileDataStoreFinder.getDataStore() on jar

The following code works fine on my Eclipse IDE. private void getLayersAndDisplay() throws Exception { URL imageURL = ImageLab.class.getResource("earthlights.jpg"); File imageFile = ...
0
votes
1answer
102 views

GEOTOOLS - Failing to generate jar

I am trying to generate a jar file for my geotools application. However, when I try to run the jar file, I get the following error: Here is my pom file: <project xmlns="http://maven.apache.org/...
5
votes
1answer
237 views

GEOTOOLS - Animations

I am new to GeoTools and I have been reading some examples and some tutorials. I am currently implementing a Map where I need to have a sprite moving through coordinates. I found an example right [...
0
votes
2answers
167 views

Geotools Label location issue with custom Symbol

We have a Feature Layer having styling with a symbol using some font create by us. But we need to apply Labels on this following is the result we expected from this:- and following is the result we ...
1
vote
1answer
1k views

Missing EPSG Factory

When I using jar and osm file the terminal show: 10:39:29.940 INFO (OpenStreetMapModule.java:171) Building street graph from OSM Feb 14, 2017 10:39:30 AM org.geotools.referencing.factory.epsg....
1
vote
1answer
67 views

Add filter on attributes having some special Characters in their attribute name

We have a Feature layer having multiple attributes. One attribute having attribute name is BSC/RNC . we create some filter on that attribute :- String strQuery = "BSC/RNC >= 10"; org.opengis....
2
votes
0answers
69 views

How to determine the right strategy for WFS requests with Getotools?

I found that the strategy is selected in the determineCorrectStrategy() method in org.geotools.data.wfs.internal.WFSClient. I don't know how reliable the suggestions are for all the strategies but e....
3
votes
2answers
1k views

How to access WFS 2.0.0 using Geotools

I am trying to access a WFS using geotools. Access is working with version 1.0.0 and 1.1.0 without problems. Here my code: // Conenction String getCapabilities = WFSDataStoreFactory....
1
vote
1answer
297 views

How to determine if lat/long is within SABS school boundary?

I am an absolute beginner with GIS data. I am attempting to write a tool to determine if a lat/long point resides within a polygon within a shapefile provided by SABS (https://nces.ed.gov/programs/...
3
votes
1answer
463 views

How to convert svg to sld

I use geotools library for creating my application. Geometries I use need to be represented with style which is defined by sld. I have these styles as a library in svg format and need to convert it to ...
1
vote
0answers
75 views

Specify data type when writing a GeoTIFF

I'm using org.geotools.gce.geotiff.GeoTiffFormat to write a GeoTIFF. I would like to use Float32 instead the default Float64. I've tried: OutputStream output = ... Hints hints = new Hints(...
1
vote
1answer
77 views

Create Boundary Layer on FeatureLayer Geotools

I want to create a boundary layer on my FeatureLayer in Geotools is there any direct option to create this. Following Image shows what i want to achieve this. Please suggest . we have done this in ...
1
vote
1answer
700 views

Create routing graph (as software objects) from roads Shapefile using pgRouting

Intro: It's easy with OSM XML to run my software algorithm converting the XML to my custom software objects representing routing graph: You have ways with easy links to the (ordered) nodes ...
4
votes
1answer
396 views

GeoTools & Shapefile: How to rename column (attribute) name

I'm accessing exiting shapefile with: File file = new File("file_name.shp"); Map<String, Object> map = new HashMap<String, Object>(); map.put("url", file.toURI().toURL()); DataStore ...
1
vote
2answers
115 views

Issue with ModifyFeatures using FeatureStore

We are trying to modify features using SimpleFeatureStore and Transaction as shown below:- Transaction transaction = new DefaultTransaction("Example1"); SimpleFeatureStore store = (SimpleFeatureStore)...
3
votes
1answer
287 views

How to get SimpleFeatureStore from OgrDataStore?

we want to create a SimpleFeatureStore for modify features but not successful. we have used the following code:- OGRDataStoreFactory factory = new JniOGRDataStoreFactory(); Map<...
2
votes
1answer
489 views

How to Update attribute values from queried features on SimpleFeatureCollection?

We want to update some features of a Layer. We have used the following Code to update features but not successful. Firstly Get SimpleFeatureSource by a Feature Layer. SimpleFeatureSource sfSource = (...
2
votes
1answer
214 views

How can you know the sequence/names of the bands of a GeoTIFF file in Java?

I want to know the sequence of the bands (4 and more) of a GeoTIFF file for example whether the sequence is blue, green, red, near infra red, temperature, etc or green, blue, ... How can I know that ...
1
vote
0answers
100 views

Add a Mapinfo TabFile in Geotools goes wrong [Automatically Converts my Integer values to Byte]

we have read Mapinfo Tab file in Geotools using JniOGRDataStoreFactory, but when we execute filter statement on feature collection it give some vague values so we decide to investigate it and found ...
4
votes
2answers
1k views

Geotools: unexpected difference between CRS.decode(“EPSG:4326”) and DefaultGeographicCRS.WGS84

I wanted to use geotools (15.3) to reproject data from EPSG:4326 to a local projection. To see if everything works as expected I printed the length of two test linestrings. The expected result is ...
3
votes
1answer
1k views

How to calculate whether a point is in a shape using geodetic calculations

I’m new to GIS so forgive me if my terminology isn’t completely correct. Really liking the options available in the GeoTools library but I’ve hit a stumbling block that I’m hoping someone will be ...
0
votes
1answer
314 views

Choosing target CRS value when doing geographic calculation?

In postgis, I use geography type, it support many geographic calculation, like st_dwithin(geography1, geography2, distance). What I need to do is just giving some points coordinates (lng, lat pair), ...
2
votes
1answer
868 views

Modifying feature attributes of a shapefile in geotools

I have a shapefile with an attribute I want to compute programmatically in Java for each feature. I have found a lot of documentation on how to read and create shapefiles with geotools (http://docs....