Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --cleanup
- DROP TABLE IF EXISTS polygon;
- DROP TABLE IF EXISTS test1;
- DROP TABLE IF EXISTS test2;
- --create single polygonz
- SELECT
- 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
- INTO
- polygon;
- --create ogr table with polygon z
- SELECT
- 1 as gid,
- 'Layer 1'::text AS layer,
- 'BRUSH(fc:#ff0066,bc:#ff0066,id:"ogr-brush-0")'::text AS ogr_style,
- geom AS geom
- INTO
- test1
- FROM
- polygon;
- --create ogr table with closed linestring z
- SELECT
- 1 as gid,
- 'Layer 1'::text AS layer,
- 'BRUSH(fc:#ff0066,bc:#ff0066,id:"ogr-brush-0")'::text AS ogr_style,
- ST_ExteriorRing((ST_Dump(geom)).geom) AS geom
- INTO
- test2
- FROM
- polygon;
- ogr2ogr -f "DXF" test1.dxf PG:"dbname=test3d host=127.0.0.1 port=5432 user=postgres password=postgres" -sql "SELECT * FROM test1"
- ogr2ogr -f "DXF" test2.dxf PG:"dbname=test3d host=127.0.0.1 port=5432 user=postgres password=postgres" -sql "SELECT * FROM test2"
- -nlt POLYGONZ
Advertisement
Add Comment
Please, Sign In to add comment