<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:37:32 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-34699] $geoWithin doesn&apos;t return correct geo-points when using $box query </title>
                <link>https://jira.mongodb.org/browse/SERVER-34699</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I&apos;m trying to find geolocations inside a geographical area using a bounding box but it seems that $geoWithin query doesn&apos;t return correct points at certain range of the bounding box. Adding an example query below.&lt;/p&gt;

&lt;p&gt;db.wisp.find({&quot;features.geometry&quot;:{ $geoWithin: {$box: [&lt;span class=&quot;error&quot;&gt;&amp;#91;156.82969752500003, -8.287855253974222&amp;#93;&lt;/span&gt;,&lt;span class=&quot;error&quot;&gt;&amp;#91;-10.05235377500002, 61.99562499932121&amp;#93;&lt;/span&gt;]}}});&lt;/p&gt;

&lt;p&gt;An observation - If I make the south-west longitude value to -156, then correct values are returned.&lt;/p&gt;</description>
                <environment></environment>
        <key id="534672">SERVER-34699</key>
            <summary>$geoWithin doesn&apos;t return correct geo-points when using $box query </summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="asya.kamsky@mongodb.com">Asya Kamsky</assignee>
                                    <reporter username="rachita.bansal">Rachita Bansal</reporter>
                        <labels>
                    </labels>
                <created>Thu, 26 Apr 2018 17:37:01 +0000</created>
                <updated>Tue, 8 May 2018 14:29:48 +0000</updated>
                            <resolved>Fri, 27 Apr 2018 18:23:02 +0000</resolved>
                                    <version>3.6.4</version>
                                                    <component>Geo</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="1880691" author="rachita.bansal" created="Wed, 2 May 2018 17:10:14 +0000"  >&lt;p&gt;I&apos;m a little confused here because I tried using the CRS field for big polygons (reference - &lt;a href=&quot;http://man.hubwiz.com/docset/MongoDB.docset/Contents/Resources/Documents/docs.mongodb.org/manual/reference/operator/query/geoWithin/index.html#geowithin-big-poly)&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://man.hubwiz.com/docset/MongoDB.docset/Contents/Resources/Documents/docs.mongodb.org/manual/reference/operator/query/geoWithin/index.html#geowithin-big-poly)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;m using a query something like below for all bounding box -&lt;/p&gt;

&lt;p&gt;It works well with bounding box more than a single hemisphere but when I use the same query for small polygons, the results are still incorrect.&lt;/p&gt;

&lt;p&gt;For example, if I try using the below query for these coordinates -&lt;/p&gt;

&lt;p&gt;[ [ [ -122.73918903125002, 23.414729495765084 ],&lt;/p&gt;

&lt;p&gt;&#160; &#160; [ -122.73918903125002, 41.78103456202856 ],&lt;/p&gt;

&lt;p&gt;&#160; &#160; [ -69.43352496875002, 41.78103456202856 ],&lt;/p&gt;

&lt;p&gt;&#160; &#160; [ -69.43352496875002, 23.414729495765084 ],&lt;/p&gt;

&lt;p&gt;&#160; &#160; [ -122.73918903125002, 23.414729495765084 ] ] ]&lt;/p&gt;

&lt;p&gt;There are no results found. Attaching expected result and actual result with this query.&lt;/p&gt;

&lt;p&gt;&quot;features.geometry&quot;: {&lt;br/&gt;
 &#160; $geoWithin: {&lt;br/&gt;
 &#160; &#160; $geometry: {&lt;br/&gt;
 &#160; &#160; &#160; type: &quot;Polygon&quot;,&lt;br/&gt;
 &#160; &#160; &#160; coordinates: [],&lt;br/&gt;
 &#160; &#160; &#160; crs: {&lt;br/&gt;
 &#160; &#160; &#160; &#160; type: &quot;name&quot;,&lt;br/&gt;
 &#160; &#160; &#160; &#160; properties:&lt;/p&gt;

{ &#160; &#160; &#160; &#160; &#160; name: &quot;urn:x-mongodb:crs:strictwinding:EPSG:4326&quot; &#160; &#160; &#160; &#160; }

&lt;p&gt;&#160; &#160; &#160; }&lt;br/&gt;
 &#160; &#160; }&lt;br/&gt;
 &#160; }&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;185732_thumb&quot; href=&quot;https://jira.mongodb.org/secure/attachment/185732/185732_Screen+Shot+2018-05-02+at+1.03.04+PM.png&quot; title=&quot;Screen Shot 2018-05-02 at 1.03.04 PM.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;185732&quot; file-preview-title=&quot;Screen Shot 2018-05-02 at 1.03.04 PM.png&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/thumbnail/185732/_thumb_185732.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;185733_thumb&quot; href=&quot;https://jira.mongodb.org/secure/attachment/185733/185733_Screen+Shot+2018-05-02+at+1.03.26+PM.png&quot; title=&quot;Screen Shot 2018-05-02 at 1.03.26 PM.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;185733&quot; file-preview-title=&quot;Screen Shot 2018-05-02 at 1.03.26 PM.png&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/thumbnail/185733/_thumb_185733.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="1877115" author="asya" created="Sat, 28 Apr 2018 20:36:49 +0000"  >&lt;p&gt;See also discussion in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-17092&quot; title=&quot;$geoWithin does not return result on certains Polygons&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-17092&quot;&gt;&lt;del&gt;SERVER-17092&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1877113" author="asya" created="Sat, 28 Apr 2018 20:34:55 +0000"  >&lt;p&gt;Also note &lt;a href=&quot;https://docs.mongodb.com/manual/reference/operator/query/box/#behavior&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;$box Behavior&lt;/a&gt; where flat (planar) geometry is used.&lt;/p&gt;</comment>
                            <comment id="1877105" author="asya" created="Sat, 28 Apr 2018 20:23:35 +0000"  >&lt;p&gt;Please note from &lt;a href=&quot;https://docs.mongodb.com/manual/reference/operator/query/geoWithin/#op._S_geoWithin&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;our documentation&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;For $geoWithin queries that specify GeoJSON geometries with areas greater than a single hemisphere, the use of the default CRS results in queries for the complementary geometries.&lt;/p&gt;</comment>
                            <comment id="1876649" author="rachita.bansal" created="Fri, 27 Apr 2018 20:31:55 +0000"  >&lt;p&gt;As another example, &lt;/p&gt;

&lt;p&gt;I&apos;m adding the query and results below.&lt;/p&gt;

&lt;p&gt;db.data.find({&quot;features.geometry&quot;:{ $geoWithin: {$box: [[ 179.37364283750003, 17.08804354613255 ], [ -17.76502903749997, 52.126584787009975 ]]}}})&lt;/p&gt;

&lt;p&gt;On the map, the bounding box returns something like below.&lt;br/&gt;
 &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;185183_thumb&quot; href=&quot;https://jira.mongodb.org/secure/attachment/185183/185183_Screen+Shot+2018-04-27+at+4.32.44+PM.png&quot; title=&quot;Screen Shot 2018-04-27 at 4.32.44 PM.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;185183&quot; file-preview-title=&quot;Screen Shot 2018-04-27 at 4.32.44 PM.png&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/thumbnail/185183/_thumb_185183.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt; &lt;/p&gt;

&lt;p&gt;There is around 7k geo points which lie inside the rectangular region but the query doesn&apos;t return any.&lt;/p&gt;

&lt;p&gt;An example geo point is as below,&lt;/p&gt;

&lt;p&gt;{ &quot;_id&quot; : ObjectId(&quot;5a629f84f1653d00012b9049&quot;), &quot;type&quot; : &quot;FeatureCollection&quot;, &quot;features&quot; : [ { &quot;type&quot; : &quot;Feature&quot;, &quot;geometry&quot; : &lt;/p&gt;
{ &quot;type&quot; : &quot;Point&quot;, &quot;coordinates&quot; : [ -75.46488889, 40.34077778 ] }
&lt;p&gt;, &quot;properties&quot; : &lt;/p&gt;
{ &quot;id&quot; : &quot;15844522&quot;, &quot;geoHash&quot; : &quot;dr4m6zb4h&quot; }
&lt;p&gt; } ] }&lt;/p&gt;

&lt;p&gt;Moving just a little bit to the east, the geo points are returned. &lt;br/&gt;
try the below-&lt;/p&gt;

&lt;p&gt;db.data.find({&quot;features.geometry&quot;:{ $geoWithin: {$box: [[ -179.6524151097331, 17.739545644708063 ], [ -16.791086984733056, 52.54379964085976 ]]}}})&lt;/p&gt;
</comment>
                            <comment id="1876454" author="asya" created="Fri, 27 Apr 2018 18:10:51 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rachita.bansal&quot; class=&quot;user-hover&quot; rel=&quot;rachita.bansal&quot;&gt;rachita.bansal&lt;/a&gt; you say that your bounding box represents lower left and upper right coordinates of the map of US.&lt;/p&gt;

&lt;p&gt;However, keep in mind that coordinates you used do not look like they are in the vicinity of the US.&lt;/p&gt;

&lt;p&gt;Very approximately, the coordinates of US are [-60.062125, 46.942589] (northeast) and [-124.046498, 24.556886] (southwest).&lt;/p&gt;

&lt;p&gt;Putting those coordinates in the query, your sample document will be returned:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.test.find({&quot;features.geometry&quot;:{ $geoWithin: {$box: [  [-60.062125, 46.942589], [-124.046498, 24.556886]  ]}}});&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{ &quot;_id&quot; : ObjectId(&quot;5a629f84f1653d00012b8fff&quot;), &quot;type&quot; : &quot;FeatureCollection&quot;, &quot;features&quot; : [ { &quot;type&quot; : &quot;Feature&quot;, &quot;geometry&quot; : { &quot;type&quot; : &quot;Point&quot;, &quot;coordinates&quot; : [ -88.24277778, 41.98166667 ] }, &quot;properties&quot; : { &quot;id&quot; : &quot;16107394&quot;, &quot;geoHash&quot; : &quot;dp3nzfx8f&quot; } } ] }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="1875531" author="rachita.bansal" created="Thu, 26 Apr 2018 20:28:24 +0000"  >&lt;p&gt;The bounding box represents lower left and upper right coordinates of the map of US. There should be more than 6k values inside of this but the query returned none.&lt;/p&gt;

&lt;p&gt;For example -&lt;br/&gt;
The value below should have been included in the response.&lt;/p&gt;

&lt;p&gt;{&lt;br/&gt;
	&quot;_id&quot; : ObjectId(&quot;5a629f84f1653d00012b8fff&quot;),&lt;br/&gt;
	&quot;type&quot; : &quot;FeatureCollection&quot;,&lt;br/&gt;
	&quot;features&quot; : [&lt;br/&gt;
		{&lt;br/&gt;
			&quot;type&quot; : &quot;Feature&quot;,&lt;br/&gt;
			&quot;geometry&quot; : &lt;/p&gt;
{
				&quot;type&quot; : &quot;Point&quot;,
				&quot;coordinates&quot; : [
					-88.24277778,
					41.98166667
				]
			}
&lt;p&gt;,&lt;br/&gt;
			&quot;properties&quot; : &lt;/p&gt;
{
				&quot;id&quot; : &quot;16107394&quot;,
				&quot;geoHash&quot; : &quot;dp3nzfx8f&quot;
			}
&lt;p&gt;		}&lt;br/&gt;
	]&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;Is there something I&apos;m doing wrong here?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="181268">SERVER-17092</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="185183" name="Screen Shot 2018-04-27 at 4.32.44 PM.png" size="402812" author="rachita.bansal" created="Fri, 27 Apr 2018 20:33:00 +0000"/>
                            <attachment id="185732" name="Screen Shot 2018-05-02 at 1.03.04 PM.png" size="467954" author="rachita.bansal" created="Wed, 2 May 2018 17:03:46 +0000"/>
                            <attachment id="185733" name="Screen Shot 2018-05-02 at 1.03.26 PM.png" size="480698" author="rachita.bansal" created="Wed, 2 May 2018 17:03:46 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 26 Apr 2018 19:59:02 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 41 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 41 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>rachita.bansal</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htwj6v:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htnlwn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htw5f3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>