Opened 15 years ago
Closed 5 months ago
#220 closed enhancement (fixed)
Implement ST_Numcurves and ST_CurveN
Reported by: | robe | Owned by: | mleslie |
---|---|---|---|
Priority: | low | Milestone: | PostGIS 3.5.0 |
Component: | postgis | Version: | master |
Keywords: | Cc: |
Description
As Mark L pointed out in #212
Change History (8)
comment:1 by , 15 years ago
Owner: | changed from | to
---|
comment:2 by , 15 years ago
comment:3 by , 15 years ago
Milestone: | postgis 1.5.0 → postgis future |
---|
comment:5 by , 9 months ago
Milestone: | PostGIS Fund Me → PostGIS 3.5.0 |
---|
comment:6 by , 9 months ago
Examples copied over from #5663 dbaston note
ST_NumCurves(linestring) should be 1
NumCurves
is actually more like NumSegments
. Here are some examples from MS SQL (which I assume is following ISO)
"SELECT geometry::Parse('LINESTRING (0 0, 1 1, 2 2)').STNumCurves()" ----------- 2
"SELECT geometry::Parse('CIRCULARSTRING (0 0, 1 1, 2 2)').STNumCurves()" ----------- 1
And corresponding ST_CurveN
calls:
"SELECT geometry::Parse('LINESTRING (0 0, 1 1, 2 2)').STCurveN(2).ToString()" ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- LINESTRING (1 1, 2 2)
"SELECT geometry::Parse('CIRCULARSTRING (0 0, 1 1, 2 2)').STCurveN(1).ToString()" ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- CIRCULARSTRING (0 0, 1 1, 2 2)
Damn so maybe not as useful as I thought.
I tried this one on SQL Server to see what a compound would do
SELECT Geometry::STGeomFromText('COMPOUNDCURVE( (2 2, 2.5 2.5), CIRCULARSTRING(2.5 2.5, 4.5 2.5, 3.5 3.5), (3.5 3.5, 2.5 4.5, 3 5) )',0).STNumCurves() -- 4 SELECT Geometry::STGeomFromText('COMPOUNDCURVE( (2 2, 2.5 2.5), CIRCULARSTRING(2.5 2.5, 4.5 2.5, 3.5 3.5), (3.5 3.5, 2.5 4.5, 3 5) )',0).STCurveN(4).STAsText(); -- LINESTRING (2.5 4.5, 3 5)
So sadly not what I was looking for.
Maybe this isn't worth it.
I checked what our ST_DumpSegments does and sadly it seems a bit confused.
SELECT dp.path, ST_AsText(dp.geom) FROM ST_DumpSegments('COMPOUNDCURVE( (2 2, 2.5 2.5), CIRCULARSTRING(2.5 2.5, 4.5 2.5, 3.5 3.5), (3.5 3.5, 2.5 4.5, 3 5) )'::geometry) AS dp;
Doesn't give an error but returns no rows.
comment:7 by , 9 months ago
Priority: | medium → low |
---|
comment:8 by , 5 months ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Going to happen Mark? If not, roll to 2.0