The JTS Topology Suite is an open source API of 2D spatial predicates and functions written in Java.
Questions tagged [jts]
200 questions
36
votes
1 answer
Is there a way to convert a self intersecting polygon to a multipolygon in JTS?
Take the invalid polygon POLYGON((0 100, 100 100, 0 0, 100 0, 0 100)) - an egg timer shape with an undeclared point of intersection
Many instructions say that JTS can create a valid version of this using the buffer method:
Geometry input = new…

tofarr
- 7,682
- 5
- 22
- 30
29
votes
1 answer
How to find curve corner points using JTS or NTS?
I have a curve (say JTS edge):
How to find all curve direction change points that surpasses given angle using JTS (Java) or NTS (C#):

DuckQueen
- 772
- 10
- 62
- 134
23
votes
2 answers
Calculate if an object is inside a set of coordinates?
I have a set of X and Y points that builds a shape and I need to know if an object is inside it or not what is the calculation to it ?
X and Y coords example:
522.56055 2389.885
544.96 2386.3406
554.18616 2369.2385
535.21814 2351.396
497.5552…

Prix
- 19,417
- 15
- 73
- 132
19
votes
7 answers
PostGIS Geometry saving: "Invalid endian flag value encountered."
I have a Spring Roo + Hibernate project which takes a JTS well-known text (WKT) String input from the client application, converts it into a JTS Geometry object, and then attempts to write it to the PostGIS database. I had some problems with the…

orlade
- 2,060
- 4
- 24
- 35
18
votes
2 answers
How to create a polygon in JTS when we have list of coordinate?
We can create a LineString using coordinates list like this:
Geometry g1 = new GeometryFactory().createLineString(coordinates);
How can we create a polygon using coordinates list?
Thanks in advance.

Piscean
- 3,069
- 12
- 47
- 96
16
votes
2 answers
Geometry from vividsolutions JTS fails when creating JSON
pals. I'm using vividsolutions's library JTS (1.13) for Points and Polygons in my application, but when I try to convert geometry objects into JSON, my application fails. There is my source:
@RequestMapping(value = "/test_point", method =…

finnetrolle
- 305
- 2
- 14
12
votes
3 answers
Is there an envelope class in shapely?
I found the envelope class in Java's JTS library very handy. An envelope holds the minimal and maximal coordinates of a geometry and is also called bounding box sometimes.
I wanted to get the common envelope of a number of shapely points. In JTS you…

linqu
- 11,320
- 8
- 55
- 67
9
votes
3 answers
Minimal Bounding Rectangle with JTS
I've got a collection of geometry objects. Now i want to calculate the minimal bounding rectangle from the whole collection.
i'm using the java topology suite, but I can't figure out how to do this?

ABLX
- 716
- 2
- 7
- 18
9
votes
1 answer
AttributeConverter being ignored for com.vividsolutions.jts.geom.Point
i want to be able to read column of type "POINT" from MySql database,
i wanted to write an AttributeConverter for that, so i started by printing the values from the DB, but my AttributeConverter is never called, so nothing is printed to the…

shay te
- 1,028
- 3
- 12
- 23
8
votes
1 answer
Using JTS, how to find the nearest point on a polygon's boundary from an outside point?
Using JTS, how to find the nearest point on a polygon's boundary from an outside point?

user521044
- 91
- 1
- 3
6
votes
3 answers
Point in Circle with JTS
I have a huge set of points already loaded within a plane I need to draw a circle/ellipse starting from a given point and a radius distance in meters then check which points are inside the circle.
I've already done this with a polygon with the…

user1132984
- 61
- 1
- 4
6
votes
3 answers
Geotools: bounding box for a buffer in wgs84
I am need a Java function that will generate a bounding box (rectangle) around a buffer. The buffer is defined by the center point (WGS84 coordinate) and the radius (in meters).
Getting a bounding box for a buffer in JTS seems to be quite simple:…

daphshez
- 9,272
- 11
- 47
- 65
6
votes
1 answer
Why is NoClassDefFoundError thrown with "run" but works fine with "dist"?
Before I asked the question I had read the question Play framework java.lang.NoClassDefFoundError only in dev mode and several other posts. They didn't help me to resolve my problem.
I've created a project using Typesafe Activator 1.2.12 and…

worldterminator
- 2,968
- 6
- 33
- 52
6
votes
2 answers
How to triangulate/tesselate some shape in Java?
I want to tessellate country shape from GeoTools to display it in 3D on Earth surface. GeoTools use JTS topology suite inside which looks feature rich.
Does it contain utility to tessellate some shape? I see there is triangulation package, but…

Suzan Cioc
- 29,281
- 63
- 213
- 385
5
votes
2 answers
Convert java.lang.String geometry to jts Geometry
I have a geometry in java.lang.String format. I mean i take it directly from DB in as a java.lang.String which is stored in a variable. I want to convert it to jts Geometry type somehow. Is there any way to do it or what i'm trying to do is just a…

user1120946
- 171
- 1
- 2
- 13