<div dir="ltr">Hey,<div>just a quick note :</div><div>changing you intersection zone definition to use a srid:</div><div>to</div><div>ST_Intersects( ST_GeographyFromtext('SRID=4326;polygon((1.0 1.0, 1.0 2.0, 2.0 2.0, 2.0 1.0, 1.0 1.0))')<br>
</div><div><br></div><div>It doesn't break and return TRUE.</div><div><br></div><div>I'm using 2.1 so it may be because of that.</div><div><br></div><div>Cheers</div><div>Rémi-C</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/10/16 Hartranft, Robert M. (GSFC-423.0)[RAYTHEON COMPANY] <span dir="ltr"><<a href="mailto:robert.m.hartranft@nasa.gov" target="_blank">robert.m.hartranft@nasa.gov</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
<div>Hi All,</div>
<div><br>
</div>
<div>I am using postresql version 9.2.4 and postgis version 2.0</div>
<div><br>
</div>
<div>I am trying to use the multipolygon to simulate a spatial</div>
<div>object that follows lines of constant latitude instead of</div>
<div>using great circle arcs, and allows arc greater than 180 </div>
<div>degrees. </div>
<div><br>
</div>
<div>For example, given the following polygon </div>
<div>(assuming points in a clockwise order covering 270 degrees of longitude):</div>
<div>
<div><br>
</div>
<div>polygon((-180 -89.99, -180 89.9, 90, 89.9 90, -89.9, -180 -89.99))</div>
</div>
<div><br>
</div>
<div>I break it up into multiple polygons each covering 45 degrees of longitude</div>
<div>and adding points every 1 degree to try to simulate constant latitude. </div>
<div>However I get an error from postgis complaining it can't determine a point outside the </div>
<div>multipolygon.</div>
<div><br>
</div>
<div>Here is the sql...</div>
<div><br>
</div>
<div>select 1 where ST_Intersects( 'polygon((1.0 1.0, 1.0 2.0, 2.0 2.0, 2.0 1.0, 1.0 1.0))'::geography, </div>
<div>ST_GeographyFromText('SRID=4326;multipolygon(</div>
<div><br>
</div>
<div>((-180 -89.99, -179 -89.99, -178 -89.99, -177 -89.99, -176 -89.99, -175 -89.99, -174 -89.99, -173 -89.99, -172 -89.99, -171 -89.99, -170 -89.99, -169 -89.99, -168 -89.99, -167 -89.99, -166 -89.99, -165 -89.99, -164 -89.99, -163 -89.99, -162 -89.99, -161
-89.99, -160 -89.99, -159 -89.99, -158 -89.99, -157 -89.99, -156 -89.99, -155 -89.99, -154 -89.99, -153 -89.99, -152 -89.99, -151 -89.99, -150 -89.99, -149 -89.99, -148 -89.99, -147 -89.99, -146 -89.99, -145 -89.99, -144 -89.99, -143 -89.99, -142 -89.99, -141
-89.99, -140 -89.99, -139 -89.99, -138 -89.99, -137 -89.99, -136 -89.99, -135 -89.99, -135 89.99, -136 89.99, -137 89.99, -138 89.99, -139 89.99, -140 89.99, -141 89.99, -142 89.99, -143 89.99, -144 89.99, -145 89.99, -146 89.99, -147 89.99, -148 89.99, -149
89.99, -150 89.99, -151 89.99, -152 89.99, -153 89.99, -154 89.99, -155 89.99, -156 89.99, -157 89.99, -158 89.99, -159 89.99, -160 89.99, -161 89.99, -162 89.99, -163 89.99, -164 89.99, -165 89.99, -166 89.99, -167 89.99, -168 89.99, -169 89.99, -170 89.99,
-171 89.99, -172 89.99, -173 89.99, -174 89.99, -175 89.99, -176 89.99, -177 89.99, -178 89.99, -179 89.99, -180 89.99, -180 -89.99)),</div>
<div><br>
</div>
<div>((-135 -89.99, -134 -89.99, -133 -89.99, -132 -89.99, -131 -89.99, -130 -89.99, -129 -89.99, -128 -89.99, -127 -89.99, -126 -89.99, -125 -89.99, -124 -89.99, -123 -89.99, -122 -89.99, -121 -89.99, -120 -89.99, -119 -89.99, -118 -89.99, -117 -89.99, -116
-89.99, -115 -89.99, -114 -89.99, -113 -89.99, -112 -89.99, -111 -89.99, -110 -89.99, -109 -89.99, -108 -89.99, -107 -89.99, -106 -89.99, -105 -89.99, -104 -89.99, -103 -89.99, -102 -89.99, -101 -89.99, -100 -89.99, -99 -89.99, -98 -89.99, -97 -89.99, -96
-89.99, -95 -89.99, -94 -89.99, -93 -89.99, -92 -89.99, -91 -89.99, -90 -89.99, -90 89.99, -91 89.99, -92 89.99, -93 89.99, -94 89.99, -95 89.99, -96 89.99, -97 89.99, -98 89.99, -99 89.99, -100 89.99, -101 89.99, -102 89.99, -103 89.99, -104 89.99, -105 89.99,
-106 89.99, -107 89.99, -108 89.99, -109 89.99, -110 89.99, -111 89.99, -112 89.99, -113 89.99, -114 89.99, -115 89.99, -116 89.99, -117 89.99, -118 89.99, -119 89.99, -120 89.99, -121 89.99, -122 89.99, -123 89.99, -124 89.99, -125 89.99, -126 89.99, -127
89.99, -128 89.99, -129 89.99, -130 89.99, -131 89.99, -132 89.99, -133 89.99, -134 89.99, -135 89.99, -135 -89.99)),</div>
<div><br>
</div>
<div>((-90 -89.99, -89 -89.99, -88 -89.99, -87 -89.99, -86 -89.99, -85 -89.99, -84 -89.99, -83 -89.99, -82 -89.99, -81 -89.99, -80 -89.99, -79 -89.99, -78 -89.99, -77 -89.99, -76 -89.99, -75 -89.99, -74 -89.99, -73 -89.99, -72 -89.99, -71 -89.99, -70 -89.99,
-69 -89.99, -68 -89.99, -67 -89.99, -66 -89.99, -65 -89.99, -64 -89.99, -63 -89.99, -62 -89.99, -61 -89.99, -60 -89.99, -59 -89.99, -58 -89.99, -57 -89.99, -56 -89.99, -55 -89.99, -54 -89.99, -53 -89.99, -52 -89.99, -51 -89.99, -50 -89.99, -49 -89.99, -48
-89.99, -47 -89.99, -46 -89.99, -45 -89.99, -45 89.99, -46 89.99, -47 89.99, -48 89.99, -49 89.99, -50 89.99, -51 89.99, -52 89.99, -53 89.99, -54 89.99, -55 89.99, -56 89.99, -57 89.99, -58 89.99, -59 89.99, -60 89.99, -61 89.99, -62 89.99, -63 89.99, -64
89.99, -65 89.99, -66 89.99, -67 89.99, -68 89.99, -69 89.99, -70 89.99, -71 89.99, -72 89.99, -73 89.99, -74 89.99, -75 89.99, -76 89.99, -77 89.99, -78 89.99, -79 89.99, -80 89.99, -81 89.99, -82 89.99, -83 89.99, -84 89.99, -85 89.99, -86 89.99, -87 89.99,
-88 89.99, -89 89.99, -90 89.99, -90 -89.99)),</div>
<div><br>
</div>
<div>((-45 -89.99, -44 -89.99, -43 -89.99, -42 -89.99, -41 -89.99, -40 -89.99, -39 -89.99, -38 -89.99, -37 -89.99, -36 -89.99, -35 -89.99, -34 -89.99, -33 -89.99, -32 -89.99, -31 -89.99, -30 -89.99, -29 -89.99, -28 -89.99, -27 -89.99, -26 -89.99, -25 -89.99,
-24 -89.99, -23 -89.99, -22 -89.99, -21 -89.99, -20 -89.99, -19 -89.99, -18 -89.99, -17 -89.99, -16 -89.99, -15 -89.99, -14 -89.99, -13 -89.99, -12 -89.99, -11 -89.99, -10 -89.99, -9 -89.99, -8 -89.99, -7 -89.99, -6 -89.99, -5 -89.99, -4 -89.99, -3 -89.99,
-2 -89.99, -1 -89.99, 0 -89.99, 0 89.99, -1 89.99, -2 89.99, -3 89.99, -4 89.99, -5 89.99, -6 89.99, -7 89.99, -8 89.99, -9 89.99, -10 89.99, -11 89.99, -12 89.99, -13 89.99, -14 89.99, -15 89.99, -16 89.99, -17 89.99, -18 89.99, -19 89.99, -20 89.99, -21
89.99, -22 89.99, -23 89.99, -24 89.99, -25 89.99, -26 89.99, -27 89.99, -28 89.99, -29 89.99, -30 89.99, -31 89.99, -32 89.99, -33 89.99, -34 89.99, -35 89.99, -36 89.99, -37 89.99, -38 89.99, -39 89.99, -40 89.99, -41 89.99, -42 89.99, -43 89.99, -44 89.99,
-45 89.99, -45 -89.99)),</div>
<div><br>
</div>
<div>((0 -89.99, 1 -89.99, 2 -89.99, 3 -89.99, 4 -89.99, 5 -89.99, 6 -89.99, 7 -89.99, 8 -89.99, 9 -89.99, 10 -89.99, 11 -89.99, 12 -89.99, 13 -89.99, 14 -89.99, 15 -89.99, 16 -89.99, 17 -89.99, 18 -89.99, 19 -89.99, 20 -89.99, 21 -89.99, 22 -89.99, 23 -89.99,
24 -89.99, 25 -89.99, 26 -89.99, 27 -89.99, 28 -89.99, 29 -89.99, 30 -89.99, 31 -89.99, 32 -89.99, 33 -89.99, 34 -89.99, 35 -89.99, 36 -89.99, 37 -89.99, 38 -89.99, 39 -89.99, 40 -89.99, 41 -89.99, 42 -89.99, 43 -89.99, 44 -89.99, 45 -89.99, 45 89.99, 44 89.99,
43 89.99, 42 89.99, 41 89.99, 40 89.99, 39 89.99, 38 89.99, 37 89.99, 36 89.99, 35 89.99, 34 89.99, 33 89.99, 32 89.99, 31 89.99, 30 89.99, 29 89.99, 28 89.99, 27 89.99, 26 89.99, 25 89.99, 24 89.99, 23 89.99, 22 89.99, 21 89.99, 20 89.99, 19 89.99, 18 89.99,
17 89.99, 16 89.99, 15 89.99, 14 89.99, 13 89.99, 12 89.99, 11 89.99, 10 89.99, 9 89.99, 8 89.99, 7 89.99, 6 89.99, 5 89.99, 4 89.99, 3 89.99, 2 89.99, 1 89.99, 0 89.99, 0 -89.99)),</div>
<div><br>
</div>
<div>((45 -89.99, 46 -89.99, 47 -89.99, 48 -89.99, 49 -89.99, 50 -89.99, 51 -89.99, 52 -89.99, 53 -89.99, 54 -89.99, 55 -89.99, 56 -89.99, 57 -89.99, 58 -89.99, 59 -89.99, 60 -89.99, 61 -89.99, 62 -89.99, 63 -89.99, 64 -89.99, 65 -89.99, 66 -89.99, 67 -89.99,
68 -89.99, 69 -89.99, 70 -89.99, 71 -89.99, 72 -89.99, 73 -89.99, 74 -89.99, 75 -89.99, 76 -89.99, 77 -89.99, 78 -89.99, 79 -89.99, 80 -89.99, 81 -89.99, 82 -89.99, 83 -89.99, 84 -89.99, 85 -89.99, 86 -89.99, 87 -89.99, 88 -89.99, 89 -89.99, 90 -89.99, 90
89.99, 89 89.99, 88 89.99, 87 89.99, 86 89.99, 85 89.99, 84 89.99, 83 89.99, 82 89.99, 81 89.99, 80 89.99, 79 89.99, 78 89.99, 77 89.99, 76 89.99, 75 89.99, 74 89.99, 73 89.99, 72 89.99, 71 89.99, 70 89.99, 69 89.99, 68 89.99, 67 89.99, 66 89.99, 65 89.99,
64 89.99, 63 89.99, 62 89.99, 61 89.99, 60 89.99, 59 89.99, 58 89.99, 57 89.99, 56 89.99, 55 89.99, 54 89.99, 53 89.99, 52 89.99, 51 89.99, 50 89.99, 49 89.99, 48 89.99, 47 89.99, 46 89.99, 45 89.99, 45 -89.99))</div>
<div>)'));</div>
<div>ERROR: BOOM! Could not generate outside point!</div>
<div>CONTEXT: SQL function "st_intersects" statement 1</div>
<div><br>
</div>
<div>The problem also happens if the spatial object is stored in a table</div>
<div>and I try to query it. The above example is just the easiest way to</div>
<div>reproduce the issue.</div>
<div><br>
</div>
<div>I would be thankful for any help in solving this issue.</div>
<div><br>
</div>
<div><br>
</div>
<div>Bob</div>
<div>
<div style="font-family:Helvetica"><tt><font>-----------------------------------------------------------------<br>
Robert Hartranft<br>
Mission Operations and Services<br>
Intelligence & Information System<br>
Raytheon Company<br>
301-851-8197<br>
<a href="mailto:robert_m_hartranft@raytheon.com" target="_blank">robert_m_hartranft@raytheon.com</a><br>
<a href="mailto:robert.m.hartranft@nasa.gov" target="_blank">robert.m.hartranft@nasa.gov</a><br>
5700 Rivertech Court<br>
Riverdale, MD 20737<br>
-----------------------------------------------------------------<br>
</font></tt></div>
</div>
<br>
</div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>