MGRS coordinates: Difference between revisions

From IMSMA Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
The first query finds MGRS coordinates with the incorrect format of type 4qfj12345678 and the second query finds MGRS coordinates with blanks 4 QFJ 1234 5678.
This query finds MGRS coordinates with the incorrect format of type '''4qfj12345678'''.


<pre>
<pre>
Line 11: Line 11:
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)
 
</pre>
Note: This query is in 5.x format
Note: This query is in 5.x format


---------------------------------------------------
This query finds MGRS coordinates with blanks '''4 QFJ 1234 5678'''.


<pre>
SELECT
SELECT
userenteredcoord
userenteredcoord

Revision as of 11:05, 12 February 2014

This query finds MGRS coordinates with the incorrect format of type 4qfj12345678.

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

This query finds MGRS coordinates with blanks 4 QFJ 1234 5678.

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

Note: This query is in 5.x format