Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [jts-topology-suite]

JTS Topology Suite is an open source Java software library that provides an object model for geometries and functions to work with them.

0
votes
0answers
9 views

Flatten folded line JTS

In my data I have many occurrences of 2 lines that follow the same path, but in opposing directions. Applying LineMerger to this data results in the lines being joined together, but not merged into ...
4
votes
2answers
42 views

OSM Line 'way' from PostgreSQL (PostGIS) to Java Linestring (from JTS library)

I would like to read the data from PostGIS OSM database to Java object. I have 'planet_osm_line' table. I'd like to get 'osm_id' and 'way' column read by ResultSet, as here: stmt = con....
3
votes
1answer
64 views

Geotools JTS, find most distant points in polyline or polygon?

is there any convenient API in JTS that would help to find two most distant points in line find two most distant points in polygon
0
votes
0answers
23 views

How to fix: JTS TopologyException: Found null DirectedEdge

How can I fix a: TopologyException: Found null DirectedEdge? Initially (sadly), the geometry is invalid. But then when applying a geom.buffer(0) st_valid(my_geom) returns true. Still there are ...
2
votes
1answer
192 views

Convert list of Java objects with JTS geom to GeoJson

I have a list of Java POJOs that all have a JTS geometry associated with them (Point) - a list of POIs, basically. I want to output them as GeoJson (FeatureCollection, Feature etc.) jackson-...
0
votes
1answer
22 views

JTS ConformingDelaunayTriangulationBuilder, what is the right way to set tolerance?

I have one 3D polygon and one 2D polygon. I know that 2D polygon is inside 3D polygon (when projected on the plane) and I want to find Z-coordinate for 2D polygon points. The idea is to apply ...
1
vote
1answer
48 views

Get area and perimeter of 3D plane using JTS library

is there any Java API in Geotools JTS lib for calculating area of 3D plane? Same about Line, where points have three dimensions.
1
vote
0answers
25 views

Automatic slice of polygon

I have a data source, that sometimes returns geometries which are not properly cleaned e.g. the pink polygon is only 0.02 cm wide and is always on the edge of the whole geometry which consists of the ...
2
votes
1answer
44 views

Get z value for a point of polygon using JTS library?

I have a polygon described with coordinates which have z value. Is there any JTS utility that would allow me to get Z value for a coordinate which is inside the polygon? I have a function for doing ...
1
vote
1answer
37 views

geotools vector grids example

I've been going through the GeoTools tutorials and have read the Vector Grids page http://docs.geotools.org/latest/userguide/extension/grid.html I am trying to replicate the maps shown on this page ...
1
vote
0answers
46 views

Algorithm or library for buffer zone for lat-lon (wgs) coordinates in global scale

Can anyone point to generic algorithm or library for buffer zones if the source data is in WGS84 degrees? The buffer width should be in meters, as buffer in degrees it generally does not make much ...
1
vote
1answer
64 views

JTS: generate a polygon geometry from line geomtry

I have a line and I wish to convert it to a polygon. The point is this line is NOT a ring it's an straight Line. And I want to use an specific width to extend line horizontally and create a polygon. ...
0
votes
0answers
28 views

GeoTools: grid transformation using NTv2Transform - error locating grid file

I'm trying to use GeoTools library to calculate the grid coverage based on NTv2 .gsb file. However, I'm unable to create the instance of NTv2Transform. When I use this piece of code: File gridFile =...
1
vote
0answers
115 views

NearestNeighbour with NetTopologySuite with wgs84

I've got a list of polygons in wgs84 WKB, I read them into NetTopologySuite Igeometries put them into an STRtree and then use the NearestNeighbour function to get the closest polygon to a point (also ...
1
vote
1answer
35 views

What is IndexedFacetDistance in JTS?

I just read from GEOS 3.7 documentation that there is a new IndexedFacetDistance imported from JTS. Reading from the JTS link, I cannot tell what the new distance metric does except that it's taking ...
1
vote
1answer
108 views

How to increase length of linestring using Jts functions

lf l get a line string having a legth lesser than expected then l need to project or extend that line further in such a way that it meets minimum length requirement. For e.g. l have 2 coordinates A(...
3
votes
1answer
161 views

Creating buffers using JSTS + ES6 modules not working

Creating a buffer from a Point or other Geometry objects in JSTS seems to be quite simple when reading the documentation, but still I can't produce a buffer from a Point in my React application. Let ...
1
vote
0answers
306 views

Using GeometricShapeFactory to create circle with radius in miles

I'm new in PostgreSQL/PostGIS and I have a problem and don't know how to solve it. I'm using GeometricShapeFactory.createCircle() method in Java to get Polygon from central point (lat/long) and radius,...
1
vote
1answer
520 views

Create a collection of geometries in JTS

I'd like to create a program that a user inputs coordinates as points or lines and gets a geojson file. The problem is I don't know how to store all the geometries in one file. For example I want to ...
1
vote
1answer
118 views

Extract geometries from bounding box (within and overlapping) and copy results to new empty database

I am new to PostgreSQL and GIS. I do have a downloaded dump of OSM data (map of Germany) available, which was imported via osm2pgsql into a PostGIS-enabled PostgreSQL database germanyPG. The query ...
1
vote
0answers
101 views

Intersection throws com.vividsolutions.jts.geom.TopologyException: Found null DirectedEdge

When I make union of 379202 List<Polygon> rectangles rectangles and execute intersection with bounds UnaryUnionOp.union(rectangles).intersection(bounds) then I get: com.vividsolutions.jts.geom....
3
votes
2answers
143 views

Using JSTS isValid() with ES6 modules

I am trying to configure JSTS to load using ES6 modules so that I don't have to include the entire library. There are minimal examples of how to do this online, including using an extend function to ...
4
votes
1answer
685 views

Combining neighbor polygons (NOT touching) making one using JTS/GeoTools?

This question is similar to: Combining touching polygons, keeping all attributes from Class "A" feature, using ArcGIS Desktop? and Combining adjacent polygons sharing similar trait into ...
2
votes
3answers
984 views

JTS GeometricShapeFactory generate an ellipse properly

This is what use to get a circle: GeometricShapeFactory shape = new GeometricShapeFactory(gf); shape.setCentre(new Coordinate(40.748754,-73.985460));//Empire Sate Building shape....
2
votes
1answer
458 views

Remove intersect/touch from polygons, to making one with JTS/GeoTools

Is there a way to remove an overlap from multiple polygons to make one final polygon?..programmatically, I am using the GeoTools or/and OpenGIS/JTS.. any ideas to put me on the right path... example ...
1
vote
1answer
334 views

Adding Geometry to a mapbox vector tile using java library

I'm attempting to make a mapbox vector tile to be used in leafletjs. I have a couple of layers I need to do with this, but I started with a point layer since I thought it would be easier. I am using ...
2
votes
1answer
809 views

How to determine if one polygon is contained in another?

Using the Net Topology Suite, what is the easiest way to determine if one polygon is entirely contained in another? Given two independent polygons, A and B, they may overlap, or they may not. If they ...
2
votes
2answers
116 views

DistanceOp.nearestPoints wrong result? [closed]

in order to compute distance in WGS84 geometries, I first call DistanceOp.nearestPoints(g1, g2) from JTS 1.13 to compute the nearest points of this geometries, where: g1 = LINESTRING (14.796 47.9467, ...
4
votes
3answers
309 views

Do I need JTS Topology Suite if I use PostGIS?

They seem to overlap in functionality, so if I only use PostGIS and Postgres SQL, do I miss anything important from JTS Topology Suite?
2
votes
1answer
292 views

Group intersecting/overlapping com.vividsolutions.jts.geom.Polygon

I have list of geometry type in a database or: List<com.vividsolutions.jts.geom.Polygon> polygons Is there any JTS Topology Suite method or PostGIS function which would output intersecting ...
1
vote
1answer
340 views

Fixing orientation in Net Topology Suite

I have a MultiPolygon that was created by reading from a GeoJSON string. string geoJson = getGeoJson(); var rdr = new GeoJsonReader(); var multiPolygon = rdr.Read<MultiPolygon>(geoJson); My ...
2
votes
1answer
502 views

Transform for geometry in JTS

I am using JTS in my application, and I want to transform the geometry from longitude and latitude to pixel. And the algorithm for this translation has been providered by an interface: public double[...
3
votes
1answer
669 views

Difference in JTS from Vivid Solution and locationtech

I need to create convex hull from set of points so I searched for JTS. I found two libraries one from package com.vividsolutions.jts.geom and another from package org.locationtech.jts.geom Can ...
1
vote
1answer
121 views

Geomesa accumulo storing null Point for geometry

I am using Point geometry type in geomesa for strong lat-long details in feature type. In one of the use case while storing a new feature I don't have value for lat-long so I tried sending null object ...
4
votes
1answer
980 views

GeoTools: Calculate length along line from start vertex up to some point on the line?

I have single LineString and some Point (outside the line), I snapped it to the Line (using DistanceOp so as far as I understood the snapped point should lay on the line). How can I calculate length ...
1
vote
0answers
300 views

Using Google Maps, layers of polygons and calculate its intersections [closed]

I am developing a web application that uses Google Maps and it has polygons (circles and irregular polygons) drawed inside this map. This polygons are stored into a DataBase (MySQL 5.7) as Polygons ...
2
votes
0answers
130 views

Operations using JTS with CRS as WGS84 or similar geographic coordinate reference systems

I need to carry out the operations of the JTS, that is a API for processing geometry on the 2D dimensional plan. Operations as Intersection, Union, Buffer, Boundary... And the parameters of this ...
3
votes
1answer
637 views

How to offset a polyline in Openlayers 3?

I retrieve ways from OSM with Overpass API and display them in an Openlayers3 vector layer. In the case of a highway with a cycleway along it (e.g. cycleway:right=track) I want to draw a green line ...
2
votes
0answers
652 views

Creating inner ring of polygon using buffered geometry in JTS? [closed]

I am still a beginner to GIS. I have a polygon and I want to draw a large border inside the that polygon (see fig A and B below). With the library I am using, I have to do this with a polygon with "...
1
vote
1answer
629 views

JTS Intersection

I am testing the intersection method of JTS / GeoTools I intersected 2 lines. Then I test if the intersection point intersects with one of the lines. The result should be true. But it is false if I ...
3
votes
1answer
3k views

How to combine LineStrings using JTS

I want to combine LineStrings with common points. The scenario looks like this: I tried it using the GeometryCollection.union() method like suggested here: http://docs.geotools.org/latest/userguide/...
0
votes
1answer
329 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
625 views

Read WKT geometry using JTS 1.13 in Java

I want to create a shapefile from coordinates, in the client side I take the coordinates of a polygon by OpenLayers, it sends it to a Java class, in this class I read the geometry of the polygon, but ...
1
vote
0answers
550 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
143 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 50.6401971,5....
1
vote
1answer
1k 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
194 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 = JTSFactoryFinder....
2
votes
1answer
605 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 ...
2
votes
0answers
947 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 ...
1
vote
1answer
350 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 ...