Tag Info

Hot answers tagged

4

The official website of the JTS Topology Suite API is http://tsusiatsoftware.net/jts/main.html This points to the SourceForge page as the official download site and source repository.


4

I would not use a conventional point->polygon process because that expects your points to define the boundary of a polygon and it doesn't sound like yours do. It sounds like yours are hotspots that are somehow related. However, there are lots of ways to create polygons for this sort of situation depending on what is sensitive in your data. Here's a few ...


2

I have been using NetTopologySuite(a C# port of JTS) for a while. So I assume that most things stay the same as that of JTS. Hopefully Java code could be similar to the c# ones :) My attempts answering some questions.. what is the canonical way to convert a String to a Point? A direct casting from IGeometry to IPoint has worked as the below code ...


2

I would perform both a left and right single-sided offset buffer on one of the linestrings and test if the other linestring crosses both sides of the offset buffer. You would need to use a suitable small buffer distance for your analysis. For example, using Shapely: from shapely.wkt import loads def actually_crosses(A, B, precis=0.0001): """A hybrid ...


2

Always be aware of the axis order. PostGIS always uses the axis order: longitude (x), latitude (y). -- Somewhere in Chicago, USA SELECT ST_AsText(ST_Transform(ST_SetSRID(ST_Point(-87.642970, 41.937832), 4326), 3857)); -- POINT(-9756370.79201015 5151671.52336743) -- Somewhere in Antarctica SELECT ST_AsText(ST_Transform(ST_SetSRID(ST_Point(41.937832, ...


2

Use the ogr2ogr utility to convert your KML to GML. See some samples on how to use the utility here. ogr2ogr -f GML output.gml input.kml should do the trick.


1

Probably the easiest way to think about this in terms of a union of the "is disjoint" and "touches only on the borders" cases. Those relationships are (imaginatively) known as "disjoint" and "touches". Here is an example in SpatiaLite: spatialite> SELECT ST_Touches(GeomFromText("POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))"), GeomFromText("POLYGON((0 1, 0 2, 1 ...


1

From @Mike Toews tip: @Entity @Table(name="cities") public class City { @Type(type = "org.hibernate.spatial.GeometryType") @Column(name="the_geom") private Point theGeom; public String asJson() { GeometryJSON g = new GeometryJSON(); return g.toString(theGeom) ; } } You will need at least gt-api-10.0.jar ...


1

As far as I know JTS does nothing with the SRID value (see this email). You will need to use GeoTools to reproject your features to a common projection and then call intersection on them. The result will then be in the common projection and you can then project back to one or both of the input projections.


1

To do this you need to perform a topological sort, where the triangles are the nodes of the graph and the edge-adjacency provides the graph edges. Since you know the graph is a single line, the sort actually devolves into finding a node with only one other adjacent triangle, and then traversing the graph visiting all the other triangles in turn.


1

I think it depends. ESRI's geometric library is similar to JTS, but you need to think about readability and maintenance. Why do you need to check your geometries type everytime you pass them around? That is unnecessary and riddles your code with if clauses that do nothing. Java is statically typed, so, go ahead and use your types. If you have a method ...



Only top voted, non community-wiki answers of a minimum length are eligible