[postgis-users] DXF to Postgis using ogr

653 views
Skip to first unread message

Bob Pawley

unread,
Dec 16, 2011, 4:13:26 PM12/16/11
to postgi...@postgis.refractions.net
I have imported a dxf file into Postgis using the following command line -
 
set DXF_INLINE_BLOCKS=FALSE&set DXF_MERGE_BLOCK_GEOMETRIES=FALSE&set PGCLIENTENCODING=LATIN1&&ogr2ogr -f "PostgreSQL" PG:"host=localhost user=postgres dbname=dbname password=pass"  W_Works.dxf -nln Import_PID -overwrite –skipfailures
 
All geometries are intact.

However, the text is part of the Linestring layer and not in the text column
of the Postgresql table.

Is this to be expected?

Is there some way of screening out the text as text and point geometry?
 
Bob

Guglielmo Raimondi

unread,
Dec 17, 2011, 4:26:57 AM12/17/11
to PostGIS Users Discussion
Have you try to use "dxf2postgis"?
It's a tool for Windows environment that convert DXF files (R11 and
R12 version) in SQL scripts for PostgreSQL+PostGIS.
In detail, text are converted in points with special attibutes (text,
size, rotation, font, etc.) that you can use to replay the AutoCad
graphic aspect in a desktop GIS like QGis.
This is a link:

http://www.glasic.it/dxf2postgis.html

Regards,
Guglielmo Raimondi

2011/12/16 Bob Pawley <rjpa...@shaw.ca>:

> _______________________________________________
> postgis-users mailing list
> postgi...@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>

--
----------------------------------------------
Ing. Guglielmo R. Raimondi
guglielmo...@gmail.com

c/o MiPAAF - Ministero delle Politiche Agricole, Alimentari e Forestali
Gestione Commissariale ex Agensud
Via Venti Settembre 98/G
00187 Roma
www.agensud.it
tel.: (+39) 06 488887 55
------------------------------------------------
_______________________________________________
postgis-users mailing list
postgi...@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Bob Pawley

unread,
Dec 17, 2011, 8:00:23 AM12/17/11
to PostGIS Users Discussion
Hi Guglielmo

I tried it a couple of weeks ago but it didn't import the block geometries
nor the block text. It worked well with the non-block text and geometries.

I've managed to, with Org2org, import the whole DXF file but for some reason
it appears to turn the block text into linestrings.

Bob

Guglielmo Raimondi

unread,
Dec 19, 2011, 2:48:05 PM12/19/11
to PostGIS Users Discussion
Hi Bob,
sorry for delay in answering.
Yes, Dxf2PostGis manage blocks like points and I don't plan (for the
moment) to develop extra code to do it in different way.
I'm not expert user of Org2org (I remember also a different name
"ogr2ogr") and I can't help you, sorry.
I can suggest you to explode blocks before use Dxf2PostGIS, if this is
compatible with your requirements.
In any case, good luck!
Please, tell me if you find a workaround to the trouble.
Guglielmo

2011/12/17 Bob Pawley <rjpa...@shaw.ca>:

Bob Pawley

unread,
Jan 16, 2012, 1:27:14 PM1/16/12
to PostGIS Users Discussion
Hi Guglielmo

I found the QGIS dxf2shp plugin works with Dassault's DraftSight version of
dxf.

One needs to run an unexploded version of dxf - once for polyline and again
for polygon.

For text and accompanying points an exploded version of the dxf file needs
to be selected.

I then use FWTools to import the shapefiles into Postgis.

QGIS is written in VC++ of which I am not acquainted. Perhaps this will
help you.

It would be of help to have a standalone version that imports all of the dxf
information directly into Postgis with one click.

Sandro Santilli

unread,
Jan 17, 2012, 4:11:15 AM1/17/12
to PostGIS Users Discussion
On Mon, Jan 16, 2012 at 10:27:14AM -0800, Bob Pawley wrote:

> QGIS is written in VC++ of which I am not acquainted.

QGIS is written in C++.

The "V" is not part of the language name, stands for "Visual"
and identifies a proprietary [1] C++ compiler.

[1] http://en.wikipedia.org/wiki/Proprietary_software

QGIS can be built using any compliant compiler [2]

[2] http://en.wikipedia.org/wiki/List_of_compilers#C.2B.2B_compilers

QGIS is free software [3]

[3] http://www.gnu.org/philosophy/free-sw.html

Most QGIS developers use a free software compiler, often GCC [4]

[4] http://www.gnu.org/software/gcc/

Nobody deserves to write or speak in a language which requires the
use of a black box to interpret or run.

--strk;

() Free Hacker
/\ http://strk.keybit.net/

Reply all
Reply to author
Forward
0 new messages