Comments (6)
👍
from jts.
Pull Request welcome! Otherwise will have to wait for time to do this.
from jts.
Curious to know more about your use case. Are you seeing this as as hotspot? If you are doing a lot of distance computation, perhaps IndexedFacetDistance
might be of use?
from jts.
@cmhodgson Is the issue the ArrayList which is allocated by PolygonExtracter even if there are no polygons?
Perhaps a simple dimension check could be made beforehand, and if dimension < 2 this code can be skpped.
from jts.
IndexedFacetDistance is interesting but still uses distanceOp, which then still had the problem that you have now solved.
My use case was finding the closest street segment with a matching name to every address point in the province. There is already an index in place to narrow it down to all the segments with the matching name in the same locality so it isn't really worth the additional memory cost to index those groups spatially. The process only takes 5 mins but minimizing memory use is more important than speeding up the processing as it is a once a month process in production. The overhead of creating and collecting the extra arrays had essentially no effect on the performance time-wise but because of how sensitive Java is to the amount of garbage being collected, having these unused arrays lying around required an extra 1/2 GB of memory to be allocated to keep Java from throwing a "too much garbage collection" exception.
I think I had considered a fix as simple as what you have now done but then got lost in a bunch of other semantic issues that I thought needed "fixing" and forgot about the simple alternative.
from jts.
Good to know this is working for you, Chris.
It seems it's more important to optimize Java memory use than performance (although often the two can be improved together). The recent issue #165 is another example of this.
from jts.
Related Issues (20)
- parseKMLCoordinatesAndAttributes can fail
- BufferInputLineSimplifier doesn't simplify end segments of rings
- CoordinateArraySequence.getCoordinate is hard to understand HOT 1
- AppSweep identifies Medium security vulnerability: HTTP URLs to opengis were found HOT 2
- PolygonTriangulator fails to find a convex corner on provided valid geometry HOT 4
- Trying to use GeoServer and it seems the error comes back to Coordinate.setM HOT 1
- ConstrainedDelaunayTriangulator causes an IllegalStateException: Unable to find a convex corner HOT 3
- Buffer with Flat endcap produces artifacts
- Calculating difference and intersection between two polygons is resulting in a polygon having incorrect shape HOT 1
- Expose GeometryOverlay `isOverlayNG` flag
- Non-closed polygon parsing caused unexpected Exception HOT 1
- Abnormal result with BufferOp.getResultGeometry() method
- Incorrect Voronoi diagram generated for 4 points HOT 1
- Missing dimensions after simplifying with Douglas Peucker
- Problem with Intersection between two polygons HOT 6
- GeoJsonReader does not have support for reading geojson with measures
- Geometry.contains() function incorrect for linestring with same start and end coordinates HOT 1
- Side location conflict on intersects predicate HOT 3
- There seems to be a bug in the equality used to compare geometry objects for consistency
- Dont understand Polygonizer logic HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jts.