Changes

Check coordinates distance and bearing 6.0

3,162 bytes added, 13:54, 9 October 2016
no edit summary
These errors may have been caused by
* user mistakes
* import* SQL update of the database* user updating DEFs with ''Replace'' action when Point1 of the polygon was referring to a single point* what-ever.
=== Case 4A One/few points of a polygon are missing frompoint_guid and user_entered===
Run this query (''DistBear Check user_entered1user_entered2'') to check if you have any points that falls under Case 24A. This query is '''NOT''' tested with MGRS.
<pre>
SELECT
{{Note | These rows needs 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 there 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 falls under Case 4B. This query is '''NOT''' tested with MGRS.
<pre>
SELECT
"public".geopoint.geopoint_guid,
"public".geopoint.geospatialinfo_guid,
"public".geopoint.coordformat,
"public".geopoint.longitude,
"public".geopoint.latitude,
"public".geopoint.bearing,
"public".geopoint.distance,
"public".geopoint.frompoint_guid,
"public".geopoint.userinputformat,
"public".geopoint.coordrefsys,
"public".geopoint.user_entered_x,
"public".geopoint.user_entered_y,
"public".geopoint.user_entered_mgrs,
"public".imsmaenum.enumvalue
FROM
"public".geopoint
INNER JOIN "public".imsmaenum ON "public".geopoint.pointtypeenum_guid = "public".imsmaenum.imsmaenum_guid
WHERE
"public".geopoint.distance = 0
</pre>
 
{{Note | These rows needs to be investigated manually but most likely both distance and bearing should be deleted. Most like they also have length(frompoint_guid) = 0 too. NAA has UPDATE queries.}}
 
=== Case 4C length(frompoint_guid) = 0===
These records are likely to be the same as found for Case 4B and could as well be orphans.
Run this query (''DistBear Check length FromPointGUID'') to check if you have any points that falls under Case 4C. This query is '''NOT''' tested with MGRS.
<pre>
SELECT
"public".geopoint.geopoint_guid,
"public".geopoint.geospatialinfo_guid,
"public".geopoint.coordformat,
"public".geopoint.longitude,
"public".geopoint.latitude,
"public".geopoint.bearing,
"public".geopoint.distance,
"public".geopoint.frompoint_guid,
"public".geopoint.userinputformat,
"public".geopoint.coordrefsys,
"public".geopoint.user_entered_x,
"public".geopoint.user_entered_y,
"public".geopoint.user_entered_mgrs,
"public".imsmaenum.enumvalue,
"public".geopoint.pointlocal_id,
"public".geopoint.pointno,
"public".geopoint.pointdescription,
"public".geopoint.pointtypeenum_guid,
"public".geopoint.fixedby_guid,
"public".geopoint.frompointinput,
"public".geopoint.dataentrydate,
"public".geopoint.dataenterer
FROM
"public".geopoint
INNER JOIN "public".imsmaenum ON "public".geopoint.pointtypeenum_guid = "public".imsmaenum.imsmaenum_guid
WHERE
length(frompoint_guid) = 0
</pre>
 
{{Note | These rows needs 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 falls under Case 4D. This query is '''NOT''' tested with MGRS.
<pre>
SELECT
"public".geopoint.geopoint_guid,
"public".geopoint.geospatialinfo_guid,
"public".geopoint.longitude,
"public".geopoint.latitude,
"public".geopoint.bearing,
"public".geopoint.distance,
"public".geopoint.userinputformat,
"public".geopoint.user_entered_x,
"public".geopoint.user_entered_y,
"public".geopoint.user_entered_mgrs
FROM
"public".geopoint
WHERE
("public".geopoint.bearing IS NULL AND "public".geopoint.distance IS NOT NULL) OR
("public".geopoint.bearing IS NOT NULL AND "public".geopoint.distance IS NULL)
</pre>
 
{{Note | These rows needs to be investigated and updated manually. }}
 
 
{{NavBox Hub}}
[[Category:NoPublic]]
[[Category:SQL Queries]]
[[Category:NAA]]
6,632
edits