Changes

Check coordinates distance and bearing 6.0

1,854 bytes added, 14:05, 9 October 2016
no edit summary
This queries are for database databases that has been '''upgraded ''' to 6.0 and during upgrade process distance and bearing was '''not''' fixed.
==Case 1 Coordinates migrated from Legacy with Distance and bearing as extra information==__NOEDITSECTION__
</pre>
=== Case 1B===__NOEDITSECTION__
Run this query (''DistBear Missing FromPoint Point2'') to check if you have any points that falls under Case 1A
<pre>
SELECT
"public".geopoint.geopoint_guid,
"public".geopoint.longitude,
"public".geopoint.latitude,
"public".geopoint.bearing,
"public".geopoint.distance,
"public".geopoint.frompoint_guid,
"public".geopoint.user_entered_x,
"public".geopoint.user_entered_y,
"public".geopoint.pointno,
"public".geopoint.userinputformat,
"public".geopoint.coordformat,
"public".geopoint.coordrefsys,
"public".imsmaenum.enumvalue,
"public".geopoint.pointlocal_id
FROM
"public".geopoint
INNER JOIN "public".geospatialinfo ON "public".geospatialinfo.geospatialinfo_guid = "public".geopoint.geospatialinfo_guid
INNER JOIN "public".imsmaenum ON "public".imsmaenum.imsmaenum_guid = "public".geospatialinfo.shapeenum_guid
WHERE
("public".geopoint.distance IS NOT NULL AND
"public".geopoint.bearing IS NOT NULL) AND
("public".geopoint.frompoint_guid IS NULL OR length("public".geopoint.frompoint_guid) = 0) AND
"public".geopoint.user_entered_x IS NOT NULL AND
"public".geopoint.user_entered_y IS NOT NULL AND
"public".geopoint.pointno <> 1 AND
"public".imsmaenum.enumvalue LIKE 'Poly%'
ORDER BY
"public".geopoint.geospatialinfo_guid ASC,
"public".geopoint.pointno ASC
</pre>
 
{{Note | These rows needs to get ''FromPointGUID'' populated '''and''' ''userinputformat'' updated. NAA has UPDATE queries.}}
 
==Case 2 Coordinates entered with 5.x and upgraded to 6.0==__NOEDITSECTION__
These records have been entered into the database with 5.x and upgraded to 6.0 by the upgrade functionality provided by Novetta. But the upgrade funtionality does '''not''' set geopoint.user_entered_x and geopoint.user_entered_y or user_entered_mgrs for records with '''Bearing and Distance''' as userinputformat. This causes problems with 6.0.
{{NavBox Hub}}
[[Category:NoPublic]]
[[Category:SQL Queries]]
[[Category:NAA]]
6,632
edits