1

I have been using QGIS to insert point data accompanied by information for each point into PostGIS. When I open PGAdmin to take a look at the table rows I noticed a column near the start of each row called "geom" which is obviously point geometry with I believe a SRID of 4326.

Now my main questions are:

  1. Does QGIS add this to the database or is this something that PostGIS adds automatically.
  2. I'm going to be using a form which calls upon PHP to insert values into this databse table. Do I need to figure out the geometry or will PostGIS handle this for me?

I have looked at alot of information about SRID but a good bit of it is over my head.

2

I depends on how you create or add the table to the database. If you upload your table to the database through any tools like shp2pgsql or QGIS a geometry column is made for your to store the spatial data in.

You will need to manually create the geometry when inserting to the database.

INSERT INTO mytable(mycol1, mycol2, geom)
VALUES(1, 2, ST_GeomFromText('POINT(11.1 55.3)', 4326));

If you have long lat columns that you insert to, you can create the geometry after your long lat insert like:

ST_SetSRID(ST_MakePoint(long, lat), 4326);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.