Opened 16 years ago
Closed 15 years ago
#168 closed defect (fixed)
Can't unparse (to wkt or wkb) polygon with missing end point
Reported by: | pramsey | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 1.4.0 |
Component: | postgis | Version: | 1.4 |
Keywords: | Cc: |
Description (last modified by )
I managed to load this into 1.4 using the 1.3 shp2pgsql utility (so the parser accepted it). And now I can't dump the table because this geometry won't unparse. Fortunately, the GML output is more forgiving:
<gml:MultiPolygon srsName="EPSG:2270"> <gml:polygonMember> <gml:Polygon> <gml:outerBoundaryIs> <gml:LinearRing> <gml:coordinates> 4280509.572796883992851,250062.898095423181076,1384.223139199977595 4280509.572796883992851,250062.898095423181076,1384.223139199977595 4280509.572796883992851,250062.898095423181076,1384.223139199977595 </gml:coordinates> </gml:LinearRing> </gml:outerBoundaryIs> </gml:Polygon> </gml:polygonMember> </gml:MultiPolygon>
It's a three-point polygon where startpoint = midpoint = endpoint.
Change History (8)
comment:1 by , 16 years ago
Description: | modified (diff) |
---|
comment:2 by , 16 years ago
Description: | modified (diff) |
---|
comment:3 by , 16 years ago
comment:4 by , 16 years ago
Small test case to reproduce.
medford=# create table foo (g geometry); CREATE TABLE medford=# insert into foo values ('01060000C00100000001030000C00100000003000000E3D9107E234F5041A3DB66BC97A30F4122ACEF440DAF9440FFFFFFFFFFFFEFFFE3D9107E234F5041A3DB66BC97A30F4122ACEF440DAF9440FFFFFFFFFFFFEFFFE3D9107E234F5041A3DB66BC97A30F4122ACEF440DAF9440FFFFFFFFFFFFEFFF'); INSERT 0 1 medford=# select npoints(g) from foo; npoints --------- 3 (1 row) medford=# select astext(g) from foo; // boom
comment:5 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This should now be fixed in SVN, in that instead of crashing the backend, the unparser correctly returns an error. Interestingly enough, this opens up another question related to the parser validity checks - what do we do if there is already an invalid geom in the database?
ATB,
Mark.
comment:6 by , 15 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Please see also #411. This can't be the correct fix. No way to recover the 'invalid in db' case, and shp2pgsql still allows these shapes to get in (as of current 2.0.0SVN)
comment:7 by , 15 years ago
This is ready for testing again in branches 1.4, 1.5 and trunk. I couldn't reproduce the crash myself (but could have been lucky..)
Crash testers please step up for testing. I'm going to re-close this.
comment:8 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Here's the backtrace when the unparser hits this kind of case: