[postgis-devel] [PostGIS] #258: ST_HausdorffDistance crashes server
PostGIS
trac at osgeo.org
Mon Oct 5 15:05:05 PDT 2009
#258: ST_HausdorffDistance crashes server
----------------------+-----------------------------------------------------
Reporter: robe | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: postgis 1.5.0
Component: postgis | Version: trunk
Resolution: | Keywords:
----------------------+-----------------------------------------------------
Comment (by robe):
Strk,
I think this may actually be a PostGIS bug or a more sinister problem you
see if you run more than one at a time. I just tried and the thing is is
that if I exercise each one individually, it doesn't break, but if I run
the query it does.
So run individually:
{{{
SELECT ST_HausdorffDistance(ST_GeomFromText('POINT(-10 40)'),
ST_GeomFromText('POLYGON((-7 60,-7.05764415879031
59.4147290339516,-7.22836140246614 58.8519497029047,-7.50559116309236
58.3332893009412,-7.87867965644036 57.8786796564404,-8.33328930094119
57.5055911630924,-8.85194970290473 57.2283614024661,-9.41472903395161
57.0576441587903,-9.99999999999999 57,-10.5852709660484
57.0576441587903,-11.1480502970953 57.2283614024661,-11.6667106990588
57.5055911630924,-12.1213203435596 57.8786796564404,-12.4944088369076
58.3332893009412,-12.7716385975339 58.8519497029047,-12.9423558412097
59.4147290339516,-13 60,-12.9423558412097
60.5852709660484,-12.7716385975339 61.1480502970953,-12.4944088369076
61.6667106990588,-12.1213203435597 62.1213203435596,-11.6667106990588
62.4944088369076,-11.1480502970953 62.7716385975339,-10.5852709660484
62.9423558412097,-10 63,-9.41472903395163
62.9423558412097,-8.85194970290474 62.7716385975339,-8.3332893009412
62.4944088369076,-7.87867965644036 62.1213203435596,-7.50559116309237
61.6667106990588,-7.22836140246614 61.1480502970953,-7.05764415879031
60.5852709660484,-7 60))') );
SELECT ST_HausdorffDistance(ST_GeomFromText('POINT(-10 40)'),
ST_GeomFromText('POLYGON((-7 60,-7.05764415879031
59.4147290339516,-7.22836140246614 58.8519497029047,-7.50559116309236
58.3332893009412,-7.87867965644036 57.8786796564404,-8.33328930094119
57.5055911630924,-8.85194970290473 57.2283614024661,-9.41472903395161
57.0576441587903,-9.99999999999999 57,-10.5852709660484
57.0576441587903,-11.1480502970953 57.2283614024661,-11.6667106990588
57.5055911630924,-12.1213203435596 57.8786796564404,-12.4944088369076
58.3332893009412,-12.7716385975339 58.8519497029047,-12.9423558412097
59.4147290339516,-13 60,-12.9423558412097
60.5852709660484,-12.7716385975339 61.1480502970953,-12.4944088369076
61.6667106990588,-12.1213203435597 62.1213203435596,-11.6667106990588
62.4944088369076,-11.1480502970953 62.7716385975339,-10.5852709660484
62.9423558412097,-10 63,-9.41472903395163
62.9423558412097,-8.85194970290474 62.7716385975339,-8.3332893009412
62.4944088369076,-7.87867965644036 62.1213203435596,-7.50559116309237
61.6667106990588,-7.22836140246614 61.1480502970953,-7.05764415879031
60.5852709660484,-7 60))') );
SELECT ST_HausdorffDistance(ST_GeomFromText('POINT(-10 55)'),
ST_GeomFromText('POLYGON((-7 60,-7.05764415879031
59.4147290339516,-7.22836140246614 58.8519497029047,-7.50559116309236
58.3332893009412,-7.87867965644036 57.8786796564404,-8.33328930094119
57.5055911630924,-8.85194970290473 57.2283614024661,-9.41472903395161
57.0576441587903,-9.99999999999999 57,-10.5852709660484
57.0576441587903,-11.1480502970953 57.2283614024661,-11.6667106990588
57.5055911630924,-12.1213203435596 57.8786796564404,-12.4944088369076
58.3332893009412,-12.7716385975339 58.8519497029047,-12.9423558412097
59.4147290339516,-13 60,-12.9423558412097
60.5852709660484,-12.7716385975339 61.1480502970953,-12.4944088369076
61.6667106990588,-12.1213203435597 62.1213203435596,-11.6667106990588
62.4944088369076,-11.1480502970953 62.7716385975339,-10.5852709660484
62.9423558412097,-10 63,-9.41472903395163
62.9423558412097,-8.85194970290474 62.7716385975339,-8.3332893009412
62.4944088369076,-7.87867965644036 62.1213203435596,-7.50559116309237
61.6667106990588,-7.22836140246614 61.1480502970953,-7.05764415879031
60.5852709660484,-7 60))') );
SELECT ST_HausdorffDistance(ST_GeomFromText('POINT(-10 55)'),
ST_GeomFromText('POLYGON((-7 60,-7.05764415879031
59.4147290339516,-7.22836140246614 58.8519497029047,-7.50559116309236
58.3332893009412,-7.87867965644036 57.8786796564404,-8.33328930094119
57.5055911630924,-8.85194970290473 57.2283614024661,-9.41472903395161
57.0576441587903,-9.99999999999999 57,-10.5852709660484
57.0576441587903,-11.1480502970953 57.2283614024661,-11.6667106990588
57.5055911630924,-12.1213203435596 57.8786796564404,-12.4944088369076
58.3332893009412,-12.7716385975339 58.8519497029047,-12.9423558412097
59.4147290339516,-13 60,-12.9423558412097
60.5852709660484,-12.7716385975339 61.1480502970953,-12.4944088369076
61.6667106990588,-12.1213203435597 62.1213203435596,-11.6667106990588
62.4944088369076,-11.1480502970953 62.7716385975339,-10.5852709660484
62.9423558412097,-10 63,-9.41472903395163
62.9423558412097,-8.85194970290474 62.7716385975339,-8.3332893009412
62.4944088369076,-7.87867965644036 62.1213203435596,-7.50559116309237
61.6667106990588,-7.22836140246614 61.1480502970953,-7.05764415879031
60.5852709660484,-7 60))') );
}}}
Works fine -- well I don't know if the numbers are right but doesn't break
(returns 8 or 23);
But run together - crash of death so bad that I have to manually restart
the PostgreSQL service:
{{{
SELECT ST_HausdorffDistance(foo1.the_geom, foo2.the_geom )
FROM (VALUES (ST_GeomFromText('POINT(-10 40)') ),
( ST_GeomFromText('POINT(-10 55)') )
) As foo1(the_geom)
CROSS JOIN
( VALUES ( ST_GeomFromText('POLYGON((-7
60,-7.05764415879031 59.4147290339516,-7.22836140246614
58.8519497029047,-7.50559116309236 58.3332893009412,-7.87867965644036
57.8786796564404,-8.33328930094119 57.5055911630924,-8.85194970290473
57.2283614024661,-9.41472903395161 57.0576441587903,-9.99999999999999
57,-10.5852709660484 57.0576441587903,-11.1480502970953
57.2283614024661,-11.6667106990588 57.5055911630924,-12.1213203435596
57.8786796564404,-12.4944088369076 58.3332893009412,-12.7716385975339
58.8519497029047,-12.9423558412097 59.4147290339516,-13
60,-12.9423558412097 60.5852709660484,-12.7716385975339
61.1480502970953,-12.4944088369076 61.6667106990588,-12.1213203435597
62.1213203435596,-11.6667106990588 62.4944088369076,-11.1480502970953
62.7716385975339,-10.5852709660484 62.9423558412097,-10
63,-9.41472903395163 62.9423558412097,-8.85194970290474
62.7716385975339,-8.3332893009412 62.4944088369076,-7.87867965644036
62.1213203435596,-7.50559116309237 61.6667106990588,-7.22836140246614
61.1480502970953,-7.05764415879031 60.5852709660484,-7 60))' ) ),
( ST_GeomFromText('POLYGON((-7 60,-7.05764415879031
59.4147290339516,-7.22836140246614 58.8519497029047,-7.50559116309236
58.3332893009412,-7.87867965644036 57.8786796564404,-8.33328930094119
57.5055911630924,-8.85194970290473 57.2283614024661,-9.41472903395161
57.0576441587903,-9.99999999999999 57,-10.5852709660484
57.0576441587903,-11.1480502970953 57.2283614024661,-11.6667106990588
57.5055911630924,-12.1213203435596 57.8786796564404,-12.4944088369076
58.3332893009412,-12.7716385975339 58.8519497029047,-12.9423558412097
59.4147290339516,-13 60,-12.9423558412097
60.5852709660484,-12.7716385975339 61.1480502970953,-12.4944088369076
61.6667106990588,-12.1213203435597 62.1213203435596,-11.6667106990588
62.4944088369076,-11.1480502970953 62.7716385975339,-10.5852709660484
62.9423558412097,-10 63,-9.41472903395163
62.9423558412097,-8.85194970290474 62.7716385975339,-8.3332893009412
62.4944088369076,-7.87867965644036 62.1213203435596,-7.50559116309237
61.6667106990588,-7.22836140246614 61.1480502970953,-7.05764415879031
60.5852709660484,-7 60))' ) )
) As foo2(the_geom);
}}}
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/258#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
PostGIS
More information about the postgis-devel
mailing list