SHARE
TWEET

Untitled

a guest Nov 14th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. shp2pgsql -c -d -D -W LATIN1 -s 4269 -I 'path/to/shapefile.shp' my_table | psql -d mydb
  2.    
  3. SELECT ST_AsText(geom) FROM my_table LIMIT 1;
  4.    
  5. "MULTIPOLYGON(((-9619467.85573143 3856511.77685212,-9619466.74264784 3854145.2378255,-9619466.73474416 3854144.27900372 (...)"
  6.    
  7. "MULTIPOLYGON(((-123.1 45.1,-123.2 45.2, -123.3 45.3 (...)"
  8.    
  9. GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS
  10. 84",6378137,298.257223563,AUTHORITY["EPSG",
  11. "7030"]],AUTHORITY["EPSG","6326"]],PRIMEM
  12. ["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT
  13. ["degree",0.0174532925199433,AUTHORITY["EPSG",
  14. "9122"]],AUTHORITY["EPSG","4326"]]
  15.    
  16. shp2pgsql -c -d -D -W LATIN1 -s 3857 -I 'path/to/shapefile.shp' my_table | psql -d mydb
  17.    
  18. ALTER TABLE my_table
  19.   ALTER COLUMN geom TYPE Geometry(Point,4326)
  20.   USING ST_Transform(geom, 4326);
RAW Paste Data
Top