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

learn more… | top users | synonyms (1)

0
votes
1answer
22 views

Draw Map using JTS API And PostgreSQL database

I use PostgreSQL for storing data. I want to create map based on it using JTS. I want to create geometry object from list of rows. Such geometry object to used as draw polygon,point etc.
0
votes
1answer
41 views

Read WKT geometry using JTS 1.13 in java

I want to create a shape file from coordinates, in the client side I take the coordinates of a polygon by opelayers, it send to a java class, in this class read the geometry of the polygon, when the ...
0
votes
0answers
21 views

How to calculate tolerance for TopologyPreservingSimplifier in JTS?

I am trying to simplify some areal geometries (POLYGON\MULTIPOLYGON) using JTS's TopologyPreservingSimplifier.simplify(Geometry geom, double distanceTolerance) From the JavaDoc: void ...
-2
votes
1answer
31 views

how to create geometry object from data comes from database

i have lots of data From database "MULTILINESTRING((5.5811647 50.6399323,5.5808065 50.6400428,5.5806085 50.640104))" "MULTILINESTRING((5.580576 50.6400012,5.5806085 50.640104,5.5806317 ...
1
vote
1answer
36 views

JTS: split arbitrary polygon by a line

I just discovered JTS through this stack exchange. I'm looking for a Java solution to cut an abitrary polygon into two by a line. I've implemented one that does fine on convex polygons, but it messes ...
1
vote
1answer
32 views

Unable to get the feature collection data while exporting as kml file

I am trying to get the kml file by giving simple polygon data but not able get exact kml Please suggest me if iam wrong. code snippet: GeometryFactory geometryFactory = ...
0
votes
0answers
50 views

Read 3D polygon from Oracle SDO_GEOMETRY and convert to triangles

History I have written a c# service that consumes a list of x,y,z points from a csv file. These points form a valid 3D polygon which I am able to verify using ...
1
vote
1answer
46 views

How do I create a target geometry to use with JTS GeometrySnapper?

I am dealing with geospatial queries on a database. The query returns all data sets within an arbitrary bounding box, given a point associated with the data set is within this bounding box. Since the ...
0
votes
0answers
28 views

Using JTS to rotate a Polygon doesn't seem to be working

I am using JTS to create a Polygon - the Polygon creates properly (with the right dimensions and in the right place), but rotation seems to stretch the shape and not rotate properly. I have a video ...
2
votes
0answers
183 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
46 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
63 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
89 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
61 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
218 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 ...
2
votes
1answer
247 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
602 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
199 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
106 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
322 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
1answer
464 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
122 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
466 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
101 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
313 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 ...
3
votes
1answer
525 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
100 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
293 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
114 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
696 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 ...
2
votes
1answer
259 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
228 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
188 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
240 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
157 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
630 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
759 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
301 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
94 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
229 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
399 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
229 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
6k 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
559 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
670 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
95 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. ...