These queries are for databases that have been '''upgraded''' to 6.0 and during upgrade process for which distance and bearing was '''not''' fixedduring the upgrade process. This '''[[Check coordinates distance and bearing | page]]'' contains checks to be run '''before and after'' upgrade to 6.0.
==Which database columns should have values / How it should look like==
Depending on which coordinate system is used, different combination of values are used possible in these columns:
* coordformat
* userinputformat
Depending on if whether absolute or relative coordinates are used, different combination of values are used possible in these columns:
* user_entered_x
* user_entered_y
* user_entered_mgrs
{{Note | longitude Longitude and latitude Latitude are the '''storage''' coordinates which are used for e.g. the sandbox / rendering in the Map Pane.}}
[[Image:DistBear Correct.png|900px|center]]
'' How should look like ''
</div>
==Case 1 : Coordinates migrated from Legacy with Distance and bearing Bearing as extra information==This worked well with 5.x but especially xml export/import does not work well with 6.0especially for xml export/import. Extra information refers to the fact that the points are defined as an absolute point plus has points but also have distance and bearing information . but does they do '''not''' have FromPointGUID.
This case has to can be fixed separated in two stepssub cases:# point 1 of the polygon is referring to a single point i.e. not to any point that is part of the polygon(case 1A)# point 1 of the polygon is the absolute point(case 1B)
=== Case 1A===
{{Note | These rows need to get ''FromPointGUID'' populated '''and''' ''userinputformat'' updated. NAA has UPDATE queries.}}
==Case 2 : Coordinates entered with 5.x and upgraded to 6.0==
[[Image:DistBear Case2 wrong.png|800px|center]]
<div align="center">
{{Note | These rows need to get user_entered_x and user_entered_y or user_entered_mgrs populated. NAA has UPDATE queries.}}
==Case 3 : Colombia=={{Warning | New(?) variation of Case 1 which we are currently investigating. We need better knowledge on how did the problem occurred did occur before fixing a few records.}}
==Case 4 : Miscellaneous odd issues that need to be corrected==
These errors may have been caused by
* user mistakes
* user updating DEFs with ''Replace'' action when Point1 of the polygon was referring to a single point.
=== Case 4A : One/few points of a polygon are missing frompoint_guid and user_entered===<div align="center">'' How to see if Case 4A exists? It is not possible to open Geospatial tab in the Summary window and the DEF looks like this: ''
[[Image:DistBear Case4A wrong.png|600px|center]]
<div align="center">
'' How to see if Case 4A exists: It is not possible to open Geospatial tab in the Summary window and the DEF looks like this ''
</div>
Run this query (''DistBear Check user_entered2'') to check if you have any points that fall under Case 4A. This query is '''NOT''' tested with MGRS.
{{Note | These rows need to get user_entered_x and user_entered_y or user_entered_mgrs '''and''' frompoint_guid populated. NAA has UPDATE queries which may be applied to some of the above records but it might be necessary to change to absolute coordinates for a few cases.}}
=== Case 4B : Distance = 0===
To have Distance = 0 may cause calculation errors. Run this query (''DistBear Check dist 0'') to check if you have any points that fall under Case 4B. This query is '''NOT''' tested with MGRS.
<pre>
{{Note | These rows need to be investigated manually but most likely both distance and bearing should be deleted. Most likely they also have length(frompoint_guid) <nowiki>= 0</nowiki> too. NAA has UPDATE queries.}}
=== Case 4C : length(frompoint_guid) = 0===
[[Image:DistBear Case4C wrong.png|800px|center]]
<div align="center">
{{Note | These rows need to be investigated manually. NAA has UPDATE queries.}}
=== Case 4D : One of Distance / Bearing is null===
Run this query (''DistBear Check bear dist NULL'') to check if you have any points that fall under Case 4D. This query is '''NOT''' tested with MGRS.
<pre>
{{Note | These rows need to be investigated and updated manually. }}