<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:29:24 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-52928] Cannot insert GeoJSON polygon with colinear edges</title>
                <link>https://jira.mongodb.org/browse/SERVER-52928</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Inserting what seems like a perfectly valid CCW polygon (checked in QGIS, geojsonlint.com, geojson.io) results in this error:&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;   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;MongoError: Can&apos;t extract geo keys: \{ _id: ObjectId(&apos;5fb4fbe26a989905900a0f90&apos;), geom: { type: &quot;Polygon&quot;, coordinates: [ [ [ -157.515, 4.937 ], [ -142.529, -89.999 ], [ -142.529, -43.676 ], [ -12.529, -42.767 ], [ -142.529, -6.001 ], [ -142.529, 50.047 ], [ -157.515, 4.937 ] ] ] } } Loop is not valid: [ [ 157.515, 4.937 ], [ -142.529, -89.999 ], [ -142.529, -43.676 ], [ -12-.-529, -42.767 ], [ -142.529, -6.001 ], [ -142.529, 50.047 ], [ -157.515, 4.937 ] ] *Edges 1 and 4 cross. Edge locations in degrees: [-142.5290000, -89.9990000]**[-142.5290000, -43.6760000] and [-142.5290000, -6.0010000]-[-142.5290000, 50.0470000]*&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;But those two offending collinear edges are not even touching.&lt;/p&gt;

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

&lt;p&gt;I guess it boils down to this line in the S2 library:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/third_party/s2/s2loop.cc#L148&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/master/src/third_party/s2/s2loop.cc#L148&lt;/a&gt;&lt;br/&gt;
 &#160;&lt;/p&gt;</description>
                <environment>standalone server 3.2, Atlas 4.2.10</environment>
        <key id="1545010">SERVER-52928</key>
            <summary>Cannot insert GeoJSON polygon with colinear edges</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="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-query-integration">Backlog - Query Integration</assignee>
                                    <reporter username="ales.pecha@email.cz">Ales Pecha</reporter>
                        <labels>
                            <label>qi-geo</label>
                    </labels>
                <created>Wed, 18 Nov 2020 11:09:15 +0000</created>
                <updated>Wed, 27 Dec 2023 16:24:29 +0000</updated>
                                            <version>3.2.22</version>
                    <version>4.2.10</version>
                                                    <component>Geo</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="3650329" author="kyle.suarez" created="Fri, 5 Mar 2021 21:52:46 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ales.pecha%40email.cz&quot; class=&quot;user-hover&quot; rel=&quot;ales.pecha@email.cz&quot;&gt;ales.pecha@email.cz&lt;/a&gt;, &lt;/p&gt;

&lt;p&gt;Thank you for reporting this issue and for your patience during our investigation. We&apos;ve looked into upgrading MongoDB&apos;s version of S2 and have determined that we will require more dedicated engineering time to pursue this upgrade. Furthermore, the latest version of s2loop.cc and MongoDB&apos;s version are exactly the same, so an upgrade is unlikely to resolve the issue with precision.&lt;/p&gt;

&lt;p&gt;We&apos;ve placed this ticket on our backlog and you may continue watching this for updates.&lt;/p&gt;

&lt;p&gt;Kind regards,&lt;br/&gt;
Kyle&lt;/p&gt;</comment>
                            <comment id="3504334" author="JIRAUSER1257066" created="Tue, 24 Nov 2020 21:02:20 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ales.pecha%40email.cz&quot; class=&quot;user-hover&quot; rel=&quot;ales.pecha@email.cz&quot;&gt;ales.pecha@email.cz&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thanks a lot for your help investigating the issue. I&apos;m able to reproduce your issue for MongoDB 4.4.2 on various Linux distros and confirm that it&apos;s a bug. It appears on Debian 10, Ubuntu 16.04, and Atlas clusters.&lt;/p&gt;

&lt;p&gt;Best,&lt;/p&gt;

&lt;p&gt;Edwin&lt;/p&gt;</comment>
                            <comment id="3504183" author="JIRAUSER1257677" created="Tue, 24 Nov 2020 19:22:42 +0000"  >&lt;p&gt;Edwin,&lt;/p&gt;

&lt;p&gt;I also tried to track down what I guess might be the source of the problem and found a C# port of the S2 library with comments concerning our issue:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;// WORKAROUND(shakusa, ericv): S2.robustCCW() currently&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;// requires arbitrary-precision arithmetic to be truly robust. That&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;// means it can give the wrong answers in cases where we are trying&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;// to determine edge intersections. &lt;b&gt;The workaround is to ignore&lt;/b&gt;&lt;/em&gt;&lt;br/&gt;
&lt;b&gt;&lt;em&gt;// intersections between edge pairs where all four points are&lt;/em&gt;&lt;/b&gt;&lt;br/&gt;
&lt;b&gt;&lt;em&gt;// nearly colinear.&lt;/em&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/novotnyllc/s2-geometry-library-csharp/blob/master/S2Geometry/S2Loop.cs#L263&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/novotnyllc/s2-geometry-library-csharp/blob/master/S2Geometry/S2Loop.cs#L263&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;d say the code to mitigate the issue is missing in your fork of the S2 library as you probably had forked the S2 library before this change.&lt;/p&gt;

&lt;p&gt;What do you think?&lt;/p&gt;

&lt;p&gt;Best regards,&lt;br/&gt;
Ales&lt;/p&gt;</comment>
                            <comment id="3504122" author="JIRAUSER1257677" created="Tue, 24 Nov 2020 18:52:55 +0000"  >&lt;p&gt;Edwin, many thanks for looking into this. We first encountered the problem on a standalone MongoDB 3.2 running on - I guess - Debian Buster (I&apos;ll add detailed version info later). We then tried it on an Atlas instance, just to verify if it is a 3.2 specific problem or not. I haven&apos;t been aware that the standalone and Atlas codebases differ though.&lt;/p&gt;

&lt;p&gt;Thanks for pointing me to your tool for geojson data visualisation. In our case the offending lines are colinear with meridians (it&apos;s timezones dataset), so it shouldn&apos;t make a difference I hope.&lt;/p&gt;

&lt;p&gt;I can confirm the issue is quite sensitive to the coordinate precision, however it is not very easy for us to identify and tweak every offending line (there are many) in our workflow (the source data is in ESRI&apos;s FileGDB).&lt;/p&gt;

&lt;p&gt;Best regards,&lt;br/&gt;
Ales&lt;/p&gt;</comment>
                            <comment id="3503930" author="JIRAUSER1257066" created="Tue, 24 Nov 2020 17:23:18 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ales.pecha%40email.cz&quot; class=&quot;user-hover&quot; rel=&quot;ales.pecha@email.cz&quot;&gt;ales.pecha@email.cz&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Upon further investigation, it looks to be a rounding issue. We changed the coordinates &lt;span class=&quot;error&quot;&gt;&amp;#91;-142.529, -89.999&amp;#93;&lt;/span&gt; to &lt;span class=&quot;error&quot;&gt;&amp;#91;-142.529, -89.998&amp;#93;&lt;/span&gt; and found that it successfully inserts on Atlas.&#160;&lt;/p&gt;

&lt;p&gt;What operating system are you inserting this document when you perform it on the standalone server?&lt;/p&gt;

&lt;p&gt;Edwin&lt;/p&gt;</comment>
                            <comment id="3500487" author="JIRAUSER1257066" created="Fri, 20 Nov 2020 19:56:50 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ales.pecha%40email.cz&quot; class=&quot;user-hover&quot; rel=&quot;ales.pecha@email.cz&quot;&gt;ales.pecha@email.cz&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thanks for your submission. This looks to be an Atlas issue. I was able to reproduce your issue in Atlas, but not on a local 3.2 and 4.2 mongod instance, where I successfully inserted the document. I can pass your bug report over to the Atlas team.&lt;/p&gt;

&lt;p&gt;I also recommend against using geojsonlint.com and geojson.io for displaying your coordinates as those websites attempt to map orthogonal cartesian coordinates on a spherical shape. I recommend using&#160;&lt;a href=&quot;https://geodndmap.mongodb.com/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://geodndmap.mongodb.com&lt;/a&gt;, opening up devtools, and running&#160;&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;   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;loadGeoJson({ &quot;type&quot;: &quot;Polygon&quot;, &quot;coordinates&quot;: [ [ [ -157.515, 4.937 ], [ -142.529, -89.999 ], [ -142.529, -43.676 ], [ -12.529, -42.767 ], [ -142.529, -6.001 ], [ -142.529, 50.047 ], [ -157.515, 4.937 ] ] ] })&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;Here&apos;s how the plotted coordinates should look:&lt;br/&gt;
 &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/288581/288581_Screen+Shot+2020-11-20+at+3.28.45+PM.png&quot; width=&quot;50%&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;

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

&lt;p&gt;Kind regards,&lt;br/&gt;
 Edwin&lt;br/&gt;
 &#160;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2300075">SERVER-75393</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="288581" name="Screen Shot 2020-11-20 at 3.28.45 PM.png" size="142685" author="edwin.zhou@mongodb.com" created="Tue, 24 Nov 2020 14:39:43 +0000"/>
                            <attachment id="287702" name="mongodb-polygon-error.PNG" size="40750" author="ales.pecha@email.cz" created="Wed, 18 Nov 2020 11:03:31 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25467"><![CDATA[Query Integration]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 20 Nov 2020 19:56:50 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 48 weeks, 5 days 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>ted.tuckman@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 48 weeks, 5 days 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>ales.pecha@email.cz</customfieldvalue>
            <customfieldvalue>backlog-query-integration</customfieldvalue>
            <customfieldvalue>edwin.zhou@mongodb.com</customfieldvalue>
            <customfieldvalue>kyle.suarez@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hyhv73:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr2c53:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="4459">Query 2021-01-11</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;db.data.createIndex(&lt;/p&gt;
{ &quot;geom&quot;: &quot;2dsphere&quot; }
&lt;p&gt;, &lt;/p&gt;
{ &quot;2dsphereIndexVersion&quot;: 3 }
&lt;p&gt;);&lt;/p&gt;

&lt;p&gt;db.data.insertOne({&lt;br/&gt;
    geom: &lt;/p&gt;
{
        &quot;type&quot;: &quot;Polygon&quot;,
        &quot;coordinates&quot;: [
            [ 
                [ -157.515, 4.937 ], 
                [ -142.529, -89.999 ], [ -142.529, -43.676 ], 
                [ -12.529, -42.767 ],
                [ -142.529, -6.001 ], [ -142.529, 50.047 ], 
                [ -157.515, 4.937 ]
            ]
        ] 
    }
&lt;p&gt;});&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                    <customfieldvalue><![CDATA[edwin.zhou@mongodb.com]]></customfieldvalue>
    

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

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