Summary
For feature classes or tables with longitude and latitude columns that are regularly updated, a point query layer can be created that automatically reflects the new points.
Procedure
- Right-click on Databases in the Catalog in ArcGIS Pro, and click New Database Connection (Database or Enterprise geodatabase).
- Create/Make a database connection.
- Create/add the feature class/table from the database to the map that has the Latitude and Longitude fields.
- Add an Integer based Unique ID field (ID) that has sequential numbering and functions as the Object ID for the query.
- Click the Map tab, and click Add Data > Query Layer.
- Paste the below SQL query:
SELECT v.ID AS OBJECTID,
geometry::STGeomFromText(
'POINT(' + CONVERT(varchar(50), CAST(v.[Longitude] AS float)) + ' ' + CONVERT(varchar(50), CAST(v.Latitude AS float)) + ')',
4326
) AS Shape
FROM dbo.point v
WHERE v.Latitude IS NOT NULL
AND v.[Longitude] IS NOT NULL
- Click Validate.
- When prompted for a unique ID, pick OBJECTID.
- A point query layer would be generated that dynamically updates the new points on the map.
- The query layer can be exported to a feature class/table by right clicking on the query layer in the Contents > Data > Export Features/Export Table.
