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

How to register a 'DataSourceFactiry' with 'Geo Server'?

If I have written my own DataSourceFactory, then how can Geo Server recognize my dataSourceFactory? As I know that if we register with org.geotools.data.DataStoreFactorySpi then automatically Geo Server recognizes our data source. But I don't know…
eswara
  • 95
  • 2
  • 8
0
votes
1 answer

GeoTools getFeatures takes forever

I wrote the following method as an onClick handler. First and second click, I got result from DB. By the third time, the code stopped in the "getFeatures(trgtFilter)" line and didn't return. In debug mode, I saw that it is waiting for DB connection.…
springrolls
  • 1,331
  • 1
  • 14
  • 40
0
votes
0 answers

How to embed a GeoTools map in a existing java swing application

I have a java GUI swing application with three frames. I want to load a map from a shape file and draw the map on an existing application frame. For this I use GeoTools framework. I've looked at the examples and all examples have drawn the map on a…
tybandara
  • 279
  • 2
  • 10
0
votes
1 answer

GeoTools - drawing points on image

I'm using geoTools 14.1 I'm trying to plot on an image some points This is the code I'm using: double[][] points = new double[8][2]; points[0] = new double[]{45.46433710338643, 9.190417528152478}; points[1] = new…
Angelo Immediata
  • 6,635
  • 4
  • 33
  • 65
0
votes
1 answer

GeoTools: How to build a point? (imports issue)

I'm following the GeoTools documentation and found this: GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null); Coordinate coord = new Coordinate(45, 15); Point point = geometryFactory.createPoint(coord); When I put it in…
michael
  • 3,835
  • 14
  • 53
  • 90
0
votes
1 answer

Using GeoTools without Maven

I wrote some java code using geotools library using the maven build tool. This small code runs successfully when i run it as an independent java application in the maven project . But since i needed to use this piece of code in another project where…
jps
  • 173
  • 1
  • 13
0
votes
1 answer

Adding FeatureCollection to a FeatureStore throwing AbstractMethodError

This method is supposed to replace the features in the database with new features I pass to it. private static void replaceBoundaryShape(FeatureCollection dbFeatures) throws IOException, CQLException{ …
Nick M.
  • 1
  • 2
0
votes
2 answers

geojson coordinate conversion to the format of the data coming from PostgreSQL?

this is save to vector code : if (vectorType.equalsIgnoreCase("Point")) { Point point = new GeometryJSON().readPoint(item.getData()); lineString.setSRID(3857); theEvent.setGeom(point); …
develop
  • 131
  • 6
  • 16
0
votes
1 answer

How to create an open polyline in GeoTools 12-RC1?

I need to create a GeoJSON stream, which contains data about roads. The roads are like polygons, except they are open (the start and end points are different). I tried to use the following code to achieve that goal: protected void addPolyLine(final…
Glory to Russia
  • 17,289
  • 56
  • 182
  • 325
0
votes
1 answer

Geotools Transform Point Fails

I'm developping an application with java whose permit to convert a EPSG:4326 point into EPSG:2972. My code works : //Grab a transform between two Coordinate Reference Systems MathTransform mathTransform =…
n.faget
  • 1
  • 1
0
votes
1 answer

Error while loading raster files using GeoTools

I tried loading shape files using GeoTools.It is working fine. But when i am trying to load the raster maps, i am getting some warning like Can't load a service for category "GridFormatFactorySpi"Can any one throw some light on my issue?
svkvvenky
  • 1,122
  • 1
  • 15
  • 21
0
votes
1 answer

Can't create column of type double when making a shapefile

// My type val typeBuilder = new SimpleFeatureTypeBuilder() typeBuilder.setName("line-query-seg") typeBuilder.add("value", classOf[Double]) typeBuilder.setDefaultGeometry("the_geom") typeBuilder.add("the_geom", classOf[LineString]) val sft =…
Andrew Cassidy
  • 2,940
  • 1
  • 22
  • 46
0
votes
1 answer

Why can't this code produce a points layer in GeoTools

I am testing adding a collection of points to a map utilizing the Geotools API. I've been following this example as best I could Problem creating a point and adding it to FeatureCollection, as the example code is old, and things like…
cj5
  • 785
  • 3
  • 12
  • 34
0
votes
0 answers

Reading data from ShapeFile

i am new to GIS field and i am using geotools to read/view shape files how so how can i read data about certain point in shape file without using InfoTool , for now i am capable of reading and viewing shp file and i can use InfoTool , Zoom tool…
0
votes
0 answers

Bad repaint behavior of JMapPane

I'm trying to develop a moving map application based on geotools12RC1 libary. EDIT: Will be updated to 12.1 as soon as i have the time. Currently I'm loading shape files, applying sld styles and display the resulting layers within a JMapPane. I've…