Opened 16 years ago

Last modified 16 years ago

#86 closed task (fixed)

ST_LineToCurve produces invalid curves

Reported by: mleslie Owned by: mleslie
Priority: medium Milestone: PostGIS 1.4.0
Component: postgis Version: 1.4
Keywords: Cc:

Description

Courtesy of Regina:

SELECT astext(ST_LineToCurve(ST_Buffer(ST_SetSRID(ST_Point(i,j),4326), j)))

As the_geom FROM generate_series(-10,50,10) As i CROSS JOIN

generate_series(40,70, 20) As j limit 1;

Produces a curved geometry of type CURVEPOLYGON that can be stored and operated on as you would expect, but when passing through the unparser (eg. astext()), it fails the consistency check on the curve producing:

ERROR: geometry must have an odd number of points

The check is not in error, the conversion is should ensure a parsable geometry is produced.

Change History (5)

comment:1 by mcayland, 16 years ago

I think the key to this is that the generated CURVEPOLYGON is actually invalid. When trying to parse the geometry using SVN trunk, I get a 'parse error - invalid geometry' message which points to a parse failure at character 104 which looks like this:

CIRCULARSTRING(2.47032822920623e-323 5.32506451083601e-315,4.31693359794991e-308 -2.51624134379182e+307,nan …

Hmmm. So it looks like the parser (possibly correctly) is choking on the NaN. My guess would be the CIRCULARSTRING generation code should not output this value rather than the parser being altered to accept it?

HTH,

Mark.

comment:2 by mleslie, 16 years ago

Ouch. Agreed, the parser shouldn't be dealing with it. Actually, none of those numbers look legitimate.

comment:3 by mcayland, 16 years ago

Setting milestone to 1.4 to track changes ready for release.

comment:4 by mleslie, 16 years ago

This seems to be resolved with the fix for #108.

comment:5 by mleslie, 16 years ago

<i>(No comment was entered for this change.)</i>

Note: See TracTickets for help on using tickets.