2,543 questions
0
votes
1
answer
98
views
Compute Jaccard Index for two similar but not equal shapefiles in R [closed]
I have two distinct shapefiles that have a high degree of overlap, but aren't the same. I want to make a comparison and one of the things I would like to generate is the Jaccard Index of regions ...
1
vote
1
answer
110
views
Ray Shooting CGAL
The first_intersection() function of CGAL returns the origin of the ray every time instead of the real first intersection (with the origin point ignored, as it should be).
I am working with an AAABB ...
2
votes
0
answers
67
views
Spurious matplotlib contour paths resulting in unwanted intersections between two contours
Summary of Code: The code takes a 2D array, takes the (x,y) gradients of the 2D array with numpy, gets the contours of the x- y-gradients with matplotlib.pyplot, and finds the intersections between ...
0
votes
1
answer
26
views
Is there a HQL condition where one object of a set is in a many-to-many relationship in 2025?
I have a Task with a @ManyToMany referenced roles, which specify roles a user must have at least one of, to perform the task. The HQL search should therefore find all tasks that have at least one of ...
2
votes
1
answer
86
views
Intersection of two data sets, one linear and one not
I need to find the intersection of a straight line and a stress-strain curve to determine the offset yield strength.
I've been trying to use the following code, which successfully prints the curve ...
2
votes
1
answer
106
views
How can I convert a turf "intersect" polygon to a Leaflet polygon?
In general, a turf polygon can be converted to Leaflet as per https://gis.stackexchange.com/questions/448435/converting-turf-polygon-to-leaflet-polygon .
But there seems to be a difficulty when the ...
0
votes
2
answers
215
views
Python libraries for mesh intersection with elements, in 2D and 3D
I have done quite a lot of looking around now, and I am wondering if anyone knows more about the functionalities of the libraries I have looked into, or whether I missed some things. I am trying to do ...
6
votes
4
answers
419
views
How to efficiently check if two line segments intersect?
I've referenced this answer (has an interactive desmos visualization) in a related question to develop this Javascript function:
function doLineSegmentsIntersect(a1X, a1Y, a2X, a2Y, b1X, b1Y, b2X, b2Y)...
0
votes
1
answer
75
views
How to identify intersections of hollow geometries while ignoring others?
I'm working with spatial data in R using the sf package, and I need to identify geometries that are completely within a larger geometry (not just intersecting or touching boundaries).
In other words, ...
0
votes
1
answer
114
views
st_intersection only returning part of an intersecting geometry (line)
Potentially unnecessary background:
I am attempting to calculate the sinuosity of road within a 500m buffer of a point on that road.
Workflow is:
Buffer the point 500m
Use that buffer to clip the ...
2
votes
1
answer
210
views
Problems obtaining an intersected linestring using GeoPandas
I am having an issue obtaining a linestring from an intersection with a polygon using GeoPandas. The linestring is self-intersecting, which is what is causing my issues.
A line intersecting a polygon:
...
0
votes
0
answers
78
views
sf intersection with osmdata failing
I'm trying to extract data from osm to use in an anlysis, but I'm having trouble with sf::st_intersection. Reprex below,
# load libraries
library(osmdata)
# osmdata
co = opq_osm_id(type = "...
2
votes
0
answers
45
views
R - st_intersection gives no intersections between line layer and random point layer that was CREATED from the line layer [duplicate]
I am trying to figure out why a random point layer that I have created based upon a line layer has NO intersections with that line layer... Below is reproducible code that shows the problem.
library(...
0
votes
1
answer
112
views
Intersection of Two Ellipses with a Common Focus, Lua
I am currently working on a project in Lua that involves calculating the intersection points of two ellipses that share a common focus O.
The parameters for the ellipses include the coordinates of ...
0
votes
3
answers
243
views
Is there a way for st_intersection to return a value of 0 instead of cutting non intersecting features?
I have a 1km buffer shapefile and a roads shapefile and I'm trying to figure out the total length of roads that intersect with each buffer so I can calculate road density within each buffer. There are ...
0
votes
1
answer
75
views
How to handle repeated events in a time range intersection calculation in Pandas?
I am working on a Python script using Pandas to analyze event data. My goal is to calculate the intersection of active events.
My code works fine if the same event doesn't happen twice. However, if it ...
0
votes
0
answers
154
views
Is there a more efficient Ray intersection algorithm for rounded Boxes?
I'm currently trying to figure out a rendering approach for implicit geometry which involves a ray intersection algorithm for oriented rounded box primitives. It's just a small toy project and I'm not ...
0
votes
0
answers
103
views
weird svg.getIntersectionList issues
I have that start of a simple handmade diagram app (boxes and arrows) in SVG. I want to detect overlapping boxes with svgelement.getIntersectionList() - MDN
I am getting a weird result - the ...
-1
votes
2
answers
148
views
MongoDB v.3.2.11: Intersection of the range of multiple row values with object fields
This post is a continuation of the previous posts:
Intersection of the range of values
MongoDB - Intersection of the range of multiple row values
MongoDB: Intersection of the range of multiple row ...
0
votes
2
answers
160
views
MongoDB - Intersection of the range of multiple row values
Suppose we have a mongodb collection with 6 columns:
RoomFrom
RoomTo
PoolFrom
PoolTo
FloorFrom
FloorTo
Now I would like to select rows where range *From / *To intersect with another ranges.
For ...
-1
votes
1
answer
68
views
Intersection of the range of values
Suppose we have a mongodb collection with 2 columns: From, To. Now I would like to select rows where range From / To intersect with another range.
For example:
Object #1: From = 100, To = 200
Object #...
0
votes
0
answers
80
views
How to iterate across columns to find intersection in R? [duplicate]
I have a data.frame in R which has more or less this structure:
structure(list(F1 = c(1, 2, 3, NA, NA), F2 = c(NA, 2, 3, 4, NA
), F3 = c(NA, NA, NA, 4, 5)), class = "data.frame", row.names = ...
1
vote
2
answers
67
views
Intersection of Record with generic key extending template literal doesn't infer result of index access
In principle (T & Record<K, U>)[K] should evaluate to U but it doesn't seem to work in the case where K is generic and extends a template literal.
function foo3<
K extends `a${string}`...
0
votes
0
answers
140
views
Computing intersection of multiple cones with Python
I am trying to perform the intersection of 3 cones with python.
In particular, I'm using PyVista to generate the cones in the 3D space and then I use the boolean_intersection function to get the ...
0
votes
1
answer
163
views
Calculating spatial intersection for multipe large polygon datasets
I have a set of vector layers in R, and I want to keep only those polygons in each layer that intersect across all layers. In other words, a polygon should only be kept if it intersects with a polygon ...
2
votes
0
answers
68
views
How do you find how much a simple concave polygon can be deflated/offset before it self intersects?
For reference, I've implemented this algorithm for inflating/deflating polygons: https://www.baeldung.com/cs/polygons-inflating-deflating
However, for joining edges, instead of using rounded corners, ...
1
vote
1
answer
90
views
ThreeJS: Adding DecalGeometry inside to grouped object
There is a small sketch based of original ThreeJS DecalGeometry example and it works fine. Basically, it has to add logo to the tank center by X axis perpendicular [{0, 0, 0}, {tankRadius, 0, 0}] and ...
0
votes
1
answer
306
views
How to calculate intersection point between lines and ellipses using only math equation [closed]
I want to calculate the intersection points between an ellipse and a line using python.
However how do I do it using only mathematical quadratic equation, when given both end points of the line and ...
0
votes
2
answers
115
views
Fast intersection of two N^4 sets
I'm looking for an algorithm that returns (the length of) the intersection of two given N^4 lists / sets (more precisely in [|0;7|]^4). I'm not expecting an answer in a specific programming language (...
0
votes
2
answers
417
views
Cut up overlapping polygons in a gdb using terra or sf
I have a massive gdb of lots of polygons, many of them overlapping (sometimes partial overlaps and sometimes full overlaps). The polygons represent landscape treatments with different attributes I'd ...
0
votes
1
answer
87
views
How do I find the line segments formed by the meeting of two sides of two polygons?
I need a function that, given two or more polygons, can divide the sides into the intersections of the sides as in the figure, how would I do it?
An example would be the meeting of two sides
[(0.0, 0....
0
votes
0
answers
52
views
How much exact are the operations in CGAL function "halfspace intersection with constructions"
I want to compare my own algorithm with CGAL's halfspace intersection algorithm in terms of their speed performance. Since I did my own operations with double, I obtain inexact constructions of points ...
2
votes
1
answer
787
views
Custom equality comparator for set operation in Kotlin
As mentioned here: Efficient way to compare an partition two collections in Kotlin I am working on a Kotlin application that needs to compare lists of Json objects. To find the elements that are ...
2
votes
0
answers
170
views
Find the Largest Area of Square Inside Two Rectangles(Intersection)
There exist n rectangles in a 2D plane. We have 2D integer arrays bottomLeft and topRight, both of size n x 2, representing the bottom-left and top-right coordinates of the ith rectangle respectively. ...
1
vote
1
answer
357
views
Shapely can't find intersection points that definitely exist
In my code I have two lines (line1, line2) that definitely visually intersect one another. They are simply stock lines with data scraped from yfinance, but when running line1.intersect(line2), it ...
0
votes
1
answer
84
views
create intersection points between lists of functions
I am trying to find the intersection points between two lists of funtions in geogebra.
Let's say I have the folowing two lists of functions:
offset = {1,2}
l1 = x + offset
l2 = -x - offset
Now I want ...
2
votes
1
answer
81
views
Lookahead assertion can work like a type of intersection of regular expressions, but why? (JavaScript)
according to this post in stack overflow, lookahead assertion can work like a type of intersection of regular expressions, but I really have no idea why it works.
can someone explain to me?
Look at ...
2
votes
2
answers
66
views
How to merge two columns by the intersection of the elements in each col?
Imagine I have a dataframe like this:
With lists of elements in a single string.
data = {'Col1': ["apple, banana, orange", "dog, cat", "python, java, c++"],
'Col2'...
0
votes
0
answers
97
views
Check intersection and draggable svg path (svgdotjs and kld-intersections)
enter code hereI have a problem. I'm trying to write code. The goal is that if two svg shapes possibly intersect, they cannot intersect. But my code works out so that if the shapes intersect, they get ...
0
votes
0
answers
98
views
How to use TypeScript infer on a intersection type?
I need to turn nested generic types into a array of arrays based on how deeply nested it was.
Context
I'm building a query builder for linked data. The dev using this can use regular objects with get/...
0
votes
1
answer
103
views
JSXGraph: intersections and otherintersection between line and general conic section?
Short version: If E is a general conic section, and L is a line through it, I want something like:
P = board.create('intersection',[L,E,0]);
Q = board.create('otherintersection',[L,E,P]);
except ...
0
votes
2
answers
163
views
The function cannot detect intersections of two curves
The below source code is supposed to find an intersection between two curves.
However, the function is unable to detect the intersection point.
How can I fix it?
using MathNet.Numerics.Interpolation;
...
0
votes
0
answers
120
views
Is there a function in SQL to determine the area of of a rectangle that is not being impacted by other intersecting rectangles?
I am trying to determine the space for each of the rectangles (red, blue, orange, etc) where there is no other rectangles intersecting. The points of each rectangle is known. The number of rectangles ...
0
votes
2
answers
63
views
Problem with collisions (intersections) in java game development using JFrame
I am making a 2d java game, where player needs to shoot tiles.
I encountered a bug in my code, the bullet destroys nearby tiles, but not always and not properly.
PROBLEM VIDEO RECORD
You see, I want ...
0
votes
1
answer
42
views
Match rows of a matrix/dataframe to the rows of another (strings), regardless of order?
I am looking for a solution to a problem similar to this one:
Match rows of a matrix to the rows of another, regardless of the column order?
But the difference is that I am using strings and not ...
1
vote
1
answer
91
views
Incorrect height and area for intersection rectangle in Java
I am solving a rectangle geometry USACO problem and have an issue when calculating the intersection area of two rectangles.
Summing up the problem for you, you are given three rectangles' lower-left ...
0
votes
1
answer
138
views
Fitting ellipse with 95% CI to points and calculating area within specific line segments
I have a set of points where
x is in [-1, 1],
y is between [-1, 1], and
the maximum sum between abs(x) + abs(y) = 1.
I want to fit an ellipsis (95% CI) and then calculate the are of the ellipsis ...
0
votes
1
answer
1k
views
Intersection Observer on a class with multiple elements visible at the same time
I've been struggling for 2 days with an Intersection Observer
I have an App.vue, where there are a bunch of boxes (.box), you discover more boxes as you scroll, and there can be multiple boxes visible ...
0
votes
1
answer
60
views
How to get intersection data of a field from multiple Mongodb document's field's data. Want a Mongo aggregate Query which I can add in my query
I am already using a Mongo db Aggregate Query to get a array of output.
email will be the array of emails as input in the query.
**aggregateQuery** = [
{
'$match': {
'email': {
...
1
vote
1
answer
234
views
Java HashMap retainAll time complexity
I tested HashMap retainAll method to test which one is faster with JMH.
Two HashMap A, B
Size : A > B, A : 300~400, B : 100~200
Most of B elements is in A, so B - A is like 10~20, very small
Test ...