GeoTools is an open source Java library that provides tools for geospatial data.
16
votes
3answers
2k 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 ...
8
votes
3answers
259 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
2k 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
830 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 ...
5
votes
2answers
1k 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
2answers
3k 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
256 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
1answer
327 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
3answers
257 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
1answer
195 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 ...
4
votes
1answer
50 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
2answers
231 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
1answer
474 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
0answers
198 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
323 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
662 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 ...
3
votes
1answer
185 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 ...
3
votes
1answer
116 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
104 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
165 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
363 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
0answers
75 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
116 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
77 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
1answer
273 views
Geotools - overlay shapefile on WMS layer
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
0answers
147 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
114 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
178 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
503 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
466 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
1answer
185 views
Geotools // buffer using different CRS
I'm currently having a problem with Geotools.
I try to generate a buffer (in meter using Lambert 72) on a map that has WGS84 as it's coordinatesystem.
(problem is a bit like this one: ...
2
votes
2answers
3k views
convert wgs84 coordinate to Google Map coordinate system(EPSG 3785) with geotools and java
Could you please point me out where can I make such a transformation:
convert wgs84(EPSG 4326) coordinate to Google Map coordinate system(EPSG 3785), and vise versa.
Thank you.
2
votes
3answers
989 views
Rendering a shapefile with a custom projection in GeoTools
I have an image, a shapefile, and a method which can translate an x/y pixel location from the image into a latitude/longitude point or vice versa. I'm trying to use Geotools to render the shapefile on ...
2
votes
2answers
2k views
How to convert UTM (easting,northing) to Geographic (lat,long) in degree decimal using geotools
I want to convert easting, northing values in meters of UTM to lat,long of geographic coordinate system using geotools
2
votes
1answer
440 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 ...
2
votes
2answers
280 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 ...
2
votes
1answer
115 views
ImageLab Program Problem
I am new to GeoTools. I was trying the samples in http://docs.geotools.org/latest/userguide/tutorial/raster/image.html.
I am not able to run the ImageLab sample code. I know it would be some lack in ...
2
votes
1answer
92 views
Can I use a Geotools raster layer in a Geomajas webapplication?
I am working on a Geomajas web application and have a Geotools RasterLayer (a GridReaderLayer to be precise) that needs to be integrated with the map in the Geomajas app.
I have been searching the ...
2
votes
1answer
122 views
How to edit and use text produced by Feature InfoTool?
How can I access and use text from Feature InfoTool dialog. I'm working with JMapFrame. I found this snippet:
InfoTool tool = new InfoTool() {
@Override
public void ...
2
votes
0answers
118 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
0answers
90 views
Implement a WFS Server using Geo tools
I need to implement a WFS Server using Geo tools, I have an application developed in Java using a spatial database. I wish to develop a WFS service using GeoTools. As a first step, I am implementing ...
2
votes
0answers
84 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">
...
2
votes
1answer
63 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 ...
2
votes
0answers
155 views
How to open image file saved with JAI in Geotools?
I need to find NDVI and other vegetation indices and then find changes in time with tif images.
I've been using Geotools for this. I took 2 tiff images, then using QGIS I changed them to PNG because ...
2
votes
0answers
29 views
How to convert a shapefile to WKT with GeoTools snapshot 9? [duplicate]
Possible Duplicate:
Write out a WKT file from a loaded shapefile
I need to convert a shapefile to WKT to be read in OpenLayers. The shapefile is one that has been created by Geotools. ...
2
votes
1answer
119 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 ?
2
votes
0answers
166 views
create geotiff from shapefiles
I need to colorized geometries from shapefiles and convert them to raster image (geotiff).
I tried to use geotools's VectorToRasterProcess and ImageWorker
("d:\gis\tmp\32 27 25 w4.shp" is path to my ...
2
votes
0answers
67 views
GeoTools, add column in query with CQL
I'm trying to query the database (DataStore) and want to let the datastore calculate a value for me.
In SQL I would do it like this:
SELECT name, ST_Area(ST_Intersection(the_geom, ....) AS myValue ...
2
votes
0answers
67 views
MultiPolygon from database
I would like to know how to create an instance of a Multipoint from a PostGIS database..
I do the query , then got the ResultSet named "area" , the column with MultiPolygon attributes is named "geom"
...
