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

learn more… | top users | synonyms

23
votes
4answers
8k 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 ...
2
votes
2answers
81 views

Can I use “Web Map Service Module” and “Web Feature Service Module” of Geoserver in my project?

I'm developing a GIS application with java Srping Framework and GeoTools library. I have some vector layer. I want to get this layers with wms and wfs protocols. I've downloaded geoserver code. It ...
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 ...
1
vote
1answer
580 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, ...
8
votes
3answers
4k 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 ...
3
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 ...
3
votes
1answer
440 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 ?
5
votes
2answers
277 views

Are mixed geometry types allowed in a shapefile?

Does the shapefile support mixed geometry types (ie. point and polygon all in the same file)?
5
votes
1answer
308 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 ...
2
votes
1answer
267 views

geotools Linestring distance in meters

I want to use geotools for working with gis data. I'm most concerned about distance calculations, not so much about drawing a map. What I still couldn't figure out is how to make distance calculations ...
2
votes
0answers
65 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 ...
2
votes
3answers
6k 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
1
vote
2answers
39 views

GeoTools CRS.getAxisOrder(CRS.getAxisOrder(“EPSG:4326”)) returns EAST_NORTH (LON_LAT)

All is in the title, with GeoTools if I do : AxisOrder order = CRS.getAxisOrder(CRS.getAxisOrder("EPSG:4326")); It returns EAST_NORTH (= LON_LAT), but EPSG:4326 is defined as ordering latitude ...
5
votes
2answers
6k 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?
2
votes
1answer
1k views

What is the most efficient way to create a shapefile from resultset using geotools

I am facing a problem to write to shapefile (geotools) with respect to time, memory etc. My workflow is something like reading spacial data from database Oracle with attributes and coordinates (can ...
1
vote
0answers
136 views

How to get geoJSON from spring REST Controller?

I am developing a GIS application with java(Spring-4.1.5 + Hibernate-4.3.8) and OpenLayers. For this project I use GeoTools-13RC, HibernateSptial-4.3, jts-1.13 and jackson-2.5. In this project, I have ...
9
votes
2answers
200 views

Why do I get correct area and intersect area when use wrong projection?

I need to calculate areas and intersection areas for polygons (some real geographical objects like lake, city, country, e.t.c.). Polygons located in California, New Zealand, Russia.Anadyr, Sweden All ...
6
votes
1answer
2k 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 ...
4
votes
0answers
299 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 ...
3
votes
1answer
732 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
2k 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
0answers
675 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 ...
2
votes
1answer
1k views

GeoTools and PostGIS with ESPG:3857

I'm trying to use both PostGIS and GeoTools with the same ESPG:3857 projection, however, it looks like the projections in PostGIS and GeoTools differ. This is what I have in PostGIS: PROJCS["WGS 84 ...
2
votes
1answer
1k views

combine several polygon objects in one polygon object with geotools (is it possible)?

I have several polygon objects and I need to "merge (or combine or dissolve)" them toghether into one polygon object. With a GIS tool like Quantum GIS, I do this with Geoprocessing option "Combine ...
1
vote
1answer
122 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 ...
1
vote
1answer
204 views

Buffer Zip Region Polygon with GeoTools

What I want to achieve is to buffer a zip region geometry with a distance in meters and than get the coordinates of the new (expanded) polygon. The original geometry polygon is parsed from a kml file. ...
1
vote
2answers
336 views

How to have a nullable field included in a shapefile using the Geotools library?

I am trying to add a new field to a shapefile and need it to store null values. But by using SimpleFeatureTypeBuilder from the Geotools library and then using the Add command, it is not giving the ...
1
vote
1answer
588 views

The units of getArea() on a multipolygon within a shapefile [closed]

I am using GeoTools to find area and intersections of shapefiles. GeoTools uses the JTS geometry library (Vivid Solutions) and that has functions to getArea() but unfortunately I am not able to ...
0
votes
0answers
122 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, ...