Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1964 closed defect (duplicate)

Regression in ST_StartPoint()

Reported by: pramsey Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.2
Component: postgis Version: 2.0.x
Keywords: Cc:

Description

In 1.5, this SQL returns a start point:

select st_startpoint('MULTILINESTRING((0 0, 1 1))');

In 2.0 it returns NULL.

Change History (7)

comment:1 by pramsey, 12 years ago

Also

ST_EndPoint
ST_NumInteriorRings

Potentially others.

comment:2 by robe, 12 years ago

Resolution: duplicate
Status: newclosed

I already complained about this by the way. I recall strk saying I was imagining things or it was a mistake if it ever worked when I had to rework all my tiger code to work around this issue. See ticket #1345

comment:3 by strk, 12 years ago

It's always been like that. It's dictated by the standard. Those functions are only meant to work with LINESTRING, not MULTI*. You may argue you'd want an exception, or you'd want a guess about which geometry to consider, but it'd be a change from previous versions IIRC.

comment:4 by pramsey, 12 years ago

It is set in the standard, but it has not "always been like that", as a quick check on an older version, or glancing at the code pre-2.0 confirms.

comment:5 by robe, 12 years ago

So are we in agreement to simply document this as a breaking change and move on.

I think the new behavior albeit a regression, is the more correct and accepted behavior of spatial databases.

comment:6 by strk, 12 years ago

Alright guys, sorry for the confusion. I'm fine with documenting the breaking change. Not sure if an exception would be better than a NULL but for sure it'd be another breaking change which isn't nice at this moment.

comment:7 by robe, 12 years ago

An exception IS BETTER. It too me at least an hour to track down why my tiger geocoder was working in 1.5 and returning null points for everything in 2.0. If a simple error was thrown that said "Only works with linestraings" , that time owuld have been reduced to less than 5 minutes.

If you are going to have a breaking change, break hard not silently. The only thing worse than an error is the wrong answer you are expecting to be right.

Note: See TracTickets for help on using tickets.