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
3
votes
1 answer

Release Memory after GetFeatures Geotools

We have created a GroupByVisitor with the following code:- GroupByVisitor visitor = new GroupByVisitorBuilder().withAggregateAttribute(CQL.toExpression(strColumn)) …
3
votes
2 answers

How to resolve 'Offline / Missing artifact org.geotools:gt-shapefile:jar:17-SNAPSHOT' in Maven?

I'm new to Maven and am trying to create a simple Maven project given in geotools.org
3
votes
0 answers

How to write Gdal METADATA with GeoTools?

I've a Java class that generate a GeoTiff file by using Geotools library. My file is correctly generated and I can open it with a Tiff viewer. Now I need to append to this file some GDAL metadatas and I can't achieve it. Here a piece of my…
valerossi46
  • 153
  • 1
  • 3
  • 10
3
votes
1 answer

Geotools: Add points with different styles to same map layer

I'm using GeoTools in my java project to draw points in different sizes, color and opacity into a map. As there are a lot of different styles for them, I ended up with thousands of layers in my map. Currently each added point has his own layer cause…
HelloWorld0815
  • 610
  • 4
  • 11
  • 29
3
votes
2 answers

Trouble building Shapefile in Geotools

I have a project where I want to load in a given shapefile, and pick out polygons above a certain size before writing the results to a new shapefile. Maybe not the most efficient, but I've got code that successfully does all of that, right up to the…
3
votes
2 answers

Change the precision of geometries read from Shapefile using GeoTools

I use GeoTools to read the geometries from a Shapefile as in this example. I have noticed that the coordinates used in the source Shapefile are adjusted to a Java Double type. Consequently the geometries are not exactly the same as in the Shapefile.…
Dimis
  • 41
  • 4
3
votes
1 answer

JTS: How to convert polygon into MultiLineString

I have polygon shape and I want to convert it to MultiLineString. Note that usually the direction is different: From points, coords, lines etc. using GeometryFactory build polygon. I started to thinking about GeometryTransformer but it's hard to…
michael
  • 3,835
  • 14
  • 53
  • 90
3
votes
1 answer

Geotools google maps java ee web application

I'm searching the alternatives for developing a java web application to calculate land values based on some variables with a visual presentation of a map. Since the data that i have is ESRI shapefiles and i want to go open source i ended up with…
Argiropoulos Stavros
  • 9,436
  • 11
  • 61
  • 79
3
votes
2 answers

How to get vertices of feature in geotools

Could anybody show me how to get vertices of feature by java geotools api? In my case, i have a polygon layer in postgis, i can query all feature of this layer and i need to know vertices of each feature. SimpleFeatureSource featureSource =…
Truong Pham
  • 177
  • 2
  • 18
3
votes
1 answer

Validation of a geometry in WKT format

I am new to GIS area and I need to validate a geometry in WKT format in java, to check whether a simple polygon is a closed loop, i.e the start and end points of the vertices should be the same. I am currently using jGeometry class of oracle…
kumar
  • 565
  • 1
  • 5
  • 11
3
votes
1 answer

How to embed maven project in a Java Swing Application

I wanted to create and java desktop application which can display a .shp (Shape File) and edit the attribute table of that shape file. I was following this quick start tutorial on geotools web site to learn the part of displaying the shape file in a…
direndd
  • 642
  • 2
  • 16
  • 47
3
votes
3 answers

Geotools - Create a point

I'm using GeoTools Java library for some geometric calculations. In my case, I'm using a shape file which contains all neighborhood multipolygons of a certain city. I would like to know for every possible coordinate in that city, at which…
jarandaf
  • 4,297
  • 6
  • 38
  • 67
3
votes
1 answer

Geotools - Draw Features on WMS and OSM

I am trying to overlay a shp file on wms layer using the example http://docs.geotools.org/latest/userguide/tutorial/raster/image.html. I am continuously getting the error: Exception in thread "main" java.lang.UnsupportedOperationException: Trying to…
Qedrix
  • 453
  • 1
  • 8
  • 15
3
votes
1 answer

How to create a simple map scale bar in geotools

Using GeoTools I was able to display a simple shape file using JMapPane class. My requirement is to draw a bar much like in any maps that shows the scale of the map on display in meters in relation to the length of the bar as I zoom in/out. I've…
2
votes
1 answer

GeoTools: Creating a point and adding it to featureCollection

I am implementing an interpolation of trajectory points. So, basically, I need to create several points along the azimuth from a starting point to a destination point. The problem is, I can't add a created point to a collection: SimpleFeatureType…
porter
  • 21
  • 4