duckdb / duckdb/duckdb-spatial
Imprecise `ST_Intersection` results
- Dominant language
- C
- Stars
- 708
- Forks
- 96
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 5
Description
### What happens?
I have two line layers in my GPKG, and when I intersect them using `ST_Intersection`. I get the intersection points slightly off from where they should be.


### To Reproduce
Download this file, unzip, and run the following after updating the path
[intersection.zip](https://github.com/user-attachments/files/19933636/intersection.zip)
```sh
INSTALL spatial; LOAD spatial;
CREATE TEMP TABLE intersection (geom GEOMETRY);
WITH xs AS (
SELECT ST_Transform(geom, 'EPSG:2918', 'EPSG:5070') AS geom
FROM st_read('D:\Users\abdul.siddiqui\Downloads\lowercolorado\intersection.gpkg', layer='xs')
),
reaches AS (
SELECT geom
FROM st_read('D:\Users\abdul.siddiqui\Downloads\lowercolorado\intersection.gpkg', layer='reaches')
)
INSERT INTO intersection
SELECT
(ST_Intersection(xs.geom, reaches.geom))
FROM xs, reaches
WHERE ST_Intersects(xs.geom, reaches.geom);
SELECT ST_AsTEXT(geom)
FROM intersection;
SELECT ST_AsTEXT(geom)
FROM st_read('D:\Users\abdul.siddiqui\Downloads\lowercolorado\intersection.gpkg', layer='qgis_intersections');
```
### OS:
Windows x86_64
### DuckDB Version:
1.2.2
### DuckDB Client:
CLI and Python
### Hardware:
_No response_
### Full Name:
Abdul Raheem Siddiqui
### Affiliation:
ERT Inc.
### What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a stable release
### Did you include all relevant data sets for reproducing the issue?
Yes
### Did you include all code required to reproduce the issue?
- [x] Yes, I have
### Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?
- [x] Yes, I have
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.