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.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Dec 11, 2015 at 18:35

1 Answer 1

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);
answered Dec 12, 2015 at 11:47

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.