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

learn more… | top users | synonyms

20
votes
4answers
5k views

How to bypass 10 character limit of field name in ShapeFiles?

I'm exporting geometry with attached text attributes from oracle database to esri shapefile format (.shp) with Java and Geotools library. Attribute columns in our database have names with more than ...
11
votes
3answers
855 views

How to build a portfolio for a GIS/Java career path?

I have been a GIS Analyst for over 10 years and am currently studying java (50% through the course). My plan is to develop GIS applications mainly focused towards open source solutions. I would like ...
7
votes
3answers
3k views

How to write GML with Geotools?

I'd like to write GML using Geotools. Unfortunately, I can't find documentation on a GML Writer (except for this one from 2006: http://docs.codehaus.org/display/GEOTOOLS/WFS+++GML+DataStore). Could ...
7
votes
2answers
1k views

For a given feature find the closest point along a given path

Looking for a Java based (foss4g) solution for the following: I am using a path along with a buffer to find features that are along the path. For each of the features returned I want to find the ...
6
votes
1answer
1k views

Find Perpendicular Distance and Minimum Perpendicular Vector between a Point and a Line using GeoTools and JTS

I have a line formed by 2 lat/lon pairs, and the lat/lon of a point. I would like to find out the perpendicular distance between the line and the point on the Earth surface (can assume Earth as great ...
5
votes
2answers
2k views

geotools vs. geotoolkit

The geotoolkit.org web site has very little documentation. From this document I get the impression that it is a fork from geotools; is that right? If so, what were the motives/objectives of the fork?
5
votes
1answer
147 views

Good projection for covering most of the world

I'm writing an application for building navigation routes thru the city streets, and not quite sure what projection would be best. I tried EPSG:3587, however, the tools I'm using - GeoTools and ...
5
votes
2answers
5k views

How to parse KML data using geotools?

Geotools contains some packages dealing with KML: org.geotools.kml and org.geotools.kml.bindings. I assume it was designed to parse KML data. Do you know how to use it?
5
votes
1answer
445 views

What is the unit of measurement for buffer calculation?

What is the unit of measurement used by Geometry class for it's buffer calculation ? Api doc currently defines it as " distance - the width of the buffer (may be positive, negative or 0)" I need to ...
5
votes
1answer
296 views

How to add Opencarto to a Geotools project?

I've installed geotools through maven (and m2ecplise) but i'm not able to add opencarto library to my project. (As you can guess, I'm new to java) I tried by adding opencarto's main folder as library ...
5
votes
2answers
1k views

Fastest way to convert shapefile to postgis in java

I have been using geotools to read shapefiles and import them into postgis. Unfortunately, when large files are being imported, this leads to a massive lag time --8000% of shp2pgsql piped into pgsql-- ...
4
votes
3answers
285 views

Differentiating a building from a road on a map?

This question was originally asked here by Steven and I felt the question was better asked here. Steven would also like to know the sources Google buys it maps from. I remember seeing a post about it ...
4
votes
2answers
126 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 ...
4
votes
1answer
4k views

How to draw polygons on an existing map?

If you want a map with some circles, squares, etc. representing cities or something else you can use the following code. Note that you can change the map and the coordinates with yours, and you'll ...
4
votes
1answer
132 views

Global projection with zero scale distortion at non-zero latitude

I am looking for a global projection with zero scale distortion at non-zero latitude. I have tried using an Oblique Mercator projection centred at a specific latitude and longitude of centre (with ...
4
votes
1answer
1k views

Write out a WKT file from a loaded shapefile

We are looking to load and display a shapefile, simple polygons, then write out a WKT string of that shapefile and have the user save it somewhere. Does anyone have some code snippets of that very ...
4
votes
1answer
2k views

Convert Gauss-Kruger to UTM

How to covert Gauss-Kruger coordinates to UTM coordinates with GeoTools java library? As I have figured out the location (zone, country) is important. I need the calculation for Slovenia.
4
votes
1answer
531 views

Geotools: Efficiently writing a GeoJSON stream into a Shapefile

I've been trying a few solutions to efficiently convert GeoJSON into a shapefile without having to store all features in memory. I'm using GeoTools 9.2. The problem is not so much in how to stream ...
4
votes
1answer
465 views

What do I need to create 3D model of real terrain?

I'd like to create 3D model of some real terrain (to be exact it's about some real roads and only as much as 80m to 100m of roadside - 40m to 50m of each side). As I don't have access to highly ...
4
votes
0answers
265 views

Can GeoTools parse GML CRS definitions?

A kind of branching of this question. Soon I will need to handle GML Coordinate Reference Sysyem definitions in a Java servlet. Links: GML OGC reference. Concrete example. I know that GeoTools ...
4
votes
0answers
553 views

Could not obtain native oracle connection [closed]

Anyone knows the the cause and how to resolve the "Could not obtain native oracle connection" error? I'm using GeoTools 2.7.4, a oracle 11g DB, ojdbc14.jar, and a simple java code on a Tomcat 6 like ...
3
votes
1answer
135 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 = ...
3
votes
1answer
211 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 ...
3
votes
1answer
517 views

converting/parsing geojson into com.vividsolutions.jts geometry

Does any has any experience with converting string geojson into com.vividsolutions.jts geometry object (point, polygon, etc). Maybe there is some java library I cannot find. Greets!
3
votes
1answer
88 views

Abstract Data Store

I'm trying to create a new extension for data store in geoserver that can take data from in-memory arrays.But as I'm kind of new to geotools I'm not sure how to do it.Any help would be really ...
3
votes
2answers
754 views

Merging Shapefiles With Geotools

I am trying to merge some shapefiles with different schemas in geotools. Im aware of ogr2ogr, but for now I would like to figure out this problem with Geotools. The steps I'm taking are: 1) Create a ...
3
votes
1answer
337 views

What is the best API to use GeoTools or uDig (for the context of my application)?

I am trying to develop a java application that displays : Google maps, Openstreetmap and Bing Map Data. So which is the best SDK to use in this contet Geotools or uDig ?
3
votes
1answer
69 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 ...
3
votes
1answer
210 views

How to write GML parser with Geotools?

I wrote a Parser for a GML file from the OS Mastermap with geotools 8.4. With one part I still have a problem. This sniplet of the xsd: <complexType name="RoadLinkType"> ...
3
votes
1answer
904 views

How to overlay a Shapefile on a WMS layer using Geotools?

I am trying to overlay a shp file on wms layer using the example http://docs.geotools.org/latest/userguide/tutorial/raster/image.html. Each time I want to read the format of the file to get a reader ...
3
votes
1answer
266 views

Problem in displaying a GeoTiff image in JMapFrame

I'm trying to display a GeoTiff image with no projection but where the geographical extent (bounding box) is known: reader= format.getReader(new File(sImageName)); GridCoverage2D gridCoverage= ...
3
votes
1answer
172 views

Repaint seems not working when called multiple times from the same method

I have the following scenario: displaySelectedFeatures(IDs); then some code... and then: displaySelectedFeatures(features); Display selected features looks like this: public void ...
3
votes
1answer
199 views

Add NZGD2000 Coordinate Reference System

I'm not sure if this is the right place to ask, but... I've been playing with GeoTools 8.0M-1, in particular trying to read some GeoTiffs. Each time, it crashes with the error No code "EPSG:2193" from ...
3
votes
1answer
542 views

Geomajas: how to write an xml file to config a layer (GeoToolsLayer) fetched from Geoserver?

I need to connect to Geoserver, fetch the layer and display it in Geomajas. I have followed the instruction in this link http://www.geomajas.org/node/280 but it doesn't work for me. The map is just ...
3
votes
1answer
35 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[" ...
3
votes
1answer
75 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 ...
3
votes
1answer
591 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 ...
3
votes
0answers
90 views

Filtered SimpleFeatureCollection really slow on Map and other operations

I'm working with a shapefile having about 85.000 features. I need to select some of these using a filter and then showing these on a map. Now... If I draw the entire shapefile's features the creation ...
3
votes
0answers
76 views

Why are date vaules displaying a trailing 'Z' when layers are published with Geoserver and a PostGIS data store?

I have published various layers using Geoserver 2.2.x with a PostGIS 2.0.1 (PostgreSQL 9.1.x) data store. Fields that only have date values and not time/timestamp related values are stored as date. ...
3
votes
0answers
484 views

What is the best way to convert WKT String to GML String

What is the best way to programatically convert WKT String to GML String? Every reasonable library (at best available in some Maven repository) can be used. Till now I came up with this solution ...
3
votes
0answers
196 views

Illegal argument exception while reading tiff image using GeoTools

I am working on a Java swings based GIS application to project my tiff image as maps . But each time I run my application I get Illegal argument: "semiMajorAxis=�" . The tiff images I have are working ...
3
votes
1answer
311 views

How to couple GeoTools GML bindings for encoding to GML 3.1.1

I've successfully created GeoTools (8.3) bindings for parsing and encoding XML bindings as described in their tutorial: http://docs.geotools.org/latest/userguide/library/xml/internal/bindings.html I ...
3
votes
0answers
161 views

Is there a way to create raster by interpolating point values using GeoTools 8.2?

im new in using GeoTools (8.2). I was able to create shp from asc file which contains my data. Now my question is is there a simple way to create (interpolate) a simple shapefile (only points) to ...
3
votes
0answers
456 views

How to sort a SimpleFeatureCollection using GeoTools?

I have a featurecollection: SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(dbFeatureType); SimpleFeatureCollection collection = FeatureCollections.newCollection(); while ...
3
votes
0answers
234 views

Symbolizer with external GIF image is not rendered pixel-perfect

We want to pinpoint some locations on a map with some external GIF symbolizers. The issue we have is visible in the attached image*: looks like somethings happens on a sub-pixel level, so that the ...
3
votes
0answers
258 views

How to get distinct values from multiple columns in GeoTools?

Is there a way to get distinct values from multiple columns in geotools? I know I can get unique values from a column like this: SimpleFeatureSource featureSource = ...
2
votes
3answers
4k views

Displaying Google Maps and OpenStreetMap map in Java?

Is there any Java API that is like OpenLayers ? I would like to display google Maps and Openlayers Maps in a java application
2
votes
2answers
307 views

Conversion of point grid to a raster with open source tools (Gdal, QGIS …)

I'm looking to do something which seem simple to me, but I haven't found a solution since 2 days I looked for. I've got a Postgis DB with lot of points (WGS84) spaced of 100 meters which cover a ...
2
votes
2answers
812 views

How to add a background map to a java project?

I'm new at GIS. I am trying to make a java application that can display a map with certain points. I have achieved this using the geotools library. However, I want to put the map from OpenStreetMap or ...
2
votes
2answers
751 views

GeoJSON to Shape file conversion with geotools

Can someone please provide me an example of how to convert GeoJSON to Shape file using geotools?