Opened 11 years ago

Last modified 7 years ago

#2627 new enhancement

st_linetocurve() pta_desegmentize needs implementation for npoints < 4

Reported by: mjurce Owned by: pramsey
Priority: medium Milestone: PostGIS Fund Me
Component: postgis Version: 2.0.x
Keywords: curves Cc:

Description

Still got this kind of errors.

Attachments (1)

Perimetri_PUC-PEIP.zip (342.6 KB ) - added by mjurce 11 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by strk, 11 years ago

Keywords: curves added

Can you attach an example of the case you're trying to solve ?

by mjurce, 11 years ago

Attachment: Perimetri_PUC-PEIP.zip added

comment:2 by mjurce, 11 years ago

Import the attached files and run st_linetocurve on the geoms.

comment:3 by pramsey, 11 years ago

The only N < 4 that exists for this case is 3. And for 3-point lines the only interpretation is that the points are control points on the curve, so there's no "desegmentization" to be done. Basically this is just a cast, from linestring to circularstring. Or am I mis-interpreting?

in reply to:  3 comment:4 by mjurce, 11 years ago

Replying to pramsey:

The only N < 4 that exists for this case is 3. And for 3-point lines the only interpretation is that the points are control points on the curve, so there's no "desegmentization" to be done. Basically this is just a cast, from linestring to circularstring. Or am I mis-interpreting?

Could be a linestring with 3 points. Depends how the points are on the plane.

comment:5 by mjurce, 11 years ago

Considering that the original data to be converted to curved was linear and linear geoms comes from curved. If they had curves before conversion to linear, probably they will be not approximated with only 3 points. Except the cases with flat arcs.

comment:6 by strk, 11 years ago

Type: defectenhancement

pramsey: yes, I think it would be a cast, but the function should only "cast" if a set of preconditions hold: approximate equidistance from the center, arc length matching the default number of quadrant segments (for 3 points, with default quadrant segments being 8, the arc should cover not more than 3/8 of the quadrant). See also #2428.

Changing to "enhancement".

comment:7 by strk, 11 years ago

Sorry, I take "approximate equidistance from the center" back, in that any 3 points _define_ the center. So the only left condition is the number of quadrant segments. Can help to avoid taking an L shape for a curve, but I suspect there'd be a lot more lines erroneously taken as curves. Hard problem

comment:8 by mjurce, 11 years ago

What about http://trac.osgeo.org/postgis/ticket/2464

The error parameter could be the max distance between the segment and the arc: build the arc then check the distance against the linear segment.

Cast to arc if distance low ( to be specified ).

in reply to:  8 comment:9 by mjurce, 11 years ago

Replying to mjurce:

What about http://trac.osgeo.org/postgis/ticket/2464

The error parameter could be the max distance between the segment and the arc: build the arc then check the distance against the linear segment.

Cast to arc if distance low ( to be specified ).

This could be down with sagitta.

comment:10 by pramsey, 11 years ago

Milestone: PostGIS 2.0.5PostGIS Future

I'm sorry, I'm just not seeing this one.

comment:11 by mjurce, 11 years ago

The case when a linestring with 3 points could be a curve is when we have a flat arc. This has to be checked.

The other cases remain the same.

comment:12 by robe, 7 years ago

Milestone: PostGIS FuturePostGIS Fund Me

Milestone renamed

Note: See TracTickets for help on using tickets.