0

I got an elevation raster map which I interpolate from a point cloud with v.surf.bspline.

Then I digitize a couple of points in a new vector layer.

With v.drape I'm able to get a height from the raster to those 2D points.

I'm exporting the result to DXF and everything is fine, the points are in 3D.

When I'm digitizing lines, the same workflow leads me to lines that are still in 2D.

I'm missing something !

Thank you.

EDIT 1 :

I made a polyline (not in 3D a 2D) in Drafsight, z is equal to 0. I saved it in .DXF.

Then I imported it with v.in.dxf to grass, gave it to v.drape with my elevation raster map.

And finally, I ran :

v.out.ogr -z input=gloubiDrape@PERMANENT type=point,line,boundary,centroid,area,face,kernel,auto dsn=gloubidrape.dxf format=DXF

With the following output :

WARNING: The combination of types is not supported by all formats.
WARNING: No points found, but requested to be exported. Will skip this geometry type.
WARNING: No boundaries found, but requested to be exported. Will skip this geometry type.
WARNING: No areas found, but requested to be exported. Will skip this geometry type.
WARNING: No centroids found, but requested to be exported. Will skip this geometry type.
WARNING: No faces found, but requested to be exported. Will skip this geometry type.
WARNING: No kernels found, but requested to be exported. Will skip this geometry type.
WARNING: Vector map <gloubiDrape@PERMANENT> is 3D. Use format specific layer creation options (parameter 'lco') to export in 3D rather than 2D (default)
ERROR 1: DXF layer does not support arbitrary field
creation, field 'cat' not created.
ERROR 1: DXF layer does not support arbitrary field
creation, field 'layer' not created.
ERROR 1: DXF layer does not support arbitrary field
creation, field 'entity' not created.
ERROR 1: DXF layer does not support arbitrary field
creation, field 'label' not created.
Exporting 1 geometries...
Exporting 0 areas (may take some time)...
Exporting 0 faces (may take some time) ...
Exporting 0 kernels...
v.out.ogr complete. 1 features written to <gloubiDrape> (DXF).

I opened this new .DXF with draftsight, now z is not equal to 0, it is equal to 329 which is consistent with my elevation map but it is still flat.

EDIT 2 :

When I show attribute data for gloubiDrape my 3Dvector map, under browse data tab I get :

cat layer entity label
1 0 lwpolyline
2 0 lwpolyline

and under manage tables :

columnName dataType dataLength
cat integer 11
layer character 255
entity character 255
label character 255

EDIT 3 :

In DXF a 3D polyline is a POLYLINE and so far what I'm getting is LWPOLYLINE with the DXF that I've generated. Source : http://docs.autodesk.com/ACD/2014/ENU/

This a sample of the dxf I've produced :

SECTION
  2
ENTITIES
  0
LWPOLYLINE
  5
20000
  8
0
100
AcDbEntity
100
AcDbPolyline
 70
0
 90
17
 10
871445.368819307
 20
176723.75933446
 38
335.327438654427
 10
871406.15681453
 20
176721.775169337
 38
329.303427483617
 10
871430.247781684
 20
176680.644249806
 38
329.181349425104
 10
871442.587057543
 20
176678.881496111
 38
329.223628419705
 10
871458.451840791
 20
176666.542220252
 38
340.904712531814
 10
871440.824303849
 20
176633.637484627
 38
340.761815791952
 10
871413.795413871
 20
176642.451253098
 38
329.367577920776
 10
871405.569229965
 20
176620.710624203
 38
329.374567538369
 10
871403.806476271
 20
176613.072024862
 38
329.598040695032
 10
871389.704446718
 20
176577.816950978
 38
339.420990431382
 10
871367.963817823
 20
176595.44448792
 38
328.878231781793
 10
871355.624541963
 20
176607.783763779
 38
330.699957902362
 10
871347.985942622
 20
176620.123039638
 38
331.029891518627
 10
871337.409420457
 20
176617.77270138
 38
329.987317651824
 10
871325.070144597
 20
176623.648547027
 38
327.790318474242
 10
871353.861788269
 20
176665.367051123
 38
329.183225279327
 10
871368.551402387
 20
176734.702029761
 38
328.573434984486
  0
ENDSEC

As you can see my output contains 3D points, but the format is somehow saying that this is 2D at a fixed z. I checked it is fixed at 328.5734, the z of the last point.

This is a DXF with the kind of object that I want :

SECTION
  2
ENTITIES
  0
POLYLINE
  5
76
330
1F
100
AcDbEntity
  8
0
100
AcDb3dPolyline
 66
     1
 10
0.0
 20
0.0
 30
0.0
 70
     8
  0
VERTEX
  5
77
330
76
100
AcDbEntity
  8
0
100
AcDbVertex
100
AcDb3dPolylineVertex
 10
-2.682663316582904
 20
235.6055276381909
 30
0.0
 70
    32
  0
VERTEX
  5
78
330
76
100
AcDbEntity
  8
0
100
AcDbVertex
100
AcDb3dPolylineVertex
 10
11.74257787156506
 20
173.1071513625327
 30
0.0
 70
    32
  0
VERTEX
  5
79
330
76
100
AcDbEntity
  8
0
100
AcDbVertex
100
AcDb3dPolylineVertex
 10
135.7183417085427
 20
173.1798994974874
 30
0.0
 70
    32
  0
VERTEX
  5
7A
330
76
100
AcDbEntity
  8
0
100
AcDbVertex
100
AcDb3dPolylineVertex
 10
-133.6656858850508
 20
97.48688849752057
 30
20.0
 70
    32
  0
VERTEX
  5
7B
330
76
100
AcDbEntity
  8
0
100
AcDbVertex
100
AcDb3dPolylineVertex
 10
-80.43453010615633
 20
72.80698900003313
 30
20.0
 70
    32
  0
VERTEX
  5
7C
330
76
100
AcDbEntity
  8
0
100
AcDbVertex
100
AcDb3dPolylineVertex
 10
220.3247608051047
 20
40.44340560335991
 30
0.0
 70
    32
  0
VERTEX
  5
7D
330
76
100
AcDbEntity
  8
0
100
AcDbVertex
100
AcDb3dPolylineVertex
 10
123.620351758794
 20
47.36080402010046
 30
0.0
 70
    32
  0
VERTEX
  5
7E
330
76
100
AcDbEntity
  8
0
100
AcDbVertex
100
AcDb3dPolylineVertex
 10
30.22386934673369
 20
62.8462311557789
 30
0.0
 70
    32
  0
VERTEX
  5
7F
330
76
100
AcDbEntity
  8
0
100
AcDbVertex
100
AcDb3dPolylineVertex
 10
-35.5891959798995
 20
146.0804020100502
 30
0.0
 70
    32
  0
VERTEX
  5
80
330
76
100
AcDbEntity
  8
0
100
AcDbVertex
100
AcDb3dPolylineVertex
 10
-38.49271356783919
 20
251.5748743718593
 30
0.0
 70
    32
  0
SEQEND
  5
81
330
76
100
AcDbEntity
  8
0
  0
ENDSEC
2

see vector export to DXF in 3d ?

There are two ways to export a GRASS vector file to a dxf file:

  • with v.out.dxf
  • with v.out.ogr (-z flag)

The first one may have problems exporting 3D polylines or polygons, the second, no.

  • I edited my question to answer you. It is improving ! – mthpvg Sep 16 '13 at 16:39
  • Which version of GRASS GIS are you using ? – gene Sep 16 '13 at 17:18
  • I'm using 6.4.3. – mthpvg Sep 17 '13 at 6:49
0

The only solution I found is the following one.

I'm writing a bash script to remove from grass' DXF this part :

SECTION
  2
ENTITIES
  0
LWPOLYLINE
...
ENDSEC

and replace it with :

SECTION
  2
ENTITIES
  0
POLYLINE
...
ENDSEC

Grass is giving me 3D points but it is encapsulating it wrong with a LWPOLYLINE... a 2D polyline entity.

I'm just re encapsulating my points in a valid POLYLINE.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.