[SERVER-14894] modify S2 debug log message about intersecting edges to use GeoJSON format Created: 14/Aug/14  Updated: 21/Aug/14  Resolved: 21/Aug/14

Status: Closed
Project: Core Server
Component/s: Geo, Logging
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Andrii Shpak Assignee: Thomas Rueckstiess
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-9751 Make S2 geometry library to use Mongo... Closed
depends on SERVER-14467 Capture S2 debug log messages Closed
Related
is related to SERVER-14729 Add log component to non-debug messages Closed
Participants:

 Description   

Modify s2 intersecting edges error message so that it can be easily checked on geojsonlint.com.

Existing format in logs at log level 5:

% buildscripts/smoke.py --set-parameters=logLevel=5  --mode=files jstests/core/geo_invalid_polygon.js
2014-08-13T11:15:42.317-0400 I          [initandlisten] MongoDB starting : pid=21518 port=27999 dbpath=/data/db/sconsTests/ 64-bit host=myhost.local
...
2014-08-13T11:16:01.090-0400 D S2       [conn3] Edges 0 and 2 cross
2014-08-13T11:16:01.090-0400 D S2       [conn3] Edge locations in degrees: -1.000000,-2.000000-1.000000,1.000000 and 1.000000,0.000000-0.000000,0.000000
2014-08-13T11:16:01.090-0400 D          [conn3] User Assertion: 16755:Can't extract geo keys from object, malformed geometry?: { _id: 42.0, geometry: { type: "Polygon", coordinates: [ [ [ 0.0, 0.0 ], [ 0.0, 1.0 ], [ 1.0, 1.0 ], [ -2.0, -1.0 ], [ 0.0, 0.0 ] ] ] } }
...
2014-08-13T11:16:01.169-0400 I STORAGE  [signalProcessingThread] shutdown: closing all files...
2014-08-13T11:16:01.169-0400 I STORAGE  [signalProcessingThread] closeAllFiles() finished

Proposed format is

{ "type": "MultiLineString", "coordinates": [edge1, edge2] }

 Comments   
Comment by Thomas Rueckstiess [ 21/Aug/14 ]

Hi Andrii,

After some deliberation we decided to not change the logging format in the way you proposed at this stage. These messages originate from the S2 library, and we would like to stay close to the original and not deviate too much from it. Additionally, it only requires minimal effort to convert the already logged information to be checked with GeoJSONLint.

Perhaps you can make your request against S2 directly (s2loop.cc), and if they accept your proposal we would be willing to look at cherry-picking the commit.

Regards,
Thomas

Comment by Benety Goh [ 21/Aug/14 ]

Andrii,

I've edited the description to include the sample logs I showed you in the pull request discussion.

I believe these are the log messages you were referring to. Could you please clarify how you would like the S2 log messages to be improved?

  • Replace the existing 2 lines.
  • Leave the existing lines along and introduce an additional log message with the geojsonlint.com-friendly format.

2014-08-13T11:16:01.090-0400 D S2       [conn3] Edges 0 and 2 cross
2014-08-13T11:16:01.090-0400 D S2       [conn3] Edge locations in degrees: -1.000000,-2.000000-1.000000,1.000000 and 1.000000,0.000000-0.000000,0.000000

S2 is a library external to MongoDB and we would like to avoid deviating too much from the source at https://code.google.com/p/s2-geometry-library/

Could you see if S2 will take this as an improvement? If it makes it into the S2 source, we would look into cherry-picking the change.

Regards,
Ben

Comment by Andrii Shpak [ 14/Aug/14 ]

Hello Thomas.

I mean modification of s2 error message for malformed geometry while trying to index GeoJSON shape that is written to log at S2Loop::IsValid().

This was discussed here:
https://github.com/mongodb/mongo/pull/430
And improved to be seen in regular mongo log here:
https://jira.mongodb.org/browse/SERVER-14467

Best wishes,
Andrii

Comment by Thomas Rueckstiess [ 14/Aug/14 ]

Hi Andrii,

Thanks for your improvement request. Could you provide a little more information?

What error messages would you like to see improved? Can you give an example?

Are you talking about errors resulting from a $geoIntersects operation?

Regards,
Thomas

Generated at Thu Feb 08 03:36:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.