[postgis-users] Intersection problem

Quentin Ladetto quentin at ladetto.ch
Tue Mar 6 08:12:42 PST 2007


Hello!

Doing some intersection with Postgis version 1.1.6-2, I'm facing a very strange problem (at least for me)

Two Polygons are passing all possible tests I'm able to do, but once it comes to compute the
"Intersection", an error is thrown while the "Intersects" was ok.

You find here the data in question.

If somebody would have an idea of what is going on, any hint is more than welcome !

Best regards and thanks,

Quentin Ladetto



$Zone1_ready="GeomFromText('POLYGON((554665 151170,554664.470319934 151159.218114564,554662.886380845
151148.540064579,554660.263436931 151138.068685503,554656.626748577 151127.904822441,554652.011339079
151118.146358951,554646.461657354 151108.887274369,554640.031149871 151100.216738744,554632.781745932
151092.218254071,554624.78326126 151084.968850132,554616.112725635 151078.538342648,554606.853641054
151072.988660923,554597.095177564 151068.373251425,554586.931314502 151064.736563071,554576.459935426
151062.113619157,554565.781885441 151060.529680067,554555.000000005 151060,554544.218114569
151060.529680066,554533.540064584 151062.113619155,554523.068685508 151064.736563068,554512.904822446
151068.373251421,554503.146358955 151072.988660919,554493.887274373 151078.538342643,554485.216738747
151084.968850126,554477.218254075 151092.218254064,554469.968850135 151100.216738736,554463.538342651
151108.887274361,554457.988660926 151118.146358942,554453.373251427 151127.904822432,554449.736563072
151138.068685493,554447.113619157 151148.540064569,554445.529680067 151159.218114554,554445
151169.99999999,554445.529680065 151180.781885426,554447.113619154 151191.459935411,554449.736563066
151201.931314488,554453.37325142 151212.09517755,554457.988660916 151221.853641041,554463.53834264
151231.112725622,554469.968850122 151239.783261249,554477.218254061 151247.781745922,554485.216738732
151255.031149862,554493.887274357 151261.461657346,554503.146358937 151267.011339072,554512.904822427
151271.626748571,554523.068685489 151275.263436926,554533.540064564 151277.886380842,554544.218114549
151279.470319933,554554.999999985 151280,554565.781885421 151279.470319935,554576.459935407
151277.886380847,554586.931314483 151275.263436935,554597.095177545 151271.626748582,554606.853641036
151267.011339086,554616.112725618 151261.461657363,554624.783261245 151255.031149881,554632.781745918
151247.781745943,554640.031149859 151239.783261272,554646.461657343 151231.112725647,554652.01133907
151221.853641067,554656.626748569 151212.095177577,554660.263436925 151201.931314516,554662.886380841
151191.459935441,554664.470319932 151180.781885456,554665 151170.00000002,554665 151170),(554625
151170,554625 151170.000000013,554624.662930866 151176.861199835,554623.654969626
151183.656322553,554621.985823498 151190.319927419,554619.671567271 151196.787840276,554616.734488499
151202.997771588,554613.202872855 151208.889916321,554609.110731728 151214.4075299,554604.497474675
151219.497474691,554599.407529883 151224.110731742,554593.889916303 151228.202872867,554587.997771569
151231.734488509,554581.787840256 151234.67156728,554575.319927398 151236.985823504,554568.656322532
151238.65496963,554561.861199814 151239.662930868,554554.999999991 151240,554548.138800168
151239.662930866,554541.34367745 151238.654969626,554534.680072584 151236.985823499,554528.212159726
151234.671567272,554522.002228415 151231.7344885,554516.110083682 151228.202872857,554510.592470102
151224.11073173,554505.502525311 151219.497474678,554500.88926826 151214.407529886,554496.797127135
151208.889916305,554493.265511492 151202.997771571,554490.328432722 151196.787840259,554488.014176497
151190.319927401,554486.345030371 151183.656322535,554485.337069132 151176.861199817,554485
151169.999999994,554485.337069134 151163.138800171,554486.345030373 151156.343677453,554488.0141765
151149.680072587,554490.328432726 151143.212159729,554493.265511498 151137.002228417,554496.797127142
151131.110083684,554500.889268268 151125.592470105,554505.50252532 151120.502525314,554510.592470112
151115.889268262,554516.110083692 151111.797127136,554522.002228426 151108.265511494,554528.212159738
151105.328432723,554534.680072596 151103.014176498,554541.343677462 151101.345030371,554548.13880018
151100.337069133,554555.000000003 151100,554561.861199826 151100.337069133,554568.656322544
151101.345030372,554575.31992741 151103.014176499,554581.787840268 151105.328432725,554587.99777158
151108.265511497,554593.889916313 151111.79712714,554599.407529893 151115.889268266,554604.497474684
151120.502525318,554609.110731736 151125.59247011,554613.202872862 151131.11008369,554616.734488505
151137.002228423,554619.671567276 151143.212159735,554621.985823501 151149.680072593,554623.654969628
151156.343677459,554624.662930867 151163.138800177,554625 151170))',-1)";

$Zone2_ready="GeomFromText('POLYGON((554663 151159,554662.470319934 151148.218114564,554661.983253039
151144.934576273,554660.263436931 151138.068685503,554656.626748577 151127.904822441,554652.011339079
151118.146358951,554646.461657354 151108.887274369,554640.031149871 151100.216738744,554632.781745932
151092.218254071,554624.78326126 151084.968850132,554616.112725635 151078.538342648,554606.853641054
151072.988660923,554597.095177564 151068.373251425,554586.931314502 151064.736563071,554576.459935426
151062.113619157,554565.781885441 151060.529680067,554555.000000005 151060,554544.218114569
151060.529680066,554533.540064584 151062.113619155,554523.068685508 151064.736563068,554512.904822446
151068.373251421,554503.146358955 151072.988660919,554493.887274373 151078.538342643,554485.216738747
151084.968850126,554477.218254075 151092.218254064,554469.968850135 151100.216738736,554463.538342651
151108.887274361,554457.988660926 151118.146358942,554453.373251427 151127.904822432,554449.736563072
151138.068685493,554447.113619157 151148.540064569,554445.529680067 151159.218114554,554445
151169.99999999,554445.529680065 151180.781885426,554446.016746961 151184.065423725,554447.736563066
151190.931314488,554451.37325142 151201.09517755,554455.988660916 151210.853641041,554461.53834264
151220.112725622,554467.968850122 151228.783261249,554475.218254061 151236.781745922,554483.216738732
151244.031149862,554491.887274357 151250.461657346,554501.146358937 151256.011339072,554510.904822427
151260.626748571,554521.068685489 151264.263436926,554531.540064564 151266.886380842,554542.218114549
151268.470319933,554552.999999985 151269,554563.781885421 151268.470319935,554574.459935407
151266.886380847,554584.931314483 151264.263436935,554595.095177545 151260.626748582,554604.853641036
151256.011339086,554614.112725618 151250.461657363,554622.783261245 151244.031149881,554630.781745918
151236.781745943,554638.031149859 151228.783261272,554644.461657343 151220.112725647,554650.01133907
151210.853641067,554654.626748569 151201.095177577,554658.263436925 151190.931314516,554660.886380841
151180.459935441,554662.470319932 151169.781885456,554663 151159.00000002,554663
151159),(554485.322130985 151176.557126847,554484.345030371 151172.656322535,554483.337069132
151165.861199817,554483 151158.999999994,554483.337069134 151152.138800171,554484.345030373
151145.343677453,554486.0141765 151138.680072587,554488.328432726 151132.212159729,554491.265511498
151126.002228417,554494.797127142 151120.110083684,554498.889268268 151114.592470105,554503.50252532
151109.502525314,554508.592470112 151104.889268262,554514.110083692 151100.797127136,554520.002228426
151097.265511494,554526.212159738 151094.328432723,554532.680072596 151092.014176498,554539.343677462
151090.345030371,554546.13880018 151089.337069133,554553.000000003 151089,554559.861199826
151089.337069133,554566.656322544 151090.345030372,554573.31992741 151092.014176499,554579.787840268
151094.328432725,554585.99777158 151097.265511497,554591.889916313 151100.79712714,554597.407529893
151104.889268266,554602.497474684 151109.502525318,554607.110731736 151114.59247011,554611.202872862
151120.11008369,554614.734488505 151126.002228423,554617.671567276 151132.212159735,554619.985823501
151138.680072593,554621.654969628 151145.343677459,554622.662930867 151152.138800177,554622.677869014
151152.442873151,554623.654969628 151156.343677459,554624.662930867 151163.138800177,554625 151170,554625
151170.000000013,554624.662930866 151176.861199835,554623.654969626 151183.656322553,554621.985823498
151190.319927419,554619.671567271 151196.787840276,554616.734488499 151202.997771588,554613.202872855
151208.889916321,554609.110731728 151214.4075299,554604.497474675 151219.497474691,554599.407529883
151224.110731742,554593.889916303 151228.202872867,554587.997771569 151231.734488509,554581.787840256
151234.67156728,554575.319927398 151236.985823504,554568.656322532 151238.65496963,554561.861199814
151239.662930868,554554.999999991 151240,554548.138800168 151239.662930866,554541.34367745
151238.654969626,554534.680072584 151236.985823499,554528.212159726 151234.671567272,554522.002228415
151231.7344885,554516.110083682 151228.202872857,554510.592470102 151224.11073173,554505.502525311
151219.497474678,554500.88926826 151214.407529886,554496.797127135 151208.889916305,554493.265511492
151202.997771571,554490.328432722 151196.787840259,554488.014176497 151190.319927401,554486.345030371
151183.656322535,554485.337069132 151176.861199817,554485.322130985 151176.557126847))',-1)";
 		
		$query="select Intersects(".$Zone1_ready.",".$Zone2_ready.")";
		 $intersection_exists=sql_query($dbconn, $query);			     		
		 echo "intersection exists: ".$intersection_exists[0]['intersects']."\n";
		
		 $query="select Overlaps(".$Zone1_ready.",".$Zone2_ready.")";
		 $intersection_exists=sql_query($dbconn, $query);			     		
		 echo "Overlaps : ".$intersection_exists[0]['overlaps']."\n";
		 		
		
		 $query="select Contains(".$Zone2_ready.",".$Zone1_ready.")";
		 $intersection_exists=sql_query($dbconn, $query);			     		
		 echo "Zone 1 contains Zone 2 : ".$intersection_exists[0]['contains']."\n";
		
		 $query="select Intersection(".$Zone2_ready.",".$Zone1_ready.")";
		 echo "query:\n$query\n";
		 $intersection_exists=sql_query($dbconn, $query);			     		
		 echo "intersection : ".$intersection_exists[0]['intersection']."\n";



More information about the postgis-users mailing list