index.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. .. _dxf:
  2. DXF OutputFormat for WFS and WPS PPIO
  3. =====================================
  4. This extension adds two distinct functionalities to GeoServer, both related to DXF format
  5. support as an output.
  6. DXF is a CAD interchange format, useful to import data in several CAD systems.
  7. Being a textual format it can be easily compressed to a much smaller version, so
  8. the need for a DXF-ZIP format, for low bandwidth usage.
  9. There have been multiple revisions of the format, so we need to choose a "version"
  10. of DXF to write. The extension implements version 14, but can be easily extended
  11. (through SPI providers) to write other versions too.
  12. The DXF OutputFormat for WFS adds the support for two additional output formats for
  13. WFS GetFeature requests. The new formats, DXF and DXF-ZIP are associated to the
  14. "application/dxf" and "application/zip" mime type, respectively.
  15. They produce a standard DXF file or a DXF file compressed in zip format.
  16. The WPS PPIO adds dxf as an on output format option for WPS processes.
  17. The WPS PPIO requires the WPS extension to be installed on GeoServer.
  18. WFS Output Format usage
  19. ---------------------------
  20. Request Example::
  21. http://localhost:8080/geoserver/wfs?request=GetFeature&typeName=Polygons&
  22. outputFormat=dxf
  23. Output Example (portion)::
  24. 0
  25. SECTION
  26. 2
  27. HEADER
  28. 9
  29. $ACADVER
  30. 1
  31. AC1014
  32. ...
  33. 0
  34. ENDSEC
  35. ...
  36. 0
  37. SECTION
  38. 2
  39. TABLES
  40. ...
  41. 0
  42. TABLE
  43. 2
  44. LAYER
  45. ...
  46. 0
  47. LAYER
  48. 5
  49. 2E
  50. 330
  51. 2
  52. 100
  53. AcDbSymbolTableRecord
  54. 100
  55. AcDbLayerTableRecord
  56. 2
  57. POLYGONS
  58. 70
  59. 0
  60. 62
  61. 7
  62. 6
  63. CONTINUOUS
  64. 0
  65. ENDTAB
  66. ...
  67. 0
  68. ENDSEC
  69. 0
  70. SECTION
  71. 2
  72. BLOCKS
  73. ...
  74. 0
  75. ENDSEC
  76. 0
  77. SECTION
  78. 2
  79. ENTITIES
  80. 0
  81. LWPOLYLINE
  82. 5
  83. 927C0
  84. 330
  85. 1F
  86. 100
  87. AcDbEntity
  88. 8
  89. POLYGONS
  90. 100
  91. AcDbPolyline
  92. 90
  93. 5
  94. 70
  95. 1
  96. 43
  97. 0.0
  98. 10
  99. 500225.0
  100. 20
  101. 500025.0
  102. 10
  103. 500225.0
  104. 20
  105. 500075.0
  106. 10
  107. 500275.0
  108. 20
  109. 500050.0
  110. 10
  111. 500275.0
  112. 20
  113. 500025.0
  114. 10
  115. 500225.0
  116. 20
  117. 500025.0
  118. 0
  119. ENDSEC
  120. 0
  121. SECTION
  122. 2
  123. OBJECTS
  124. ...
  125. 0
  126. ENDSEC
  127. 0
  128. EOF
  129. Each single query is rendered as a layer. Geometries are encoded as
  130. entities (if simple enough to be expressed by a single DXF geometry
  131. type) or blocks (if complex, such as polygons with holes or collections).
  132. Some options are available to control the output generated. They are
  133. described in the following paragraphs.
  134. GET requests format_options
  135. ---------------------------
  136. The following format_options are supported:
  137. #. version: (number) creates a DXF in the specified version format (only 14 is currently supported)
  138. #. asblock: (true/false) if true, all geometries are written as blocks and then inserted as entities. If false, simple geometries are directly written as entities.
  139. #. colors: (comma delimited list of numbers): colors to be used for the DXF layers, in sequence. If layers are more than the specified colors, they will be reused many times. A set of default colors is used if the option is not used. Colors are AutoCad color numbers (7=white, etc.).
  140. #. ltypes: (comma delimited list of line type descriptors): line types to be used for the DXF layers, in sequence. If layers are more than the specified line types, they will be reused many times. If not specified, all layers will be given a solid, continuous line type. A descriptor has the following format: <name>!<repeatable pattern>[!<base length>], where <name> is the name assigned to the line type, <base length> (optional) is a real number that tells how long is each part of the line pattern (defaults to 0.125), and <repeatable pattern> is a visual description of the repeatable part of the line pattern, as a sequence of - (solid line),* (dot) and _ (empty space). For example a dash-dot pattern would be expressed as --_*_.
  141. #. layers: (comma delimited list of strings) names to be assigned to the DXF layers. If specified, must contain a name for each requested query. By default a standard name will be assigned to layers.
  142. #. withattributes: (true/false) enables writing an extra layer with attributes from each feature, the layer has a punctual geometry, with a point in the centroid of the original feature
  143. POST options
  144. ---------------------------
  145. Unfortunately, it's not currently possible to use format_options in POST
  146. requests. The only thing we chose to implement is the layers options, via
  147. the handle attribute of Query attributes. So, if specified, the layer
  148. of a Query will be named as its handle attribute.
  149. The handle attribute of the GetFeature tag can also be used to override
  150. the name of the file produced.
  151. WPS PPIO
  152. ---------------------------
  153. When the WPS PPIO module is installed, together with the WPS extension, WPS processes
  154. returning a FeatureCollection can use application/dxf or application/zip as output
  155. mime type to get a DXF (or zipped DXF) in output.