GeoTools is an open source Java library that provides tools for geospatial data.

learn more… | top users | synonyms

0
votes
1answer
8 views

Check if Point belongs to LineString in Geotools

Is there any way to check with Geotools if a point is placed on a LineString. I am trying to retrieve street names of a route obtained from a routing algorithm. The route is displayed in gps ...
0
votes
1answer
14 views

GeoTools exception: failed to connect to EPSG database

I downloaded the GeoTools 11.2 binary and am attempting to get it to run in my Netbeans java application. I tried to run this part of code: ... SimpleFeatureSource source = ...
3
votes
1answer
499 views

GeoTools WFS Feature retrieval

I am trying to use geotools to retrieve the list of features served by a WFS. I am following the tutorial provided at http://docs.geotools.org/latest/userguide/library/data/wfs.html. The code that I ...
2
votes
1answer
99 views

Add features to main SDE Table with geotools

Sorry for my english, I hope you can understand ;) I'am using geotools 8.4 version. I try to copy all features from SDE Table(TEST.DBO.MM_SOURCE) to another SDE Table(TEST.DBO.MM_TEST). All features ...
1
vote
1answer
105 views

overriding showMap

This code is not working as needed. I need just to make a window with addlayer button. import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import ...
0
votes
0answers
12 views

Create a point on a map using geotools

public class GeotoolsFxTest extends Application { Group root = new Group(); Group map1 = new Group(); Group map = new Group(); Group texts = new Group(); Scene scene; private double dragBaseX, ...
1
vote
1answer
18 views

How to get the LineStrings from a MultiLineString

I was wondering if there is a way I can extract the LineStrings from a MultiLinestring object. What I am really trying to do is look into a MultiLineString and see if I have a certain LineString. I ...
2
votes
1answer
132 views

Geotools 8.4 CRS.decode invalid(?) reference to HTTP_URI_OGC

I'm trying to do a simple CRS.decode to lookup a CoordinateReference system: E.g. CoordinateReferenceSystem target_crs = CRS.decode("EPSG:4326"); However this fails with a reference to the ...
3
votes
1answer
80 views

Creating point in shapefile from latitude/longitude using GeoTools?

I m new to geotools and i find bit difficult to plot a point using the latitude and longitude values. can any one heple me out to solve my problem. GeometryFactory geometryFactory = ...
1
vote
0answers
18 views

Projecting all the points from the csv file at (0,0) in a map

I am trying to plot some points on a map using the geotools tutorial (http://docs.geotools.org/stable/tutorials/feature/csv2shp.html). Unexpectedly all the points given in the .csv file are being ...
2
votes
1answer
1k views

Getting MongoDB working with GeoServer 2

I'm trying to use MongoDB with GeoServer but it is actually not working at all. Someone once posted this: Getting MongoDB Working with GeoServer, but since he could solve his problem without any help ...
1
vote
1answer
18 views

GeoTools and image storage / retrieval

Please can someone let me know how I can create a schema (using SimpleFeatureTypeBuilder()), read and write image data? Simple data types (Integer/Float etc) work fine but how do I handle image data?
1
vote
1answer
102 views

GeoTools 10 - Convert Raster To Vector

I am fairly green with GeoTools, and having a hard time converting a raster (GridCoverage2D) into a vector format. In the hours I've spent searching this site and Google, there seems to be multiple ...
0
votes
1answer
101 views

Opening shapefiles with geotools

Trying to make a simple class that will read shapefiles and eventually be able to pull out the coordinates/attributes for each feature (working with points here). But can't quite figure out geotools. ...
2
votes
0answers
59 views

How to convert shp to csv

I am trying to convert my shape files to csv through a batch processing in Java using Geotools. The problem is I have more than 500 shape files (point features). The code is working fine for a small ...
3
votes
1answer
103 views

Coordinate conversion (EPSG:3857 to EPSG:4326) using OpenGIS/JTS too slow

I am using the Java based libraries of OpenGIS and JTS to convert coordinates from EPSG:3857 to EPSG:4326 to proceed to compute the distance using the Haversine formula. The distance features in a ...
0
votes
0answers
10 views

How to read *.map file by using geotools api in Java? [duplicate]

How to read *.map file by using geotools api? String filePath ="C:\\CTO-New\\SOCLOMO\\Location\\Map Info FIles\\New folder\\18-july-2014\\1301\\filename"; File file = new File(filePath); ...
1
vote
3answers
90 views

How to convert multiple csv files to shp using Java

I have some 100 CSV files. I want to convert them in shp format using Java. The csv file contains lat long information in WGS84. I can understand it is a batch processing and it is difficult to do in ...
1
vote
1answer
26 views

Java how to create geotiff from points

I have an array of objects where each object has three fields: lat, lon, and category. It is essentially pixels that have been given a land use category. I cannot figure out how to turn this data into ...
2
votes
0answers
27 views

Ortholines in GeoTools

I am using GeoTools 10.7 to generate a map with decorations in my Java application. One of the feature I need in the map is to display ortholines both latitude and longitude. The lines will need to be ...
1
vote
1answer
80 views

Displaying coordinate references in GeoTools?

I'm using this library to finish my final project and I have to say I'm no familiar with the maps worlds. My question is if geotools has a method to show automatically the coordinates references in ...
1
vote
1answer
31 views

Importing a Shapefile in SpaceStat with GeoTools [duplicate]

I've just discovered the GeoTools tutorial to generate a Shapefile from a CSV containing a list of cities. I've managed to make it work but when I try to create a new Geography in SpaceStat, importing ...
1
vote
1answer
54 views

Missing class org.geotools.util.Version

Full story below, but essentially I'm trying to use Geoserver and it needs the class org.geotools.util.Version, but it can't find it even though I can see it's in the appropriate jar file. Something ...
2
votes
1answer
74 views

Extracting data from Natural Earth using GeoTools java class?

I wrote a small java class to extract country boundaries from naturalearthdata.com data. My problem is that the coordinates do not match with OSM map, the whole polygon is shifted... e.g. according to ...
1
vote
1answer
47 views

How to display additional features

In my application I have a gis file to render an (java BufferedImage) image of countries with geotools which is sent directly to the browser. The colours of the countries (plus name and additional ...
2
votes
0answers
110 views

How to read each pixel of each band of a multiband GeoTiff with GeoTools Java

I am new to working with Raster in GeoTools-very experienced in java. My goal is to read in a geotiff that has multiple bands, then create a HashMap for each pixel, where the key is simply the lat/lon ...
1
vote
1answer
311 views

Version problems with Geotools CSV2SHP example

I'm trying to use the CSV2SHP tutorial. I spent some time trying to get it to run but using v10.x of Geotools causes the shapefile to be output with no geometries. For instance if I open it in QGIS, ...
0
votes
2answers
279 views

Geotools writing shapefiles without geometries [duplicate]

When I am writing a shapefile according to CSV2SHP tutorial, it contains features without geometries. I use version 10-SNAPSHOT. For example the result of ogrinfo looks like below: D:\>ogrinfo ...
0
votes
0answers
33 views

Is there a way to retrieve/query country data from a shapefile programmatically using map coordinates in GeoTools?

I am using Geotools to parse and draw a shapefile. Now; when I draw that map I receive coordinates with this bit of code for my Flight Line button. void selectFeatures(MapMouseEvent ev) { ...
0
votes
0answers
79 views

Splitting multiple polygons with a line in JTS geotools

i am using geotools as my GIS map solution. now i want to split multiple polygons to build a road or river. passing through multiple polygons so, can you plz help me how to do this splitting a single ...
1
vote
1answer
38 views

Test for polygon orientation

I'm want to merge multiple geometries with Geotools (starting off with one geometry) but the result is a polygon that has a clockwise orientation. This gives a invalid geometry. My code for the merge: ...
0
votes
0answers
10 views

Display coordinate references in Geotools

I'm using this library to finish my final project and i have to say I'm no familiar with the maps worlds. My question is if geotools has a method to show automatically the coordinates references in ...
0
votes
0answers
186 views

Add labels for printed map (GeoTools)

I have some problems with labels for printing map with GeoTools. Next code (with some cuts, code on Scala language) can help me for printing map: val map = new MapContent() val parser = new ...
0
votes
0answers
56 views

Drawing Line on existant Shapefile in Geotools

I have a shapefile that is opened and looks as such: Now I am attempting to draw a line from two points I click on that map; however the code they give for the QuickStart.java example is ...
0
votes
1answer
576 views

I nead to find the nearest places based on latitude/longitude points

I have a java aplication backed by a mysql database which contains events with locations (latitude/longitude), the location data is saved as POINT data type. I nead to find the nearest events in some ...
0
votes
1answer
30 views

how can we convert vector data to raster data in geotools

In my project iam able to open and save shape file. I want to convert this vector data to image format as a tiffimage plese help me the procedure to do the same.
1
vote
0answers
176 views

GeoTools example for Shapefile export to already existing PostGIS table

I'm a newbie to GeoTool API, and I'm looking for a way to export the specific shapefile to the specific already existing PostGIS table with GeoTools (the underlying problem I face is that PostGIS ...
0
votes
0answers
42 views

Geotool SwtMapPane draws in view but not in TitleAreDialog

I've written a very basic rcp app to show points and lines in a view. When I tried to move this code to a wizard page, it gave the error below. When I use code that simply loads and displays a ...
0
votes
1answer
68 views

A simple geotool app example

I've been playing around with the GeoTools libraries, but I can only show shape files and no custom layers. Requirements are that it must use the SWTMapPane and not via the static ...
2
votes
1answer
133 views

Create image (TIFF/PNG) from geodetic (lat/long) data

Using Java, I need to render a bunch of geodetic data to an image, ideally TIFF or PNG. Specifically this is weather data, with each sample having a latitude, longitude, and amplitude value. I'd like ...
1
vote
1answer
102 views

Transactions in Geoserver / WFS - Is it possible to know which “action” failed?

I'm trying to implement transactions for some queries to Geoserver. I'm using plain HTTP Post to make the requests, from Java. One of those queries looks something like : <wfs:Transaction ...
1
vote
1answer
31 views

Problem Inserting feature with Geotools WFS

With this tutorial http://docs.codehaus.org/display/GEOTOOLS/Data+Writing When I try to insert a feature try { DataStore geoToolsClient = getGeoToolsClient(); Transaction transaction = new ...
1
vote
1answer
58 views

Can I define a transformation between 2D and 3D in Geotools?

I'm using Geotools, and I need to convert coordinates between 2D and 3D coordinate reference systems. I recognize that there's no universally-correct way to do this: 2D -> 3D means "making up" a Z ...
4
votes
2answers
101 views

How do I construct (or select) an appropriate local Cartesian coordinate system, for an arbitrary small area?

I'm relatively inexperienced with coordinate reference systems, so please bear with me if I'm not putting this clearly. I have existing software which works with an abstract (un-referenced) 3D ...
2
votes
1answer
51 views

Creation of tiled grid in JAVA with geotols

I am trying to create a grid using GeoTools in JAVA, covering specyfic area with resolution 50 m (distance between two points). To do so I have two points: the most nortwestern (let's call it NW) and ...
1
vote
0answers
78 views

Converting geometry to geography using org.geotools.geometry.jts.JTS

I'm trying to convert com.vividsolutions.jts.geom.Geometry to geography, using the GeoTools package - org.geotools.geometry.jts.JTS. This is my code: public Geometry getGeography() { Geometry geo ...
2
votes
1answer
22 views

Where are descriptions of attributes in datafiles on naturalearthdata.com?

I have downloaded some datafiles from naturalearthdata.com site. For example, ne_50m_admin_0_countries feature source contains dozenz of attributes with names like scalerank, level, mapcolor7, ...
0
votes
0answers
79 views

Java GeoTools - Getting CRS from SRID

I might confuse between two things, but I need to do some calculation on my polygons (distance, area etc.). Using the WKBReader, I'm getting the geo: WKBReader wkbReader = new WKBReader(); byte[] a = ...
2
votes
1answer
54 views

Bad calculations with Colombian projection (EPSG:3116)

Solved, reading mail-archive I can understand that there is a conflict between: gt-epsg-wkt-9.2.jar gt-epsg-hsql-9.2.jar I tested removing each one, with 'hsql' I get the same wrong result, but ...
1
vote
0answers
140 views

how to publish the layer from Mongodb store in geoserver?

I am using geoserver 2.5 MongoDb 2.4 Windows 7 64bit I am imported json data file into MongoDb using the below query. mongoimport --db GeoMongodb --collection states --file E:/states.json ...