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
1
vote
1 answer

GeoTools: how to get Bursa-Wolf parameters from GeodeticDatum instance

I have an instance of type GeodeticDatum. I can get ellipsoid name, flattening, axes using methods datum.getEllipsoid() and getName(), getInverseFlattening(), etc. How can I get Bursa-Wolf parameters (towgs84) without converting datum to WKT string…
Adam
  • 842
  • 2
  • 14
  • 22
1
vote
0 answers

geotools : Could not find element declaration for

I don't find solution of my issue. I try to create a KMl file using geotools. I 'm stuck : org.geotools.xsd xsd ${geotools.version}
alban
  • 11
  • 1
1
vote
2 answers

Show line on map which connects points - receiving an empty map

I want to plot a line which connects 2 points on a map. The code I am using: public class Quickstart { public static void main(String[] args) throws Exception { // display a data store file chooser dialog for shapefiles …
George
  • 5,808
  • 15
  • 83
  • 160
1
vote
1 answer

read coordinates from shp file and compute distance

I want to compute the nearest distance from a point to a shp file (ports.shp) from natural earth data. For example, I am loading the features of the file: ... String filename = "10m_cultural/ne_10m_ports.shp"; ... public static void Calcs(String…
George
  • 5,808
  • 15
  • 83
  • 160
1
vote
1 answer

distance between multilinestring and point

If I have to calculate the nearest distance between a point and a polygon (point and lake (naturalearthdata.com) for example), I can do (taken from here): ... LocationIndexedLine line = new LocationIndexedLine(((MultiPolygon) …
George
  • 5,808
  • 15
  • 83
  • 160
1
vote
1 answer

Cannot find Geotools datastores when using maven assembly plugin

I want to access different Geotools datastores using Geotools (v. 17.1). In my POM I am using the maven assembly plugin (v. 3.0.0) to aggregate my project output: org.apache.maven.plugins
Lars
  • 2,315
  • 2
  • 24
  • 29
1
vote
1 answer

Retrieve map data via WFS with GeoTools

I'm trying to retrieve data from a LuciadFusion wfs server using GeoTools, but is having troubles finding examples on how to achieve my goals. The idea is that I'm tracking moving stuff, and want to retrieve map data (features) from the areas my…
Mars
  • 45
  • 1
  • 6
1
vote
1 answer

GeoTools no such attribute error when parsing GeoJson

According to the GeoJson spec (https://www.rfc-editor.org/rfc/rfc7946), features with different sets of properties are allowed, but when i am processing my GeoJson file using FeatureJSON.readFeatureCollection i get an error saying no such…
ido flax
  • 528
  • 1
  • 10
  • 19
1
vote
0 answers

JAI can't execute in native spark - only in sbt and as a separate scala function

I want to use a library (JAI) with spark to parse some spatial raster files. Unfortunately, there are some strange issues. JAI only works when running via the build tool i.e. sbt run when executed in spark. When executed via spark-submit the error…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
1
vote
1 answer

NullPointerException when trying to connect to WFS

I am new to WFS and geotools. I'm trying to connect to the LRIS WFS. Code is below: String getCapabilities = "https://lris.scinfo.org.nz/services;key=ENTER-KEY/wfs/layer-66?service=WFS&request=GetCapabilities"; Map connectionParameters = new…
1
vote
3 answers

How to use GeometricShapeFactory in geoTools to create a Circle on map

I am currently using the below code to create a GeoJson Polygon. this gives me a bad circle which is not valid... in this case RADIUS = 1609.34 , which is 1 mile in meters. public GeoJsonPolygon createRadiusPolygon( Point point,double…
Jeryl Cook
  • 989
  • 17
  • 40
1
vote
1 answer

spark whole textiles - many small files

I want to ingest many small text files via spark to parquet. Currently, I use wholeTextFiles and perform some parsing additionally. To be more precise - these small text files are ESRi ASCII Grid files each with a maximum size of around 400kb.…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
1
vote
1 answer

Parsing ESRI projection information to create a CoordinateReferenceSystem

I have a lot of people supplying me ESRI ASC gridded data files that were generated using ESRI tools. When they do this, the PRJ files contain the following type of information. If differs depending on the projection of course, e.g. UTM, ALBERS…
Brian McCormick
  • 449
  • 4
  • 5
1
vote
1 answer

Java GeoTools: how to find distance from a point to closest polygon in shape file

So I have a shp-file containing a bunch of polygons. In this case, a polygon is a body of in-land water (like lakes and that kind of stuff). My system is tracking a moving object, so in order to determine what this object is, I would like to see if…
Mars
  • 45
  • 1
  • 6
1
vote
0 answers

Create shapefile on Appengine preferably on Java

Hi i would like to create a shapefile(.shp .shx .prj .dbf) based on a KML file on appengine. My project is on java. I tried to use geotools, and was able to create .shp .shx .prj on Appengine (with some changes on geotools to save on Google Cloud)…