Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

This question already has an answer here:

I did accidently delete a table row - or well, in fact a whole subway station.

My attempt to solve the problem was this PostGIS function:

ST_GeomFromText('POINT(coordinates)')

But then PostgreSQL started to complain about some SRID connection with the spatial_ref_sys table. What did I do wrong? Is it possible to add this through QGIS instead?

share|improve this question
    
add comment

marked as duplicate by underdark Mar 30 '13 at 13:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

up vote 1 down vote accepted

Try INSERT INTO and use SRID parameter for the geometry

INSERT INTO your_table
col-1-value,...,col-n-value, (SELECT ST_GeomFromText('POINT(coordinates)', SRID))

where SRID is an id of your spatial reference system (4326 for example).

Also it is possible to add needed points using QGIS. Check corresponding section of QGIS manual.

share|improve this answer
    
How do I know what SRID to use? –  Ivar Mar 30 '13 at 14:35
2  
@Ivar, look in geometry_columns table. –  SS_Rebelious Mar 30 '13 at 14:41
    
Ah, there it is! Works. Thanks alot. :-) –  Ivar Mar 30 '13 at 14:48
add comment

Try using

ST_SetSRID(ST_GeomFromText('POINT(coordinates)'),4326)

instead. Replace 4326 with the correct code as necessary.

share|improve this answer
add comment

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