I have a csv file that I want to bring into a PostGIS database through DB Manager in QGIS. I have a column/ field called "Location" that contains geometry (e.g. (40.789423 -75.628493 232.95452117919922 5). The first two are lon/lat, the second is altitude and third is error for the GPS unit it was collected with. I ONLY need the first two pieces of data (i.e. lon/lat).
When I pull this data into PostGIS database with DB Manager, it will not recognize this column as geometry, but identifies it as TEXT (varchar). I would like to change this, but am having trouble. I prefer to use a GUI, but it will not convert. I am trying to figure out the correct SQL code to do this. Here's my most recent attempt:
ALTER TABLE "schema"."table" ALTER "Location" TYPE geometry USING ("Location"::geometry)
However, this returns the following error message:
parse error - invalid geometry HINT: "40.789423 " <-- parse error at position 10 within geometry
I believe that this is because there is an extra space after the "40.78923". Does this seem correct? If so, how do I fix this?