Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 01 2018 17:48
    @jnh5y banned @matrixbot
Jody Garnett
@jodygarnett
There is a school of thought (ie purist) that changes of behaviour should always be an api break
James Hughes
@jnh5y
Martin Davis
@dr-jts
That's great. I'll add it to the QA section.
(the big one that @jodygarnett made to start cleaning up the code)
Not sure why those had to be removed? And changes like that should be noted in the Version History under API changes, I think.
Jody Garnett
@jodygarnett

It is not needed, see CoordinateList extends ArrayList<Coordinate> - so add( Coordinate c ) is already present in the API signature.

I would of kept it if there was a javadoc saying something useful.

Martin Davis
@dr-jts
ok, gotcha. So the report is slightly wrong...
Jody Garnett
@jodygarnett
It is more it has limitations
Martin Davis
@dr-jts
Just landed: Polygon triangulation. locationtech/jts#775
Of particular note is that this includes a fast Constrained Delaunay Triangulation for polygons, which gives much better quality.
Here's an example:
image.png
It's also going to serve as the basis for some other interesting algorithms, such as Skeleton and possibly a vertex-based subdivision.
James Hughes
@jnh5y
As a note, Apache Jena is using JTS for its GeoSPARQL support! (I'm helping co-chair a spatial track for Apache Con @ Home and the speaker just mentioned using JTS!)
Martin Davis
@dr-jts
w00t!
Thanks to the relicensing, I guess?
Jody Garnett
@jodygarnett
That is good, so glad to avoid forking.
@dr-jts sorry I got busy the other week during our chat on package names. Did you get a way forward you agreed with?
Martin Davis
@dr-jts
yes, I put the new code in the old triangulate package. Maybe not ideal, but it will do for now.
TidalPoo
@TidalPoo
hi all!
I have been trying for several days to find instructions on how to make a multipolygon from several polygons.
And then how to determine to which polygon the coordinates in multipolygons belong.
I would be grateful for any help.
Jody Garnett
@jodygarnett
What have you figured out so far? MultiPolygon is created from a collection of polygons …
You can use getGeometryN to retrieve a specific geometry to check
I am not sure exactly what you mean by “belong” ?
TidalPoo
@TidalPoo
Perhaps I wrote the question incorrectly. I have a task. I need to make several polygons with names on the plane. A point will move randomly along these polygons. I need to get the name of the polygon where the point is.
Jody Garnett
@jodygarnett
Okay, that tends to be considered a feature (ie geometry with an attribute - in this case a name).
JTS provides one user data object which you could use to store a name. Or you could use a library that supports features such as GeoTools (which has a feature data type and a uses JTS for the geometry attribute(s) of each feature).
How many polygons are you working with? Hundreds, thousands, millions?
TidalPoo
@TidalPoo
thanks for your reply. Yes, I am considering working with geometry. i don't want to use GeoTools. It should be a very light project. I will have several planes (levels), each with its own set of polygons, no more than 50.
TidalPoo
@TidalPoo
The point will be moved by keyboard control. I need to understand which polygon the point is in now. I worked with jmonkey, but it is too heavy a library to perform such a simple function.
Can you show some example code? Do I need to create geometry, assign a name, and add it to multigeometry?
TidalPoo
@TidalPoo
is this ok, or are there any better ideas?
Martin Davis
@dr-jts
That looks fine. You can also just keep the polygons in a regular Java List. The only reason to keep them in a GeometryCollection would be if you want to perform other geometric operations on them.
James Hughes
@jnh5y
@dr-jts sorry for my confusion on that ZM issue;) I'm calling it a night now:)
Martin Davis
@dr-jts
np... get some sleep!
James Hughes
@jnh5y
indeed! I'm liking the suggestion of a single XYZM Test calling out to the operations
Martin Davis
@dr-jts
cool
Björn Harrtell
@bjornharrtell
I have a case where need to union sets of bboxes. It's done in PostGIS and AFAIK it converts bboxes to polygons and uses plain GEOS general polygon union on them which is expensive when the amount is large. Any ideas if this case could deserve an optimized path in JTS?
Martin Davis
@dr-jts
In general unioning rectangles can produce an arbitrarily complex output, so I'm not sure much optimization is possible. Are you aware of a fast algorithm?
Chris Hodgson
@cmhodgson
If you just want an enclosing bounding box for everything then you could use st_extent(), that will be fast but you'll only get the min of the mins and the max of the maxes, not a jagged-edged mass of unioned boxes
Björn Harrtell
@bjornharrtell
@dr-jts: I see you point and unfortunately not..
@cmhodgson: problem is I need to eliminate overlaps to calculate non overlapping area.
Martin Davis
@dr-jts
@jnh5y @jodygarnett any thoughts on #805 and#806? I'm not keen on introducing another dependency, and this is the only complaint about this change so far, so I"m -1 on this
James Hughes
@jnh5y
@dr-jts Neat! That is not adding a dependency to JTS. It is only adding a dependency to the JTS build.
The approach is to have the build generate backwards compatible bytecode
that's actually kinda cool
Martin Davis
@dr-jts
image.png
Just landed: locationtech/jts#810
James Hughes
@jnh5y
Very nice!