Tag Info

Hot answers tagged

9

Benjamin, DXF (as supposed by OGR) does not support arbitrary GIS attributes. It has a fixed schema that looks like: Layer: String (0.0) SubClasses: String (0.0) ExtendedEntity: String (0.0) Linetype: String (0.0) EntityHandle: String (0.0) and only a few of these are actually examined on write. The simpliest expedient is just to use the -skipfailures ...


7

Easier then I thought (thanks to BenjaminGolder for the tip): ogr2ogr -f "DXF" Contours.dxf Contours.TAB -zfield Height Contours.TAB is the input MapInfo tab file.


6

BTW, if you appreciate Shapely, you may also appreciate Fiona. The Fiona example in https://gist.github.com/1886782 could be adapted to convert a shapefile to DXF. with fiona.collection("file.shp", "r") as source: with fiona.collection( "file.dxf", "w", driver="DXF", schema=source.schema, ) as ...


6

Shapely doesn't directly support exporting to DXF - it supports export to Well Known Text (WKT), Well Known Binary (WKB), Numpy arrays and GeoJSON objects (interoperation from the Shapely manual). As such you need a package that can transform from one of these formats to DXF. I'd suggest OGR as the way to go for my money. The easiest method would be to ...


6

FME will convert data between formats and has a good story for transforming CAD > GIS. See: http://www.safe.com/solutions/GIS/CADtoGIS.php Disclosure - I do work for Safe Software, the creators of FME. But it is ideal for this scenario, otherwise I wouldn't suggest it. As to problems with CAD into GIS, one other issue is geometry types. CAD typically has ...


6

Problem with DWG and DXF formats is that Autodesk does not publish full specifications. DXF Format DXF ASCII format is well known and most of packages can read it. Binary DXF is partially documented and since it is not primary AutoCAD format, it is rarely supported. For more details see here: AutoCAD DXF DWG Format DWG format is read by most GIS ...


6

You georeference rasters and affine vectors :) QGIS has an affine plug-in (qgsAffine) with which you can scale vector layers. You can also apply x and y offsets to all of the vertices in a vector layer if required. I think you will probably need to convert your DXF to a shapefile to use it though (right-click on the layer in the layers panel and go 'Save ...


6

"Layer" is an just an attribute of the feature. But you can use OGR SQL and attribute filters: import ogr driver = ogr.GetDriverByName('DXF') datasource = driver.Open('test1.dxf', 0) layers=datasource.ExecuteSQL( "SELECT DISTINCT Layer FROM entities" ) layer=datasource.GetLayerByIndex(0) for i in range(0, layers.GetFeatureCount()): layerName = ...


5

There is quite a bit of missing information in your question. Despite that here are some ideas. 1. I will assume your data is polygon. You should attempt to export the cad file as polygon and point files seperately. The text will be your point file with the label point as the location. and the string value as an attribute. 2. use a spatial join (arcmap ...


5

GRASS GIS 6.4 supports import and export of 2D and 3D DXF through v.in.dxf and v.out.dxf. In GRASS-Addons there is a new prototpype for a DWG import module, based on LibreDWG.


5

What are the biggest issues I dont have the time (right now, ill try edit later) to provide a detailed answer, but the main issue with CAD data is typically, CAD technicians create plans with no regard to coordinate systems. i.e. They plot around the origin of 0, 0, = I've work on plenty of projects where people dont understand that a bit more work is ...


5

It seems to me that the main problem for you is to introduce some order to your tons of DWG/DXF files with information (in several layers). Regardless of choosing software/tool I can recommend you to describe your data. Here is some thoughts: You should develop some kind of unique codes for all types of your features. It can be one attribute or several or ...


4

The v.in.ogr.dxf module of GRASS (also available in QGIS trough the QGIS/GRASS plugin) works better (in same cases) than the OGR driver (that QGIS uses to handle DXFs). Once imported it in a GRASS location/mapset you can easy export by just clicking "save as...".


4

autocad map 3d will easily geo-reference your dwg/dxf files and allow conversion to 12 gis formats. Unless you add FME desktop also (FME extsion for ArcGIS). Then with FME extended to arcmap and autocad you have all ~275 formats. But doing it through map3d you have access to some particularly useful tools. (i.e. select by layer, color, linetype, or even ...


4

Python is case sensitive and gdal/ogr doesn't really follow the Python PEP8 naming conventions. "getZ" is not an ogr.Geometry method, "GetZ" is what you are looking for. >>> help(ogr.Geometry.GetZ) Help on method GetZ in module osgeo.ogr: GetZ(self, *args, **kwargs) unbound osgeo.ogr.Geometry method GetZ(self, int point = 0) -> double ...


4

In QgiS: rightclick in left panel on layer and use save as and select Autocad dxf as export format - this works for me. areyou using qgis 1.8? edit: I now also tried "save selection as", seems to work too edit #2 : I enclose a screenshot from qgis: and one screenshot from inkscape with the imported dxf-file:


4

Since you have the Data Interoperability extension, you can create a ETL tool to load all the dxf's into a gdb (or another format of your choice), just check the help section of Data Interop. Might find something helpful read also here- http://www.esri.com/software/arcgis/extensions/datainteroperability


4

I'm a little bit late, but hope it helps. Tuts and books If you want something learn about ogr, gdal, python and postGIS you can look at first on these pages and book. Geoprocessing with Python using Open Source GIS http://www.gis.usu.edu/~chrisg/python/ ogr http://www.gdal.org/ogr/ ogr2ogr - cheatsheet ...


4

Given that your autocad version is 12+ years old it may be an issue with autocad dwg or dxf file format version (major format version: http://en.wikipedia.org/wiki/.dwg#Version_history). You should try to open it in a newer version of ACAD, or try saving it into an older format.


4

QGIS does not manage Z coordinates importing CSV files. You can convert the CSV to DXF using ogr2ogr from the command-line shell. This should be already installed since QGIS uses OGR too. You need to create a .vrt file along your CSV. This is a plain-text file that you can create with any text editor. It is really easy in your case: ...


4

FME can do Shape to AutoCAD Blocks This was modified (for FME 2013) from the original on FMEPedia http://fmepedia.safe.com/articles/How_To/Creating-AutoCAD-Blocks-with-FME Product: FME Desktop http://www.safe.com/fme/fme-technology/fme-desktop/overview/


3

The dxf is an ascii file. You probably could copy your orig dxf 2 times and then just delete the line section from one, and the point section from the other. should be group code 10. dxf group codes


3

Kosmo (http://www.opengis.es/)can read and write to DXF/DWG, when writing it uses/creates a layer called Default, it also has some basic CAD tools implemented. Hope it works


3

It sounds like you have some major batch processing and therefore, I would be inclided to script this. Doing this all by hand might be feasible but a pain. At least with a script, if you muck something up you can just correct the script and re-run. Also, you have a chance to unify a lot of the non-standard naming etc by using regular expressions and ...


3

I think you best bet is to stick with 2003 ASCI DXF. This is the format that I have always used and it works fine. Also depending on your needs you might not need the Dxf2Shp plugin as QGIS (using OGR) can open .dxf file directly via the Add Vector Layer button.


3

I do that before I load the dxf into QGIS. I use DoubleCAD XT (which is free) to export one layer at a time from the cad package. DoubleCAD is also useful for going the other way, dxfs out of QGIS aren't very appealing to other users, but if you open them in DoubleCAD and save them as DWG I find I get better results. Often I will rebuild the layers in this ...


3

You wil need to define a field to split them with, if you don't already have one. Then use the split layer.


3

In ArcMap a DXF file is read only so you need to export it, there is no alternative. Use the CAD to Geodatabase tool.


3

You can try the GRASS command v.in.dxf in Processing or in the Grass plugin (look at GRASS GIS: import DXF). Some results in GRASS GIS with 3D dxf files: from Vector support in GRASS GIS: Möbius strip visualization to show the 3D vector capabilities of GRASS 6 - imported from 3D DXF (screenshot: M. Neteler) or geological layers (3D dxf) (my work ...


3

As far as I know, which may not be very far, you can't do that. An mxd is a separate document from the data it contains. Many CAD programs can use shapefiles, although again you wouldn't get symbology. For text, try converting it to annotation and maybe that will export to CAD. Do this on a copy of your data. I'm more used to bringing CAD into Arc than Arc ...



Only top voted, non community-wiki answers of a minimum length are eligible