<HTML><HEAD>
<META name=qrichtext content=1>
<STYLE type=text/css>
p, li { white-space: pre-wrap; }
</STYLE>
</HEAD>
<BODY
style="FONT-STYLE: normal; FONT-FAMILY: 'Sans Serif'; FONT-SIZE: 10pt; FONT-WEIGHT: 400"
dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Times New Roman'; COLOR: #00002b; FONT-SIZE: 12pt">
<DIV>Hi Ralf</DIV>
<DIV> </DIV>
<DIV>I managed to include ogr_styles by using the –sql option. </DIV>
<DIV> </DIV>
<DIV>However the blocks table is still empty. There fore when I run the
Postgresql script the result comes up empty.</DIV>
<DIV> </DIV>
<DIV>Would it be possible for you to send me a dxf file that has worked for you,
just in case the dxf I am using is structured differently. (I’m using
engineering not geographic information.)</DIV>
<DIV> </DIV>
<DIV>In email I have about a 3 meg limit.</DIV>
<DIV> </DIV>
<DIV>Thanks.</DIV>
<DIV> </DIV>
<DIV>Bob </DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=Ralf.Suhr@itc-halle.de
href="mailto:Ralf.Suhr@itc-halle.de">Ralf Suhr</A> </DIV>
<DIV><B>Sent:</B> Wednesday, December 28, 2011 1:07 AM</DIV>
<DIV><B>To:</B> <A title=rjpawley@shaw.ca href="mailto:rjpawley@shaw.ca">Bob
Pawley</A> </DIV>
<DIV><B>Cc:</B> <A title=gdal-dev@lists.osgeo.org
href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</A> </DIV>
<DIV><B>Subject:</B> Re: [gdal-dev] DXF to Postgis using
ogr2ogr</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">Bob,
you need a gdal version 1.8 or higher.</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-paragraph-type: empty"> </P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">On
Dienstag 27 Dezember 2011 19:48:33 Bob Pawley wrote:</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
Something is still not penetrating this thick skull of mine.</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
When I run</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
ogr2ogr --config DXF_INLINE_BLOCKS FALSE --config </P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
DXF_MERGE_BLOCK_GEOMETRIES FALSE -f "PostgreSQL" PG:"host=localhost</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
user=postgres dbname=db password=pass" W_Works.dxf -overwrite</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
-skipfailures -sql "SELECT</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
ST_Translate(ST_Scale(ST_Rotate((ST_Dump(b.wkb_geometry)).geom,</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
e.blockangle / 180 * PI()), e.blockscale[1], e.blockscale[2]),</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
ST_X(e.wkb_geometry), ST_Y(e.wkb_geometry)) AS wkb_geometry, CASE WHEN</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
b.ogr_style IS NOT NULL THEN b.ogr_style ELSE e.ogr_style END AS</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
ogr_style, e.layer, e.linetype, e.subclasses, b.text FROM entities e INNER</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
JOIN blocks b USING (blockname)"</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
I get error - Undefined function `st_dump`used.</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-paragraph-type: empty"> </P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">You
can not use PostGIS functions on dxf file source.</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-paragraph-type: empty"> </P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
When I run a simplified version</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
ogr2ogr --config DXF_INLINE_BLOCKS FALSE --config </P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
DXF_MERGE_BLOCK_GEOMETRIES FALSE -f "PostgreSQL" PG:"host=localhost</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
user=postgres dbname=db password=pass" W_Works.dxf -overwrite</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
-skipfailures -sql "SELECT wkb_geometry From entities"</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
I get error - unrecognized field name wkb_geometry</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
In the last, when I substitute wkb_geometry for the blocks (name, angle,</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
scale) or text I get no errors.</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
In all of the commands I`ve run, the block table remains empty.</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-paragraph-type: empty"> </P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">The
dxf file contains two different ogr layers.</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-paragraph-type: empty"> </P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">ogr2ogr
--config DXF_INLINE_BLOCKS FALSE --config DXF_MERGE_BLOCK_GEOMETRIES FALSE -f
"PostgreSQL" PG:"host=localhost user=postgres dbname=db password=pass"
W_Works.dxf entities</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-paragraph-type: empty"> </P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">ogr2ogr
--config DXF_INLINE_BLOCKS FALSE --config DXF_MERGE_BLOCK_GEOMETRIES FALSE -f
"PostgreSQL" PG:"host=localhost user=postgres dbname=db password=pass"
W_Works.dxf blocks</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-paragraph-type: empty"> </P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">And
finaly run the sqls inside the postgis database.</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-paragraph-type: empty"> </P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
Bob</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
From: Ralf Suhr</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
Sent: Wednesday, December 21, 2011 1:30 AM</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
To: Bob Pawley</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
Cc: gdal-dev@lists.osgeo.org</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
Subject: Re: [gdal-dev] DXF to Postgis using ogr2ogr</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
On Import you can't use -nln option or you run ogr2ogr to times. One for</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
entities layer and secound for blocks.</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
ogr2ogr -f postgresql -nln myentities PG:"..." W_Works.dxf entities</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
ogr2ogr -f postgresql -nln myblocks PG:"..." W_Works.dxf blocks</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-paragraph-type: empty"> </P></DIV></DIV></DIV></BODY></HTML>