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
5
votes
3 answers

NoSuchMethodException while calling GeometryJSON().read()

I am using JTS (from VividSolutions) and GeoTools. I have the following code: public Geometry jsonToGeom(String json) throws IOException { Geometry obj = new GeometryJSON().read(json); return obj; } However, this returns the following…
Abhishek Dey Das
  • 587
  • 7
  • 23
5
votes
2 answers

Java way to quickly find if a point falls in a country (polygon)

I'm hoping someone can point me in the right direction. We have millions of records flowing/streaming through where we need to do a quick lookup to determine which country polygon they fall into. Could someone recommend a complete JAVA based…
user2092856
  • 301
  • 5
  • 13
5
votes
1 answer

Geotools GeometryJSON rounding coordinates when transforming Geometry to GeoJSON

Any Geotools developers here? We discovered the following strange behaviour of GeometryJSON: Geometry geom = getGeometry(); System.out.println(geom); GeometryJSON g = new GeometryJSON(); StringWriter sw = new StringWriter(); try…
chris
  • 600
  • 7
  • 21
5
votes
6 answers

Maven Missing artifact org.geotools:gt-shapefile:jar:11-SNAPSHOT

Hello I am trying to write a simple geotools project with maven. Actually I am very new to maven. I opened new maven project I set the setting and write some code. As I know maven should download and install the needed jar files of geotools. But A…
ali insan
  • 189
  • 1
  • 5
  • 13
5
votes
1 answer

Hadoop and Geoserver

I'am intending to develop a new datastore based on Hadoop/HBase for Geotools to use it in Geoserver just to visualise Raster data (tiled satellite image). Has anyone done something similar or even know if this is possible ? I already know how to…
thiagogcm
  • 103
  • 1
  • 10
5
votes
1 answer

JTS/Geotools Correct union/difference of multiple geometry

Problem : I have a shape file that contains the targeted area (yellow). I have a shape file that contains the buildings (green). I need the white space in the yellow area. picture : ://db.tt/kjjXZlQF My solutions : Get all buildings in that area…
5
votes
1 answer

Incorrect coordinate transformation Gauss-Kruger - WGS84 using GeoTools

I´m having a problem concerning the beloved coordinate transformation with the aid of GeoTools: I would like to convert a set of coordinates from Gauss-Kruger (zone 5, EPSG 31469) into ordinary WGS84 coordinates (EPSG 4326). I´ve built a code with a…
sebjun87
  • 61
  • 1
  • 3
4
votes
3 answers

Determining whether geographic point is within X meters of a state border (using shapefile for border data)

So I'm writing a Java app, and I've got an ESRI Shapefile which contains the borders of all the U.S. states. What I need is to be able to determine whether any given lat/lon point is within a specified distance from ANY state border line - i.e., I…
DanM
  • 7,037
  • 11
  • 51
  • 86
4
votes
2 answers

How to filter data from an hstore column with GeoTools?

I'm trying to filter features from a feature table in a PostGIS enabled database with GeoTools. My configuration: PostgreSQL 8.4 PostGIS 1.5 Osmosis 0.40.1 OSMembrane build 845 GeoTools 2.7.4 Setup I set up my postgis enabled database by executing…
pmoule
  • 4,322
  • 2
  • 34
  • 39
4
votes
1 answer

How to create regular hexagons on java to put on a map?

I'm trying to create regular hexagon polygons, but when visualized on a map they are stretched vertically. This is how I do it: List hexagons = new ArrayList<>(); CoordinateReferenceSystem sourceCRS = DefaultGeographicCRS.WGS84; …
Ante
  • 41
  • 3
4
votes
1 answer

DatumFactory is not an ImageIO SPI class

We are migrating our project to java 9 and I am getting this exception while using geotools: java.lang.IllegalArgumentException: org.opengis.referencing.datum.DatumFactory is not an ImageIO SPI class at…
Gent
  • 83
  • 1
  • 6
4
votes
1 answer

(Geotools library) How to convert Korean coordinates (EPSG:5179) to Decimal Degree coordinates (EPSG:4326)

I have a problem when converting from Korean 2000 Coordinates System (EPSG:5179) to Decimal Degree (EPSG:4326). We are developing Geographical Information System for Korean company. We were using Geotools library for mulitiple backend…
4
votes
1 answer

vectorize polygon using JTS with range lookup

I try to vectorize an image using java i.e. geotools with JAI. The code is minimal and works just fine in intelliJ InputStream stringAsStream = new ByteArrayInputStream(inputAsciiGrid.getBytes(StandardCharsets.UTF_8)); SimpleFeatureIterator…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
4
votes
1 answer

Add new column attribute to the shapefile and save it to database using Geotools Java

I am transforming a shapefile by adding a new column attributes. Since this task is performed using Java, the only option I know for now is using Geotools. I have 2 main concerns: 1. I am not able to figure out how do I actually add a new column…
GeoFresher
  • 301
  • 2
  • 12
4
votes
2 answers

Maven package error

I am working on a project which requires a geotools dependency. Before I was getting the following error: Exception in thread "main" java.lang.IllegalStateException: cannot initilize transformation: Authority "EPSG" is unknown or doesn't match the…
user3597555
  • 73
  • 1
  • 5
1 2
3
37 38