1

I try to reproject a layer in PosGIS using statement:

UPDATE <table> SET geom=ST_Transform(geom, 3857);

leading to error message:

ERROR: transform: couldn't project point (574415 6.22508e+006 0): latitude or longitude exceeded limits (-14) SQL state: XX000

I thought the first number in the error message corresponds with the id (line number) in the table, but when I retrieve ST_X and ST_Y from that point then the coordinates do not correspond to the second and third number in the error message.

The projection so far is 4326 and a visual control in ArcMap doesn't show any unexpected points.

Can you tell me on how to read the error message and to overcome the issue?

  • I would expect a CREATE TABLE foo AS SELECT ...,ST_Transform (...) geom in order to project an existing table without corruping metadata. – Vince Jul 3 '15 at 11:10
  • I copied the table just one step before trying to transform the geometry... would rather not create another table. Correct me if I am wrong, but the error comes from ST_Transform and in your statement the same problem can be expected!? – Thomas Becker Jul 3 '15 at 11:50
  • The error likely comes from trying to change the geometry SRID in situ (can't have multiple SRIDs in the same table). Your procedure is very risky. You need a different table. – Vince Jul 3 '15 at 12:47
  • Do you have the srid set for the table. What is in geometry_columns. If you have a mixture of SRIDs, then you can run the above query but add a WHERE ST_SRID(geom) = 4326, which will only reproject those that are lat/lon. – John Powell Jul 3 '15 at 14:18
  • 1
    You incorrectly loaded the data initially, so you have geometries that think their SRID is 4326 when actually they seem to be in some kind of UTM projection (judging by the coordinates). You'll have to go back and reload the data first. – Paul Ramsey Jul 3 '15 at 18:02

Your Answer

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

Browse other questions tagged or ask your own question.