MGRS coordinates: Difference between revisions

From IMSMA Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 10: Line 10:
locate('|', geopoint.userenteredcoord) -1) <> upper(left(geopoint.userenteredcoord, locate('|', geopoint.userenteredcoord) -1))
locate('|', geopoint.userenteredcoord) -1) <> upper(left(geopoint.userenteredcoord, locate('|', geopoint.userenteredcoord) -1))
ORDER BY length(geopoint.userenteredcoord)
ORDER BY length(geopoint.userenteredcoord)
Note: This query is in 5.x format


---------------------------------------------------
---------------------------------------------------
Line 20: Line 22:
ORDER BY
ORDER BY
user_entered_mgrs ASC
user_entered_mgrs ASC
Note: This query is in 5.x format
</pre>
</pre>
[[Category:NoPublic]]
[[Category:NoPublic]]

Revision as of 16:53, 11 February 2014

These two queries finds MGRS coordinates where the format is incorrect

SELECT geopoint.userenteredcoord, 
concat( upper(left(geopoint.userenteredcoord, locate('|', geopoint.userenteredcoord) -1)),right(geopoint.userenteredcoord,7))
FROM
geopoint
WHERE
geopoint.coordrefsys =  'MGRS' AND 
binary left(geopoint.userenteredcoord, 
locate('|', geopoint.userenteredcoord) -1) <> upper(left(geopoint.userenteredcoord, locate('|', geopoint.userenteredcoord) -1))
ORDER BY length(geopoint.userenteredcoord)

Note: This query is in 5.x format

---------------------------------------------------
SELECT
user_entered_mgrs
FROM
geopoint
WHERE
coordrefsys =  'MGRS' AND user_entered_mgrs LIKE '% %'
ORDER BY
user_entered_mgrs ASC

Note: This query is in 5.x format