an API of 2D spatial predicates and functions that was formerly known simply as JTS

learn more… | top users | synonyms (1)

2
votes
0answers
28 views

How to use Geometry objects (Point and LineString) in Hibernate Spatial

I'm developing an application in java (underlying database is postgresql 9.1) using hibernate 5, hibernate spatial and more technologies. Previously to my knowledge of the JTS classes to represents ...
0
votes
0answers
28 views

Can I use a polygon envelope I get from JavaTopologySuite(.NET port) in an R-tree implementation? (wgs84 to spatial)

I'm using this implementation of https://github.com/enyim/RTree. I use the .NET port of JavaTopologySuite to create some polygons and then get their bounding rectangles. IPolygon p = ...
1
vote
1answer
41 views

JTS polygon intersection calc on a geoid

I am using JTS to compute intersections between polygons with WGS84 lat/lon coordinates. I am not converting coordinates to anything 2D based, just reading in POLYGON(lat lon, lat lon) and doing ...
0
votes
2answers
50 views

JTS Vividsolutions API: compute First (direct) geodetic problem

I'm using the popular JTS Vividsolutions API for Java. I'm struggling to find if I can perform calculation of the First (direct) geodetic problem with the API. Is there a way to calculate this with ...
0
votes
0answers
35 views

Can't read GeometryCollection from Json String with java 8

I've got a problem with geotools and Java 8: since I started working with it, GeometryJSON can't read jts GeometryCollection from a Json String. Here an example: import java.io.ByteArrayInputStream; ...
2
votes
1answer
63 views

Java library to break up a big polygon into many parts

I need to break up large polygons like these into smaller manageable pieces that can be stored in my DB. I tried searching for tools to do this and mostly come across using software such as ArcGIS or ...
1
vote
1answer
113 views

GeoTools JTS: Snap a Point to a polygon (equivalent to PostGis ST_ClosestPoint)

I'm using GeoTools JTS libraries in Java and I want to find the nearest point inside polygon shape to some single target location. This is exactly what in PostGis ST_ClosestPoint does. I found this ...
5
votes
1answer
363 views

Algorithm to find N nearest points to point

My situation is that i'm trying to build a mobile app, and find the x number of points closest to a users location that satisfy certain conditions that the user chooses on the front end. My current ...
2
votes
1answer
107 views

How to query a JTS QuadTree using a query envelope with holes

Hi I have a Java Topology Suite QuadTree containing Points, now I'm trying to query the QuadTree with a polygon that contains a hole. Here's how I create the polygon. //Method will create a ...
2
votes
1answer
76 views

Testing if Geometry is convex using JTS?

I'm using the Java Topology Suite and I'd like to efficiently check if a Geometry (a Polygon in fact) is convex or not. I currently do if (geometry.convexHull().equals(geometry)) but obivously that ...
3
votes
3answers
162 views

Calculate distance with JTS

I'm trying to get the distance between two points with JTS. The problem is that this function with JTS new Coordinate(Lon1,Lat1).distance(new Coordinate(Lon2,Lat2)) Is giving a different result ...
1
vote
0answers
272 views

Query all Object within n kilometer Radius with Hibernate Spatial?

I use hibernate spatial attach a geolocation to a car. My card domain class looks like this: import com.vividsolutions.jts.geom.Point class Card { String name Point location } My program is ...
0
votes
1answer
78 views

Geoserver WPS Request for jts:buffer (or something else) with Multipolygon

I want to create a WPS Request using the JTS:Buffer (or any other process). I'm using the built in WPS Request Builder from GeoServer. My Multipolygon looks like this: 52.52735668,12.71762844 ...
2
votes
1answer
267 views

How to create a JTS geometry with holes and islands?

I have a JTS multipolygon geometry created by an Polygon array: multipolygon = gf.createMultiPolygon(this.polygons.toArray(new Polygon[this.polygons.size()])); Those polygons can describe holes or ...
1
vote
0answers
84 views

How to tell if a line intersects a polygon not only at endpoints?

How do I do this in .net topology suite or jts? Please see image. Any other library that can I run on .NET is fine, or even a general algorithm if there is no option. For example this answer is only ...
7
votes
1answer
205 views

What is the difference between Spatial predicates “Covers” and “Contains”?

I try to understand the Spatial predicates of the DE-9IM Intersection matrix. I don't get the difference between predicates Covers (respective CoveredBy) and Contains (resp. Within). I try to draw ...
2
votes
1answer
296 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 ...
0
votes
1answer
85 views

Run the GUI of JTS 1.12

I've got an error in JSTS (JavaScript Topology Suite) library based on JTS (Java Topology Suite) v1.12 (r405). But there is no error in the last build of JTS on the same test case. So I want to check ...
1
vote
0answers
220 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 ...
1
vote
0answers
85 views

JTS Geometry to GML3.1 encoding

I searched all the internet and I didn't find a solution to my problem. I want to convert a JTS geometry to a GML3.1 geometry. Geo tools says that have support but the have not (please check encode ...
1
vote
1answer
490 views

How to transform data from a custom projection in JTS?

I have some data in NAD_1983_StatePlane_Texas_Central_FIPS_4203_Feet I wish to programmatically transform the coordinates to Lat long in WGS84 datum using JTS. I know that JTS can transform the ...
1
vote
1answer
148 views

How to create arc from points using JTS library?

I have start point , end point , center point, angle, radius of arc. I want to create a arc from these data. I tried to Use JTS library to create arc. but when I checked its source code I am confused ...
1
vote
0answers
183 views

Leaflet CRS.Simple or CRS.EPSG3857 conversion Problem

I'm using v-leaflet (0.61) , a vaadin plugin, to visualize some layers over a map. Clicking on the map, I create a wms query to geoserver. The query needs some parameters and one of them is the bbox. ...
1
vote
1answer
149 views

Cover a polygon with fixed size squares

Can you please advice me of an algorithm (which I can implement in a Java) to cover some polygon (not exact cover) with squares of certain size (aXa squares)? The cover doesn't have to be exact - ...
1
vote
2answers
173 views

Densify a JTS LINESTRING (add points)

I have a LineString I would like to "soften" in a way that if two coordinates (vertices) in the LineString are very far apart, I want to automatically add some coordinates in between. The line ...
1
vote
1answer
136 views

Create a generic shape and draw it as a polygon with center (or base) and rotation?

In Java (jts), is there a way to draw a generic shape, eg. bounded in meters, and apply this to a coordinate, with rotation around a center or base? Something like: double lat = 65.100 double lon = ...
2
votes
1answer
478 views

JTS “points must form a closed linestring”

I'm trying to create a polygon and calculate it's area using final GeometryFactory gf = new GeometryFactory(); final ArrayList<Coordinate> points = new ArrayList<Coordinate>(); ...
2
votes
1answer
641 views

Check if line crosses a polygon

What I'm trying to do is with JSTS to check with lineGeom.crosses(polygonGeom) function if a line is crossing completely a polygon. The problem is that both cases from the picture returns true. I ...
1
vote
0answers
260 views

Converting geometry to geography using org.geotools.geometry.jts.JTS

I'm trying to convert com.vividsolutions.jts.geom.Geometry to geography, using the GeoTools package - org.geotools.geometry.jts.JTS. This is my code: public Geometry getGeography() { Geometry geo ...
1
vote
1answer
84 views

What topologic relation means “interior-disjoint”?

I am using the JTS Topology Suite, and trying to write an expression that means "shape A and shape B are interior disjoint". I read this documentation page but I don't entirely understand the ...
1
vote
1answer
197 views

How to check for overlapping check with tolerance using JTS / GeoTools

I have several hundered polygons which may overlap but need to be considered 'not overlapping' when the overlapping is less than 1 meter. The overlapping check in JTS does not offer a tolerance ...
4
votes
3answers
3k 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!
0
votes
1answer
356 views

Is it possible to use JTS for calculations on data in geographic coordinates?

I have some spatial data that has all of its coordinates as lat/lon pairs (with about 10 digits decimal precision), it's stored in a database as WGS84 data. Some of the data is represented as polygons ...
1
vote
0answers
219 views

Hibernate Spatial - Query within an X kilometer radius?

I am new to Hibernate Spatial, and am trying to perform a simple query of objects within a given radius. I've created a number of entries in my database with properties corresponding to a latitude ...
4
votes
2answers
2k views

How to get JSON representation from JTS Geometry?

I'm using JTS (http://www.vividsolutions.com/jts/JTSHome.htm) and need to get a JSON representation of a Point : Hibernate beam: @Type(type = "org.hibernate.spatial.GeometryType") ...
3
votes
1answer
5k views

How to calculate centroid of a polygon defined by a list of longitude/latitude points? [duplicate]

I've imported some polygons (ways) from OpenStreetMap and now want to calculate the centroids of them. For this purpose I wrote following code: final List<Point2D.Double> points = ...
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
2answers
462 views

How to work with the STRtree Index when object in the index change it's position?

I'm work with the NTS(NetTopologySuite), I get large amounts of Point geometries, for fast querying the point object, I make the STRtree Index like this, STRtree tree = new STRtree(); foreach (var p ...
1
vote
1answer
586 views

JTS Polygon simplification without holes

I have a set of polygons without holes. I wish to merge any intersecting polygons. I don't want to have any holes in my simplified polygons. Is there a recommended way to achieve this using JTS? The ...
2
votes
1answer
2k 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
0answers
89 views

JTS difference op followed by an intersection op not returning expected results

I have two overlapping polygons and I want to get the line segment(s) where the edges cross. So I begin by performing a Difference operation. That gives me the area where A is "outside" of B. ...
2
votes
1answer
62 views

Where is the official website of the JTS project?

I'm using the JTS API, published at http://www.vividsolutions.com/jts/JTSHome.htm However, there is another JTS API, published at http://sourceforge.net/projects/jts-topo-suite/ The former is version ...
3
votes
1answer
578 views

JTS - Java Topology Suite - Calculate radius from a given point

From point A, I want to check if a point B is within a certain radius from A. How calculate it usindo JTS? I tried this: Coordinate posicaoAtual = new Coordinate(-12.974900375893823, ...
0
votes
1answer
488 views

geotools / jts crs transformation result not at correct position

I copied the example from geotools, which shows how to transform a shapefile into a different projection. (http://docs.geotools.org/latest/userguide/tutorial/geometry/geometrycrs.html) But when ...
1
vote
1answer
1k views

Intersection with JTS Geometry

I want to calculate an intersection between two geometries with the intersection function from JTS Geometry. What happens, if the geometries have different SRIDs? SimpleFeature sf1=...; //SRID ...
3
votes
1answer
196 views

How can i topologically sort 2D triangles and put in an array?

I have a set of 2D triangles in a Geometry array which together forms a connected strip when placed them according to edge adjacency. However, in the array they are not in topological order based on ...
3
votes
0answers
809 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
1answer
283 views

Is there an alternative for JTS TestBuilder on Linux?

JTS Testbuilder, an application for testing JTS functions, is available on Windows and I use it quite regularly. Are there anything like this on Linux? Does GEOS have anything similar to this on ...
3
votes
1answer
277 views

How can I get KML into JTS TestBuilder?

JTS Topology Suite TestBuilder supports WKT, WKB and GML inputs. What's a quick and easy way to get the geometry for a KML feature into one of these formats for input into JTS TestBuilder? For ...
5
votes
3answers
554 views

Trying to combine nearby points into a polygon

We have collected millions of cell phone strength readings. I am trying to group points of the same strenght that are within a distance of each other in to a polygon. I asked on the postgis mailing ...