[gdal-dev] Creating DXF with ogr2ogr

Verena Diewald verena.diewald at wheregroup.com
Fri Jan 27 05:16:07 EST 2012


Hi Ralf,

do you use the same ogr2ogr command to create dxf from polygon data as I 
did? Or do you work with additional configure options?

Greetings,

Verena


Am 27.01.2012 10:02, schrieb Ralf Suhr:
>
> Hi Verena,
>
> I'm using gdal 1.8.1 for the same task. ArcGIS, "Free DWG Viewer" and 
> DWG True View 2012 are able to open all gdal output without any error 
> messages.
>
> Gr
>
> Ralf
>
> On Freitag 27 Januar 2012 09:12:15 Verena Diewald wrote:
>
> > Hi Ralf,
>
> >
>
> > Am 26.01.2012 17:20, schrieb Ralf Suhr:
>
> > > Hi Verena,
>
> > >
>
> > > can you provide more information. What software version did you use
>
> > > (gdal, postgis).
>
> >
>
> > PostgreSQL 9.0.4
>
> > PostGIS 1.5
>
> > GDAL 1.9dev
>
> >
>
> > > What kind of geometries is in the database.
>
> > >
>
> > > psql -d mydb -c "SELECT DISTINCT GeometryType( geom_column ) FROM
>
> > > my_data"
>
> >
>
> > POLYGON
>
> >
>
> > > What happend if you select only one geometrytype from database.
>
> > >
>
> > > ogr2ogr -f "DXF" -sql "SELECT * FROM my_data WHERE GeometryType(
>
> > > geom_column ) = 'POLYGON'" my_data.dxf PG:'host=localhost password=xxx
>
> > > user=xxx dbname=MYDB'
>
> >
>
> > Every dxf file I create only contains one single geometrytype.
>
> >
>
> >
>
> > Best regards,
>
> >
>
> > Verena
>
> >
>
> > > Gr
>
> > >
>
> > > Ralf
>
> > >
>
> > > On Donnerstag 26 Januar 2012 16:56:48 Verena Diewald wrote:
>
> > > > Hi Darren,
>
> > > >
>
> > > >
>
> > > >
>
> > > >
>
> > > >
>
> > > > I tried that option, but the error still remains.
>
> > > >
>
> > > > Does anyone have another idea?
>
> > > >
>
> > > >
>
> > > >
>
> > > >
>
> > > >
>
> > > > Greetings,
>
> > > >
>
> > > >
>
> > > >
>
> > > > Verena
>
> > > >
>
> > > > Am 26.01.2012 16:00, schrieb Carman, Darren:
>
> > > > > Try adding -nlt POLYGON (also has POINT and LINESTRING options).
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > > We have this option on an older version that used the ODA 
> libraries
>
> > > > >
>
> > > > > directly, so can't guarantee it's still the same.
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > > Darren
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > > *From:*gdal-dev-bounces at lists.osgeo.org
>
> > > > >
>
> > > > > [mailto:gdal-dev-bounces at lists.osgeo.org] *On Behalf Of *Verena
>
> > >
>
> > > Diewald
>
> > >
>
> > > > > *Sent:* 26 January 2012 14:03
>
> > > > >
>
> > > > > *To:* gdal-dev at lists.osgeo.org
>
> > > > >
>
> > > > > *Subject:* [gdal-dev] Creating DXF with ogr2ogr
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > > Hi all,
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > > I'm trying to create DXF files from a PostgreSQL database using
>
> > >
>
> > > ogr2ogr:
>
> > > > > |ogr2ogr -nln my_data -a_srs EPSG:25832 -s_srs EPSG:25832 -t_srs
>
> > > > > |
>
> > > > > |EPSG:25832 -f "DXF" my_data.dxf PG:'host=localhost password=xxx
>
> > > > > |
>
> > > > > |user=xxx dbname=MYDB' -sql "SELECT * FROM my_data"|
>
> > > > >
>
> > > > > It works fine with point data, but I get an invalid dxf file for
>
> > > > >
>
> > > > > polygon data. Opening the polygon dxf file results in the 
> following
>
> > > > >
>
> > > > > error:
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > > The following error was encountered while reading
>
> > > > >
>
> > > > > in HATCH starting at line 1546:
>
> > > > >
>
> > > > > Error: expected group code 10
>
> > > > >
>
> > > > > Invalid or incomplete DXF input -- drawing discarded.
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > > Do I have to pass any more options to ogr2ogr when creating a 
> polygon
>
> > > > >
>
> > > > > dxf? What did I do wrong?
>
> > > > >
>
> > > > > Does anyone have an idea about that?
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > > Greetings,
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > > Verena
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > > Infoterra Ltd. Is part of the Astrium GEO-Information Services
>
> > > > >
>
> > > > > Division and a wholly owned subsidiary of Astrium, Europe's 
> leading
>
> > > > >
>
> > > > > space systems and services specialist.
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > > Disclaimer. The information contained in this e-mail and its
>
> > > > >
>
> > > > > attachments are confidential and intended only for the use of the
>
> > > > >
>
> > > > > named addressee(s). If you are not the intended addressee, 
> please do
>
> > > > >
>
> > > > > not read, copy, use or disclose this message or its 
> attachments. If
>
> > > > >
>
> > > > > you have received this message in error, please notify the sender
>
> > > > >
>
> > > > > immediately and delete or destroy all copies of this message and
>
> > > > >
>
> > > > > attachments in all media. Any views or opinions expressed are 
> solely
>
> > > > >
>
> > > > > those of the author and do not necessarily represent those of
>
> > > > >
>
> > > > > Infoterra Ltd and shall not form part of any binding agreement.
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > > Infoterra Limited a company registered in England under number
>
> > > > > 2359955
>
> > > > >
>
> > > > > and having its registered office at Atlas House, 41 Wembley Road,
>
> > > > >
>
> > > > > Leicester, LE3 1UT. VAT number GB 476 0468 27.
>
> > > > >
>
> > > > >
>
> > > > >
>
> > > > > P Before printing, think about the environment
>

-- 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120127/958d29df/attachment-0001.html


More information about the gdal-dev mailing list