Advertisement
Guest User

Untitled

a guest
Mar 21st, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. --cleanup
  2. DROP TABLE IF EXISTS polygon;
  3. DROP TABLE IF EXISTS test1;
  4. DROP TABLE IF EXISTS test2;
  5.  
  6. --create single polygonz
  7. SELECT
  8. ST_GeomFromText('POLYGON Z ((0.0 0.0 0.0 , 10.0 0.0 10.0 , 0.0 10.0 10.0 , 0.0 0.0 0.0))') as geom
  9. INTO
  10. polygon;
  11.  
  12. --create ogr table with polygon z
  13. SELECT
  14. 1 as gid,
  15. 'Layer 1'::text AS layer,
  16. 'BRUSH(fc:#ff0066,bc:#ff0066,id:"ogr-brush-0")'::text AS ogr_style,
  17. geom AS geom
  18. INTO
  19. test1
  20. FROM
  21. polygon;
  22.  
  23. --create ogr table with closed linestring z
  24. SELECT
  25. 1 as gid,
  26. 'Layer 1'::text AS layer,
  27. 'BRUSH(fc:#ff0066,bc:#ff0066,id:"ogr-brush-0")'::text AS ogr_style,
  28. ST_ExteriorRing((ST_Dump(geom)).geom) AS geom
  29. INTO
  30. test2
  31. FROM
  32. polygon;
  33.  
  34. ogr2ogr -f "DXF" test1.dxf PG:"dbname=test3d host=127.0.0.1 port=5432 user=postgres password=postgres" -sql "SELECT * FROM test1"
  35. ogr2ogr -f "DXF" test2.dxf PG:"dbname=test3d host=127.0.0.1 port=5432 user=postgres password=postgres" -sql "SELECT * FROM test2"
  36.  
  37. -nlt POLYGONZ
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement