Ask Geographic Information System (GIS)

Create point geometry in PostGIS from a X Y Z M coordinate format

I would like to get a PostGIS point table from a PostGreSQL table containing OpenDataKit data where the coordinates are contained into in a column in a X Y Z M format (M being I think the value of the GPS precision in meters). E.g:

10.384643333333335 -23.214940000000002 -0.8 5.0

My first question is: what should be the column type for my coordinates_column with such coordinates format? Just text?

Otherwise I try creating the geometry this way:

INSERT INTO schema.posgistable SELECT _id,column1,column2,...,ST_MakePoint(coordinates_column) as geom FROM schema.postgresql_odk_table

as ST_MakePoint seems to be the one able to retrieve X Y Z M data (but separated by ,)
but I got this error message:

ERROR:  parse error - invalid geometry

Any clue?

Leave a Reply

Your email address will not be published. Required fields are marked *