<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> </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 style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black">So far, I haven’t been able to populate the block
columns unless I use a DXF file which has been exploded before saving.</DIV>
<DIV style="font-color: black"> </DIV>
<DIV style="font-color: black"><FONT color=#00002b size=3
face="Times New Roman">In all of my searching, I have not come across your
suggestion of dereferencing the block. Can you point me to some
documentation?</FONT></DIV>
<DIV style="font-color: black"><FONT color=#00002b size=3
face="Times New Roman"></FONT> </DIV>
<DIV style="font-color: black"><FONT color=#00002b size=3
face="Times New Roman">Bob</FONT></DIV>
<DIV style="font-color: black"><FONT color=#00002b size=3
face="Times New Roman"></FONT> </DIV>
<DIV style="font-color: black"> </DIV>
<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> Monday, December 19, 2011 12:58 AM</DIV>
<DIV><B>To:</B> <A title=gdal-dev@lists.osgeo.org
href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</A> </DIV>
<DIV><B>Cc:</B> <A title=rjpawley@shaw.ca href="mailto:rjpawley@shaw.ca">Bob
Pawley</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">Hi
Bob,</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 driver writes to tables "entities" and "blocks". You have to dereference the
block layer yourself.</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">SELECT
Translate( Scale( Rotate((Dump(b.wkb_geometry)).geom, e.blockangle / 180 *
PI()), e.blockscale[1], e.blockscale[2]), ST_X(e.wkb_geometry),
ST_Y(e.wkb_geometry)) AS wkb_geometry,</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">CASE
WHEN b.ogr_style IS NOT NULL THEN b.ogr_style ELSE e.ogr_style END AS
ogr_style,</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">e.layer,</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">e.linetype,</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">e.subclasses,</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">b.text</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">FROM
entities e</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">INNER
JOIN</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">blocks
b USING (blockname);</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">Sometimes
you have blocks with world coordinates and no connection in entities.</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">SELECT
(Dump(b.wkb_geometry)).geom AS wkb_geometry,</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">b.ogr_style,</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">b.layer,</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">b.linetype,</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">b.subclasses,</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">b.text</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">FROM
blocks b</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">WHERE
blockname NOT IN</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">SELECT
DISTINCT blockname</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">FROM
entities</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">WHERE
blockname IS NOT NULL</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>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">Some
newer DXF Formats can have features in paper space. This is now not supported by
ogr2ogr.</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-paragraph-type: empty"> </P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">Gr</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">Ralf</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
Freitag 16 Dezember 2011 22:14:38 Bob Pawley wrote:</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
I have imported a dxf file into Postgis using the following command line -</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">>
set DXF_INLINE_BLOCKS=FALSE&set DXF_MERGE_BLOCK_GEOMETRIES=FALSE&set</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
PGCLIENTENCODING=LATIN1&&ogr2ogr -f "PostgreSQL" PG:"host=localhost</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
user=postgres dbname=dbname password=pass" W_Works.dxf -nln Import_PID</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
-overwrite –skipfailures</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">>
All geometries are intact.</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">>
However, the text is part of the Linestring layer and not in the text</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-user-state: 0">>
column of the Postgresql table.</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">>
Is this to be expected?</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">>
Is there some way of screening out the text as text and point 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">>
Bob</P>
<P
style="TEXT-INDENT: 0px; MARGIN: 0px; -qt-block-indent: 0; -qt-paragraph-type: empty"> </P></DIV></DIV></DIV></BODY></HTML>