Questions tagged [geotools]

GeoTools is an open source Java library that provides tools for geospatial data (http://geotools.org). Questions about programming using GeoTools are on topic here, while questions on geographic issues (while using GeoTools) should be asked on https://gis.stackexchange.com.

For questions about how to complete geographic tasks using the GeoTools library you may want to ask on https://gis.stackexchange.com/ to get answers, if your question focuses on programming issues with GeoTools then ask on this site.

565 questions
2
votes
1 answer

why do i code error,geotools create shapefile chinese setAttribute error

tb.add("图斑编码", String.class); feature.setAttribute("图斑编码", polygon.getCode()); Exception in thread "main" org.geotools.feature.IllegalAttributeException:Unknown attribute 图斑编码:null value:null at…
kero99
  • 29
  • 5
2
votes
1 answer

How to transform coordinates in local EngineeringCRS to WGS84?

I want to code the transformation of coordinates given in a local right-handed 3D-Cartesian coordinate system to 3D-geographic-coordinates using geotools:gt-referencing. I have the location and orientation of a sensor in a local, right-handed…
Roman Podolski
  • 329
  • 3
  • 17
2
votes
1 answer

Calculating number of bands in a raster

I have been trying to calculate the number of bands inside a raster file. While the below codes works mostly, but it seems to throw an exception when i tried the code on a projected raster. I have tried the following code: AbstractGridFormat format…
2
votes
3 answers

Shape file or geojson to database

I am trying to read the large shape file and try to find whether lat and long is in coordinates using geotools Is there any possible way to store the shape file into database? Or will store as geojson and retirerive faster to check that lat and…
user2196474
  • 319
  • 1
  • 5
  • 15
2
votes
1 answer

How do you use Java GeoTools to add text and display them on JMapFrame's map content?

I know how to create a layer and display points on JMapFrame. But I do not know how to add a text string next to a point? Below is the code to display multiple coordinates on JMapFrame, I thought adding text strings would have similar codes. Please…
Johnny Lee
  • 23
  • 3
2
votes
0 answers

Is there a way for geotools PostGIS DataStore to use a JEE DataSource?

The geotools DataStoreFinder expects a Map of properties, including mainly the connectivity information, depending on the store. For the PostGIS plugin this includes the dbtype (which must be "postgis") and the database host, port, schema,…
jbx
  • 21,365
  • 18
  • 90
  • 144
2
votes
1 answer

Geotools: length(int length) method about SimpleFeatureTypeBuilder

I want to set the length for a String type field,but i see the Source code: value is reset after a call to {@link #add(String, Class)} What is the significance of a method?How can i set the length for a String type field?anyone could help me /** *…
Mr.H
  • 59
  • 7
2
votes
2 answers

geotools:Current fid index is null, next must be called before write()

I want to export a table in oracle containing a spatial field as a shp file. This error occurs when I run the export program.I think the length of the field in the table saved to the shp file causes this problem. The longest length of the field in…
Mr.H
  • 59
  • 7
2
votes
1 answer

What's the differences between Boundless and Osgeo versions?

On the maven repository, I see two distributions of geotools shown : – One, called Boundless, offers the versions 19.0 and 19.1. – The other one, called Osgeo, 18.4 and 19.2. Despite searching over the Internet, I haven't been able to figure what…
Marc Le Bihan
  • 2,308
  • 2
  • 23
  • 41
2
votes
1 answer

Gradle not imported dependency with ext:pom

I want import library org.geotools. Added raw compile group: 'org.geotools', name: 'geotools', version: '16.1' or compile group: 'org.geotools', name: 'geotools', version: '16.1', ext: 'pom' and repo: repositories { mavenLocal() maven {…
2
votes
1 answer

Can Geotools create a Geohash from a lat and lon?

Recently I have been using the Geotools library (http://docs.geotools.org/latest/javadocs/) to process some simple geo data. However, the library is so robust that it is surprising to me that it doesn't seem to provide the capability to create…
Chris D.
  • 47
  • 7
2
votes
0 answers

How to Install geotools by gradle in android studio 3.1.2

I wan to use geotools in my project so i've added geotools lib in my repositories project gradle : allprojects { repositories { maven { url "http://repo.boundlessgeo.com/main" } maven { url…
Cyrus the Great
  • 5,145
  • 5
  • 68
  • 149
2
votes
1 answer

Geotools accessing WMTS service throws stackoverflow parsing XML

I'm accessing http://geodata.nationaalgeoregister.nl/luchtfoto/infrarood/wmts?request=GetCapabilities&service=WMTS (it's one of the many free services found on the Dutch PDOK site here) I'm using the JMapFrame (Java 1.8u131x86, Geotools 18.3 module…
Houtman
  • 2,819
  • 2
  • 24
  • 34
2
votes
2 answers

Java API for parsing MapInfo TAB format

I am working on parsing a MapInfo TAB Format file in Java. It consists of a set of four files viz .TAB, .ID, .MAP and .DAT. After searching on web I came across a parser provided by GeoTools at this repository:…
Surabhi Mundra
  • 377
  • 1
  • 12
2
votes
1 answer

Proper way to use ReferencedEnvelope

Using examples I found, I was able to connect to a webservice, download a world map and have it display properly in a JMapPane. My goal is to have the JMapPane only display a very specific portion of the world. I have a geographic CRS based on NAD83…