I am importing a table having no spatial columns from SQL Server 2008R2 database into QGIS 2.10.1. The table has latitude & longitude values. How can I create point features using the latitude, longitude data in the table in QGIS?
CSV import is one way but can I do it without CSV import directly from imported data?
[GIS] QGIS : Creating point feature from Lat, Lon SQL Server 2008R2 data import
qgis
Best Answer
Edit: QGIS only way , without CSV
In QGIS, import table from DB, select Processing Toolbox, Qgis Geoalgorithms -> Vector Creation Tools ->points layer from table -> select x and y
MS SQL Server way
one easy way is to create view in SQL where you add computed column. something like this STGeomFromText('POINT(' +x +' ' +y+')')
For xy point use
Simple WKT for POINT is 'POINT(1 2)'
convert code is there to convert float to decimal and then to text
That will create table with geometry text column , row_number() creates unique row number.
Creates view which has geometry in your srid (4326? in your case?)