<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>Thanks Ralf</DIV>
<DIV>&nbsp;</DIV>
<DIV>I downloaded the latest development installer (<A 
title=http://www.gisinternals.com/sdk/PackageList.aspx?file=release-1310-gdal-1-8-mapserver-6-0.zip 
href="http://www.gisinternals.com/sdk/PackageList.aspx?file=release-1310-gdal-1-8-mapserver-6-0.zip">http://www.gisinternals.com/sdk/PackageList.aspx?file=release-1310-gdal-1-8-mapserver-6-0.zip</A>) 
and tried your suggestion using it.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I still get an error when running the Postgresql code “column b.ogr_style 
does not exist”. This is correct as neither table has, or has had, a column 
ogr_style.</DIV>
<DIV>&nbsp;</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>&nbsp;</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>&nbsp;</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">&nbsp;</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">&gt; 
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">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
When I run</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
ogr2ogr --config DXF_INLINE_BLOCKS FALSE --config </P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
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">&gt; 
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">&gt; 
-skipfailures -sql "SELECT</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
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">&gt; 
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">&gt; 
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">&gt; 
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">&gt; 
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">&gt; 
JOIN blocks b USING (blockname)"</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
I get error - Undefined function `st_dump`used.</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-paragraph-type: empty">&nbsp;</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">&nbsp;</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
When I run a simplified version</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
ogr2ogr --config DXF_INLINE_BLOCKS FALSE --config </P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
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">&gt; 
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">&gt; 
-skipfailures -sql "SELECT wkb_geometry From entities"</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
I get error - unrecognized field name wkb_geometry</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
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">&gt; 
scale) or text I get no errors.</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
Bob</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
From: Ralf Suhr</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
Sent: Wednesday, December 21, 2011 1:30 AM</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
To: Bob Pawley</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
Cc: gdal-dev@lists.osgeo.org</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
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">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
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">&gt; 
entities layer and secound for blocks.</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
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">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
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">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">&gt; 
</P>
<P 
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-paragraph-type: empty">&nbsp;</P></DIV></DIV></DIV></BODY></HTML>