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

learn more… | top users | synonyms

1
vote
1answer
7 views

Trouble in Natural Earth Shapefile “jumps” read using GeoTools

I'm using GeoTools 12.0 to read in Natural Earth data. I'm really happy with the performance, and ease of implementation. But, I'm having trouble reading in very large polygon data. The 110M Ocean ...
1
vote
1answer
15 views

How to split a geotiff into a standard tiling scheme with Geotools in Java

I would like to tile random geotiffs to a standard grid, with a standard size of 256X256 using Geotools in java. My use case is as follows: I receive a "stream" of raster data in the form of multiband ...
1
vote
0answers
8 views

Geotools WFS basic authentication

I'm trying to retrieve data from remote WFS server which requires basic https authentication using GeoTools. I defined connection parameters for username and password like ...
0
votes
0answers
9 views

Linear interpolation on raster data, save result (geoserver)

I am trying to perform a linear interpolation on a coverage layer (Source data is in EHdr Coverage format, file extension: .flt). Ultimately, I want to use the interpolated layer as input to a WPS ...
3
votes
2answers
72 views

How to create a map and save it to an image with GeoTools

I would like to create a map with GeoTools and save it to an image (e.g. JPEG). My requirements are simple: Create a map of the world with 2 layers: Political boundaries and a graticule. The layers ...
0
votes
1answer
15 views

Use coordinates from Geotools geometry-object to send request to Webserver

I have a polygon as a Geotools Geometry Object. No I want to use the coordinates of the polygon to send a request to a webserver. The webserver demands the coordinates to be in the following format ...
0
votes
0answers
22 views

How can I draw a Line on a Shapefile?

I have a problem, in Java I can draw points on my Shapefile, but I don´t know how to draw a Line. I found the SimpleLineSymbol, but don´t know how to use it further. My first try was LineString ...
1
vote
0answers
46 views

Why does this Geotools Java reprojection to WGS-84/4326 cause offset?

I am using the block of code below. I am reading in a geotif with a UTM zone projection and converting it to 4326. I am pulling out certain multiband values and creating a new raster, when I plot the ...
0
votes
0answers
13 views

Problems resampling and displaying grid coverages with EPSG 27200 <-> 2193

What is wrong with this code? Given a BufferedImage , a world file and a coordinate system I construct a code coverage as follows: Rectangle actualDim = new Rectangle(0, 0, ...
0
votes
0answers
9 views

How do I get new world file parameters from a resampled grid coverage?

I have a grid coverage that I resample (reproject) and I would like to find out what the new matrix coefficients that would be outputted to a world file. How do I find them?
1
vote
1answer
46 views

Geotools create/save shapefile has no geometry information

When I create and save a shapefile in GeoTools, then open it in ArcGIS or QGIS, it doesn't show up on the map, even though the features are there in the attribute table (and all attributes I added ...
3
votes
1answer
196 views

Geotools shapefile and geotiff displaying problem in JMapPane

I'm trying to get a JMapPane to show up in a JPanel, but without success. Below is the JPanel instance containing the map. I am importing a geotiff and a shapefile layered in that order. Not only does ...
0
votes
0answers
44 views

Parsing GML results in empty FeatureCollection

I am issuing a call to a WMS to get feature information. <?xml version="1.0" encoding="UTF-8"?> <wfs:FeatureCollection xmlns="http://www.opengis.net/wfs" ...
2
votes
0answers
45 views

Geotools wfs getFeature

I want to retrieve the feature Collection from a wfs server with the java library GeoTools. I tried this code, but unfortunately the program fails to execute. public class App { public static void ...
2
votes
0answers
39 views

how to get a feature from coordinates in geotools [closed]

I'm working on web services in Java and using GeoTools java api for wfs operations. I have a wfs store and a lot of features in it. I do some operations via geotools wfs api for example buffer, ...
3
votes
1answer
41 views

How to set decimal precision in shapefile via javacode

we are using the below code : SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); builder.setName("Location"); String wkt = "GEOGCS[" + "\"GCS_WGS_1984\"," + " DATUM[" ...
2
votes
0answers
29 views

GeoServer: `org.geotools.process.raster.AffineProcess` could not be instantiated, how to fix?

I have installed GeoServer from OpenGeo Suite 4.1 on a fresh Unbuntu 12.04 following Boundless instructions. Now I wanted to test geoscript-groovy, and installed groovy, geoscript-groovy-1.3.1, ...
0
votes
0answers
36 views

Exporting a shapefile with geodetic values in geotools

I have collections of polygon features. Each point in a polygon has local cooridantes (x y values) and geodetic Coordinates (latitude and longitude in decimal degree) i can easily export the shape ...
3
votes
1answer
76 views

How to find intersected line is from left or right on another line?

There is a main LineString and its direction is known. I want to find the side of intersected lines to this main line. Example image: Black line is main LineString and red one is intersected ...
0
votes
1answer
22 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
42 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 = ...
0
votes
0answers
40 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
38 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 ...
3
votes
1answer
212 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
19 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 ...
1
vote
1answer
23 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?
2
votes
0answers
199 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
276 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
11 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
2answers
122 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
40 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
39 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
41 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
80 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
115 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 ...
2
votes
1answer
208 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
90 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 ...
0
votes
0answers
41 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
98 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
50 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: ...
1
vote
1answer
114 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 ...
0
votes
0answers
12 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
73 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
1k 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
55 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.
0
votes
0answers
72 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
109 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 ...
1
vote
1answer
130 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 ...
0
votes
1answer
197 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. ...
1
vote
1answer
43 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 ...