2

I have the datatype geometry defined. But I can't set it to one of the columns geom. as shown in the figure.

enter image description here

Vince
  • 20,017
  • 15
  • 45
  • 64
Andre Ahmed
  • 149
  • 1
  • 1
  • 6

1 Answers1

9

First you need to create postgis extension to add spatial functions such as distance, area, union, intersection, and specialty geometry data types to the database.

create extension postgis;

Then alter geometry column of your table, in your case geom column using this SQL query.

ALTER TABLE poi
ALTER COLUMN geom
TYPE GEOMETRY(POINT,4326);

You can set your own projection, i assume your projection is Geographic Coordinate System (GCS WGS84)

Update:

If you want to store altitude with xy, you need to use POINTZ instead of POINT.

 TYPE GEOMETRY(POINTZ,4326);

Read this for further information.

Shahzad Bacha
  • 1,596
  • 1
  • 14
  • 23