Advertisement
Guest User

Untitled

a guest
Apr 24th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. $conn = pg_connect("host=localhost dbname=postgis user=$user password=$password");
  2.  
  3. $sql = "INSERT INTO carto_doodle (poly_geom) VALUES
  4. (ST_SetSRID
  5. (ST_GeomFromGeoJSON
  6. ({"type":"Feature",
  7. "properties":{},
  8. "geometry":{"type":"Polygon",
  9. "coordinates":
  10. [[[-74.54635620117188,40.773261878622634],
  11. [-74.69741821289062,40.61082491956405],
  12. [-74.30740356445312,40.61603737424185],
  13. [-74.54635620117188,40.773261878622634]]]
  14. }
  15. })
  16. ),
  17. 4326)"
  18.  
  19. $success = pg_query($conn, $sql);
  20.  
  21. Warning: pg_query(): Query failed: ERROR: syntax error at or near "{" LINE 1: ...(poly_geom) VALUES (ST_SetSRID(ST_GeomFromGeoJSON({"type":"F... ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement