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

learn more… | top users | synonyms

6
votes
2answers
153 views

Difference between CoordinateSystem and CoordinateReferenceSystem

What is the concept of Coordinate Reference System. You know GeoTools has a FeatureType class having getCoordinateReferenceSystem() function and also a CoordinateReferenceSystem class having ...
0
votes
0answers
13 views

Addressing a WPS using Geotools' ExecuteProcessRequest

I am trying to address a WPS that is running on a known machine to retrieve some isochrones. Below are excerpts from the relevant parts of the WSDL of said server: <schema ...
0
votes
1answer
210 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
10 views

Label rendered with empty features using geotools

I am using geotools to generate some images based on the shapefile data, it works well until I tried to add labels for the line features: the labels are rendred even there is no features in the ...
0
votes
1answer
182 views

How to add RGBA color map to single band GeoTIFF using GeoTools 2.x?

I am developing a light weight GIS application, and am looking for the simplest way to add an RGBA color map to a single band GeoTIFF using GeoTools 2.x?
0
votes
2answers
31 views

How to define a coordinate reference system with rotation in GeoServer?

I am using GeoServer and have a layer in EPSG:900913 ("Google Mercator"). I need to "rotate" the map around certain point (say, 1500000, 7000000) by certain degree (say, 30 degrees clockwise). How ...
1
vote
1answer
21 views

How to pass custom data in GeoJSON point?

I have an application, which creates a GeoJSON stream on the server, which is then rendered on the client (using CesiumJS). GeoJSON is created using GeoTools. I want to pass some custom data to the ...
0
votes
0answers
19 views

GeoServer: Filter Function problem for function if_then_else argument #2 - expected type Object

I'm facing a problem with the GeoServer SLD XML. My XML code is as follows: <Fill> <CssParameter name="fill"> <ogc:Function name="if_then_else"> ...
9
votes
2answers
204 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 ...
1
vote
2answers
189 views

Different definition of EPSG:3857 in GeoTools and QGIS

I want to do some checking if my point lies in any of the polygons defined in shapefile. So, I thought that I will determine CRS from shapefile (created in QGIS), and use it for transformation (where ...
1
vote
0answers
16 views

GeoTools How to add attribute to a schema in DataStore

As you know, you can create a schema in a DataStore. For example, you may create a table in a postgresql database like this: SimpleFeatureType schema = ...;// some schema DataStore dataStore = ...
0
votes
1answer
56 views

GeoTools decode FeatureType

Encode: 1- A way of encoding a FeatureType is : SimpleFeatureType TYPE = DataUtilities.createType("Location", "geom:Point,name:String"); GML encode = new GML(Version.GML2); encode.setBaseURL(new ...
4
votes
2answers
372 views

how to find necessary geoserver/geotools maven dependencies for a class?

I am trying to create a Web Processing Service with GeoServer. I used maven following opengeo instructions, and I get an eclipse project with a pom.xml file with dependencies like the following: ...
0
votes
1answer
36 views

Java library to compare shape files

I have county shape file & school district shape file. Once each school district file is overlay on county shape file I would like to know how much % of area of school district file covered by ...
3
votes
1answer
27 views

Add Features from KML to a GeoPackage using GeoTools

Using GeoTools v13.2 I need to add features to a GeoPackage from KML. So far I can get the features in a SimpleFeatureCollection which can be added to the GeoPackage: public void ...
1
vote
1answer
15 views

GeoTools Geometries lost when storing features to shapefile [duplicate]

As you know, the geometry column name of schema for saving into a shapefile must be "the_geom". I have a SimpleFeatureCollection with a schema, geometry name of which is not "the_geom"; It is ...
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 ...
0
votes
2answers
87 views

Check Geometry Type of a Shapefile Using GeoTools?

I want to get the type (point, line, or polygon) of shapefile using GeoTools but so far I haven't found any code. Any other Java library also works for me.
1
vote
1answer
30 views

Null save into Shapefile using geotools

When I convert csv to shp in geotools, I have an error NULL store for first attribute in my shape file. e.g. - want result: POINT(3625.55 3659.25), 2.4, 3.9 Error result: Null, 2.4, 3.9 This is ...
0
votes
1answer
195 views

Direct connection from geotools to arcgis 10.3

Is it possible to direcly connect to ESRI 10.3 database using geotools ? I use geotools 13.0 and have ESRI database set up on oracle. Previously I was able to connect to SDE using gt-arcsde-plugin ...
0
votes
0answers
44 views

How to choose a projection for area measurement on building to continental scales?

I have many geographical objects described as polylines, polygons, multipolygons. All objects are in WGS84. Object could be: a building, stadium, park, street, highway, city, state, even country and ...
1
vote
1answer
167 views

Error Reading ESRI ArcGrid File using GeoTools?

I have a raster file in ESRI ArcGrid format (e.g. hdr.adf). I would like to run some analysis using GeoTools. I've never used the coverage classes before and I'm having a few problems out of the ...
0
votes
0answers
24 views

Wrong axis order in geotools crs when reading from EPSG:4326 [duplicate]

Map<String,Object> params = ...; // postgis params DataStore dataStore = DataStoreFinder.getDataStore(params); SimpleFeatureCollection collection=...;// collection to save SimpleFeatureType ...
1
vote
2answers
40 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 ...
0
votes
1answer
24 views

GeoTools modify a FeatureType to change its name

I have a featureCollection and I want to save it into PostGIS dataStore. So I'm going to create a database table by geotools. I want to name my table "ali". But I can't rename the schema! DataStore ...
1
vote
0answers
24 views

In Geotools, why does reprojecting the origin of a GridGeometry2D results in off-the-grid coordinates?

I have a simple GridGeometry2D in Geotools 13.1 that is created like this: GridEnvelope grid = new GridEnvelope2D(0, 0, 100, 100); Envelope2D envelope = new Envelope2D(CRS.decode("EPSG:3857"), 10.0, ...
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
2
votes
1answer
509 views

Getting DataStore Problem with Geotools

I recently found an issue with Geotools and getting the datastore for a shapefile. If I try: FileDataStore dataStore = FileDataStoreFinder.getDataStore(file); -or- Map connect = new HashMap(); ...
1
vote
2answers
76 views

How to programmatically import a Shapefile into Oracle DB using Java?

What's the best approach to import a user uploaded shapefile into an Oracle DB? The dbf, shx and shp files of the Shapefile come in a ZIP Archive. Currently, we unzip programatically and then parse ...
0
votes
1answer
55 views

GeoTools, convert CRS for Google Maps

I'm trying to use GeoTools to convert coordinates from EPSG:3857 to various CRS, in order to display WMS layers on a Google Map. For example, I want to display a layer in the EPSG:4326 CRS. I have ...
0
votes
0answers
20 views

Insensitive case query in Geotools to WFS

I'm trying to make an insensitive case query from Geotools to WFS (Web feature service) datasource,I used FilterFactory2 with the method like(Expression expr, String pattern, String wildcard, String ...
3
votes
1answer
49 views

How do I produce a GeoJSON with 1 point at a certain lon/lat?

I need to create a GeoJSON string, which contains exactly one point at lon/lat 132.159633, 43.350116. I'm trying to use GeoTools 12-RC1 for that. Let's say I have following method, which is supposed ...
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 ...
0
votes
1answer
84 views

How to divide streets layer into 2 mile segments. [duplicate]

I have a streets layer which I want to divide into 2 mile segments. I have searched and read enough for days but there is no information on how to do this. The split command allows you to select and ...
1
vote
2answers
104 views

Using Geotools: How to convert these strange coordinates from a shapefile into regular lat and long?

I use this dataset from the European Union: http://www.eea.europa.eu/data-and-maps/data/administrative-land-accounting-units Opening the shapefile with Java' Geotools, I see coordinates like: ...
0
votes
1answer
52 views

Equidistant Cartesian projection for NYC

I'm working on a project in which I cluster locations in New York City based on their distance. My dataset contains latitude and longitude and thus I'd like to project it to a 2D Cartesian space in ...
2
votes
1answer
94 views

How to create a new shape file from jts geometries?

What I use: Java 1.7, JTS 1.13, geotools.api 14 What I have finished: Creating correct JTS geometries from OSM relations, ways and nodes. What I want to achieve: Create a csv file which contains the ...
2
votes
1answer
383 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 ...
2
votes
1answer
69 views

How save modified features in server side with java and geotools?

I'm developing a gis Application with java. I use Spring 4.0.1 and GeoTools-13-RC1 in server side and OpenLayers 2.13.1 in client side. In client side, I have a wfs layer and it is as follow: var ...
1
vote
0answers
40 views

GeoTools WFS Authentication

I have a connection with basicAuthentication, the getCapabilities and getFeatureStore return me correct data but when i try to commit a transaction I get the next exception: "HTTP response code:401 ...
1
vote
0answers
83 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
31 views

GeoTiff error when building Jar with GeoTools

I'm seeking some help with GeoTools. I've been using it for a school's project, I had almost no problem until now. But now that my project is done, I've tried to build an executable jar with the ...
2
votes
0answers
185 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 ...
0
votes
0answers
162 views

Problems with direct connection to ESRI Oracle db for 9.3.1?

I am trying to create a direct connection to ESRI Oracle database for version 9.3.1. When I try to connect I get this error: org.geotools.arcsde.ArcSdeException: Can't create connection to none for ...
7
votes
1answer
6k 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 ...
1
vote
1answer
34 views

Geotools geoTiff running slow

I am using following code to display geotiff file. Its only a small file 1,5MB but when I am moving map I have online white screen which gets loaded after I finish moving but it is a bit slow for me. ...
0
votes
0answers
26 views

How can I modify the records of geotable and non-geotable in app application with hibernate-spatial and geoTools

I want to develop a GIS application with JAVA. I want to use Spring-4.0.1, and Hibernate-4.3.x. The application’s Database have GeoTable and Non-GeoTable. The records of all tables are modified. I can ...
1
vote
1answer
27 views

Geotools loading MBTiles

is there a way to load MBTiles file using GeoTools? I need to work with huge map an so far I have tried PNG + world file which was unusable (slow speed due to large files - 150MB). So I am thinking ...
4
votes
1answer
1k 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 ...
-1
votes
1answer
81 views

Not able to read Multilinestring and multigeometry with geotool from KML file

We are not able to read Multilinestring tag field from geotools. We are able to read multigeometry but its coordinate we are getting empty. any suggestion or code snippet would really help me. I ...