[gdal-dev] OGR_STYLE angle problem when using SYMBOL

Jukka Inkeri gdal at awot.fi
Sat Apr 18 09:57:19 PDT 2015


MTEXT no problem with angle, field/attribute SUUNTA=angle:

$ogr2ogr -f DXF  text2.dxf text2.shp \
   -sql "SELECT *,CONCAT('LABEL(f:Arial,s:12pt,t:', TEKSTI,',a:', 
CAST(SUUNTA/10000/3.14159*180 AS character(255)),')') AS OGR_STYLE FROM 
text2 "

text2.dxf:
MTEXT
   5
20000
   8
0
100
AcDbEntity
100
AcDbMText
  50
12.1295267682925
  40
0.00423334180001693
   1
110
  10
641394.99
  20
6953516.155
   0

When I try to make same to the POINT, not so lucky. suunta=direction.
$ ogr2ogr -f  "DXF" suunta.dxf suunta.shp \
    -sql "SELECT *,CONCAT('SYMBOL(a:',CAST(SUUNTA/10000/3.14159*180 AS 
character(255)),')') AS OGR_STYLE  FROM suunta "

suunta.dxf:
POINT
   5
20000
   8
0
100
AcDbEntity
100
AcDbPoint
  10
643482.817
  20
6953970.315
   0

I think that something like is missing:
  50
-136.7

Example label: works fine
$ ogrinfo -q  -sql "SELECT *,CONCAT('LABEL(f:Arial,s:12pt,t:', 
TEKSTI,',a:', CAST(SUUNTA/10000/3.14159*180 AS character(255)),')') AS 
OGR_STYLE FROM teksti " teksti.shp
...
OGRFeature(teksti):49
  OGR_STYLE (String) = LABEL(f:Arial,s:12pt,t:90,a:41.7113627176048)
   Style = LABEL(f:Arial,s:12pt,t:SomeText,a:41.7113627176048)
   POINT (633137.512 6942615.358)

Example symbol:, not work
$ ogrinfo  -q  suunta.shp -sql "SELECT 
*,CONCAT('SYMBOL(a:',CAST(SUUNTA/10000/3.14159*180 AS 
character(255)),')') AS OGR_STYLE  FROM suunta "
...
OGRFeature(suunta):453
  OGR_STYLE (String) = SYMBOL(a:91.0889072094067)
  Style = SYMBOL(a:91.0889072094067)
  POINT (632094.467 6946124.531)
...

It looks that Gdal not use angle when you have POINT element ?

$ ogr2ogr -f "ESRI Shapefile" x.shp   somesymbol_w_angle.dxf
$ ogrinfo -q -sql "SELECT * FROM x" x.shp
Layer name: x
OGRFeature(x):0
   Layer (String) = 104000 Rinteen suunta
   SubClasses (String) = AcDbEntity
   ExtendedEn (String) = (null)
   Linetype (String) = (null)
   EntityHand (String) = (null)
   Text (String) = (null)
   POINT (637587.5 6953209.45)

OGRFeature(x):1
   Layer (String) = 104000 Rinteen suunta
   SubClasses (String) = AcDbEntity
   ExtendedEn (String) = (null)
   Linetype (String) = (null)
   EntityHand (String) = (null)
   Text (String) = (null)
   POINT (637572.65 6953217.25)

somesymbol_w_angle.dxf: it include angles (attribute 50).
...
POINT
100
AcDbEntity
   8
104000 Rinteen suunta
  10
637587.50
  20
6953209.45
  50
0.0
   0
POINT
100
AcDbEntity
   8
104000 Rinteen suunta
  10
637572.65
  20
6953217.25
  50
-136.7
...

I'm doing conversion packet from shape files to dxf-files then import to 
the Ocad using symbol crosstable. All other features already works fine. 
Symbols, colors, text angle, ...

-jukka-





More information about the gdal-dev mailing list