Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paths can be circular #4461

Open
justinefricou opened this issue Jan 24, 2025 · 0 comments
Open

Paths can be circular #4461

justinefricou opened this issue Jan 24, 2025 · 0 comments
Labels

Comments

@justinefricou
Copy link
Contributor

Paths should not be circular, but existing constraints do not actually ensure it:

ALTER TABLE core_path ADD CONSTRAINT core_path_geom_isvalid CHECK (ST_IsValid(geom));
ALTER TABLE core_path ADD CONSTRAINT core_path_geom_issimple CHECK (ST_IsSimple(geom));

Example: 'SRID=2154;LINESTRING (220720.2970061041 6839647.216621559, 220754.7791213283 6839679.476219036, 220784.1131707298 6839651.675301611,220720.2970061041 6839647.216621559)'

Image

SELECT ST_IsValid(ST_GeomFromText('SRID=2154;LINESTRING (220720.2970061041 6839647.216621559, 220754.7791213283 6839679.476219036, 220784.1131707298 6839651.675301611,220720.2970061041 6839647.216621559)'));
 st_isvalid 
------------
 t
(1 row)

SELECT ST_IsSimple(ST_GeomFromText('SRID=2154;LINESTRING (220720.2970061041 6839647.216621559, 220754.7791213283 6839679.476219036, 220784.1131707298 6839651.675301611,220720.2970061041 6839647.216621559)'));
 st_issimple 
-------------
 t
(1 row)

Some factors that need to be considered:

  • what implications will path snapping have on this?
  • currently, the merge_segmented_paths command can merge two paths into a circular one if both of their extremities touch
  • users will need to split any circular paths in their databases prior to updating to a version that introduces this change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant