Geographic Information Systems Asked by Hannah Boring on October 5, 2021
I’m somewhat of a GIS novice and am trying to see if this is possible to save me some time with further investigating. I have about 300 records in a CSV file with the fields SPC Zone, ECOORD, NCOORD, CRDUNITS, and a point identifier.
I was wondering if there is any possible way to batch convert these points (all with differing SPC Zones) to lat long in QGIS or some other application?
Here's a partial solution, and I think there might be a bug, but here goes.
Given a CSV that looks like this:
You can load the CSV into QGIS and use the DB Manager Query window to perform SQLite / sql spatial functions on your data.
select
c.*
, make_point(c.x, c.y) as geom
from libraries_denver_csv as c
This basically turns the two coordinate values into a geometry object that can be drawn on the map:
Now what I thought would be possible would be to simply apply the ST_Transform / Transform function on that constructed geometry and use the value in the spc_zone column to serve as the SRID integer for that transformation.
However, I keep getting a NULL response, and can't figure out why - perhaps this doesn't exactly work in SQLite - and if anyone can add some info, I would appreciate it (as this question came up this morning on a local GIS forum as well):
select
c.*
, make_point(c.x, c.y) as geom
--test with value from spc_zone column
, Transform((make_point(c.x, c.y)), cast(spc_zone as integer)) as geom_transform
--test with single known SRID value to apply for all records
, Transform((make_point(c.x, c.y)), 3857) as geom_transform
from libraries_denver_csv as c
But unfortunately this consistently yields a NULL response:
Does anyone know why that might be happening?
Answered by DPSSpatial_BoycottingGISSE on October 5, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP