Skip to content

Instantly share code, notes, and snippets.

@cindygis
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cindygis/45d04f91816c546afe34 to your computer and use it in GitHub Desktop.
Save cindygis/45d04f91816c546afe34 to your computer and use it in GitHub Desktop.
Spatially enables a table in SQL that contains valid coordinates, to create a spatial view for use in ArcMap.
SELECT GIS_ID, GEOMETRY::STPointFromText('POINT(' + CONVERT(varchar(50), Longitude) + ' ' + CONVERT(varchar(50), Latitude) + ' )', 4326) AS Location
FROM tbl_random
WHERE Longitude > 0 # Checks if there are valid coordinates for Eastern Hemisphere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment