@cpp.js/package-gdal 1.0.0-beta.22 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +1 -1
  3. package/cppjs.build.js +1 -0
  4. package/dist/prebuilt/Android-arm64-v8a/include/gdal_version.h +3 -3
  5. package/dist/prebuilt/Android-arm64-v8a/include/ogr_api.h +4 -4
  6. package/dist/prebuilt/Android-arm64-v8a/include/ogr_feature.h +2 -2
  7. package/dist/prebuilt/Android-arm64-v8a/lib/cmake/gdal/GDALConfigVersion.cmake +3 -3
  8. package/dist/prebuilt/Android-arm64-v8a/lib/libgdal.so +0 -0
  9. package/dist/prebuilt/Android-arm64-v8a/lib/pkgconfig/gdal.pc +1 -1
  10. package/dist/prebuilt/Android-arm64-v8a/share/gdal/gdalvrt.xsd +30 -24
  11. package/dist/prebuilt/Android-x86_64/include/cpl_atomic_ops.h +90 -0
  12. package/dist/prebuilt/Android-x86_64/include/cpl_auto_close.h +73 -0
  13. package/dist/prebuilt/Android-x86_64/include/cpl_compressor.h +112 -0
  14. package/dist/prebuilt/Android-x86_64/include/cpl_config.h +215 -0
  15. package/dist/prebuilt/Android-x86_64/include/cpl_config_extras.h +34 -0
  16. package/dist/prebuilt/Android-x86_64/include/cpl_conv.h +417 -0
  17. package/dist/prebuilt/Android-x86_64/include/cpl_csv.h +71 -0
  18. package/dist/prebuilt/Android-x86_64/include/cpl_error.h +344 -0
  19. package/dist/prebuilt/Android-x86_64/include/cpl_hash_set.h +83 -0
  20. package/dist/prebuilt/Android-x86_64/include/cpl_http.h +319 -0
  21. package/dist/prebuilt/Android-x86_64/include/cpl_json.h +301 -0
  22. package/dist/prebuilt/Android-x86_64/include/cpl_list.h +59 -0
  23. package/dist/prebuilt/Android-x86_64/include/cpl_minixml.h +211 -0
  24. package/dist/prebuilt/Android-x86_64/include/cpl_multiproc.h +241 -0
  25. package/dist/prebuilt/Android-x86_64/include/cpl_port.h +1182 -0
  26. package/dist/prebuilt/Android-x86_64/include/cpl_progress.h +49 -0
  27. package/dist/prebuilt/Android-x86_64/include/cpl_quad_tree.h +105 -0
  28. package/dist/prebuilt/Android-x86_64/include/cpl_spawn.h +60 -0
  29. package/dist/prebuilt/Android-x86_64/include/cpl_string.h +863 -0
  30. package/dist/prebuilt/Android-x86_64/include/cpl_time.h +29 -0
  31. package/dist/prebuilt/Android-x86_64/include/cpl_virtualmem.h +365 -0
  32. package/dist/prebuilt/Android-x86_64/include/cpl_vsi.h +830 -0
  33. package/dist/prebuilt/Android-x86_64/include/cpl_vsi_error.h +55 -0
  34. package/dist/prebuilt/Android-x86_64/include/cpl_vsi_virtual.h +580 -0
  35. package/dist/prebuilt/Android-x86_64/include/cplkeywordparser.h +61 -0
  36. package/dist/prebuilt/Android-x86_64/include/gdal.h +2667 -0
  37. package/dist/prebuilt/Android-x86_64/include/gdal_alg.h +717 -0
  38. package/dist/prebuilt/Android-x86_64/include/gdal_alg_priv.h +386 -0
  39. package/dist/prebuilt/Android-x86_64/include/gdal_csv.h +25 -0
  40. package/dist/prebuilt/Android-x86_64/include/gdal_frmts.h +236 -0
  41. package/dist/prebuilt/Android-x86_64/include/gdal_mdreader.h +240 -0
  42. package/dist/prebuilt/Android-x86_64/include/gdal_pam.h +461 -0
  43. package/dist/prebuilt/Android-x86_64/include/gdal_priv.h +4599 -0
  44. package/dist/prebuilt/Android-x86_64/include/gdal_proxy.h +470 -0
  45. package/dist/prebuilt/Android-x86_64/include/gdal_rat.h +390 -0
  46. package/dist/prebuilt/Android-x86_64/include/gdal_simplesurf.h +579 -0
  47. package/dist/prebuilt/Android-x86_64/include/gdal_utils.h +313 -0
  48. package/dist/prebuilt/Android-x86_64/include/gdal_version.h +33 -0
  49. package/dist/prebuilt/Android-x86_64/include/gdal_vrt.h +89 -0
  50. package/dist/prebuilt/Android-x86_64/include/gdalcachedpixelaccessor.h +439 -0
  51. package/dist/prebuilt/Android-x86_64/include/gdalgeorefpamdataset.h +73 -0
  52. package/dist/prebuilt/Android-x86_64/include/gdalgrid.h +102 -0
  53. package/dist/prebuilt/Android-x86_64/include/gdalgrid_priv.h +67 -0
  54. package/dist/prebuilt/Android-x86_64/include/gdaljp2abstractdataset.h +61 -0
  55. package/dist/prebuilt/Android-x86_64/include/gdaljp2metadata.h +237 -0
  56. package/dist/prebuilt/Android-x86_64/include/gdalpansharpen.h +258 -0
  57. package/dist/prebuilt/Android-x86_64/include/gdalsubdatasetinfo.h +104 -0
  58. package/dist/prebuilt/Android-x86_64/include/gdalwarper.h +622 -0
  59. package/dist/prebuilt/Android-x86_64/include/gnm.h +750 -0
  60. package/dist/prebuilt/Android-x86_64/include/gnm_api.h +101 -0
  61. package/dist/prebuilt/Android-x86_64/include/gnmgraph.h +258 -0
  62. package/dist/prebuilt/Android-x86_64/include/memdataset.h +176 -0
  63. package/dist/prebuilt/Android-x86_64/include/ogr_api.h +1024 -0
  64. package/dist/prebuilt/Android-x86_64/include/ogr_core.h +1321 -0
  65. package/dist/prebuilt/Android-x86_64/include/ogr_feature.h +1981 -0
  66. package/dist/prebuilt/Android-x86_64/include/ogr_featurestyle.h +858 -0
  67. package/dist/prebuilt/Android-x86_64/include/ogr_geocoding.h +46 -0
  68. package/dist/prebuilt/Android-x86_64/include/ogr_geomcoordinateprecision.h +79 -0
  69. package/dist/prebuilt/Android-x86_64/include/ogr_geometry.h +4346 -0
  70. package/dist/prebuilt/Android-x86_64/include/ogr_p.h +324 -0
  71. package/dist/prebuilt/Android-x86_64/include/ogr_recordbatch.h +125 -0
  72. package/dist/prebuilt/Android-x86_64/include/ogr_spatialref.h +1007 -0
  73. package/dist/prebuilt/Android-x86_64/include/ogr_srs_api.h +1088 -0
  74. package/dist/prebuilt/Android-x86_64/include/ogr_swq.h +529 -0
  75. package/dist/prebuilt/Android-x86_64/include/ogrsf_frmts.h +746 -0
  76. package/dist/prebuilt/Android-x86_64/include/rawdataset.h +255 -0
  77. package/dist/prebuilt/Android-x86_64/include/vrtdataset.h +2426 -0
  78. package/dist/prebuilt/Android-x86_64/lib/cmake/gdal/GDAL-targets-release.cmake +19 -0
  79. package/dist/prebuilt/Android-x86_64/lib/cmake/gdal/GDAL-targets.cmake +106 -0
  80. package/dist/prebuilt/Android-x86_64/lib/cmake/gdal/GDALConfig.cmake +21 -0
  81. package/dist/prebuilt/Android-x86_64/lib/cmake/gdal/GDALConfigVersion.cmake +85 -0
  82. package/dist/prebuilt/Android-x86_64/lib/gdalplugins/drivers.ini +290 -0
  83. package/dist/prebuilt/Android-x86_64/lib/libgdal.so +0 -0
  84. package/dist/prebuilt/Android-x86_64/lib/pkgconfig/gdal.pc +17 -0
  85. package/dist/prebuilt/Android-x86_64/share/gdal/GDALLogoBW.svg +138 -0
  86. package/dist/prebuilt/Android-x86_64/share/gdal/GDALLogoColor.svg +126 -0
  87. package/dist/prebuilt/Android-x86_64/share/gdal/GDALLogoGS.svg +126 -0
  88. package/dist/prebuilt/Android-x86_64/share/gdal/LICENSE.TXT +467 -0
  89. package/dist/prebuilt/Android-x86_64/share/gdal/MM_m_idofic.csv +321 -0
  90. package/dist/prebuilt/Android-x86_64/share/gdal/cubewerx_extra.wkt +48 -0
  91. package/dist/prebuilt/Android-x86_64/share/gdal/default.rsc +0 -0
  92. package/dist/prebuilt/Android-x86_64/share/gdal/ecw_cs.wkt +1453 -0
  93. package/dist/prebuilt/Android-x86_64/share/gdal/epsg.wkt +1 -0
  94. package/dist/prebuilt/Android-x86_64/share/gdal/esri_StatePlane_extra.wkt +631 -0
  95. package/dist/prebuilt/Android-x86_64/share/gdal/gdalicon.png +0 -0
  96. package/dist/prebuilt/Android-x86_64/share/gdal/gdalinfo_output.schema.json +346 -0
  97. package/dist/prebuilt/Android-x86_64/share/gdal/gdalmdiminfo_output.schema.json +321 -0
  98. package/dist/prebuilt/Android-x86_64/share/gdal/gdaltileindex.xsd +253 -0
  99. package/dist/prebuilt/Android-x86_64/share/gdal/gdalvrt.xsd +887 -0
  100. package/dist/prebuilt/Android-x86_64/share/gdal/gfs.xsd +246 -0
  101. package/dist/prebuilt/Android-x86_64/share/gdal/gml_registry.xml +117 -0
  102. package/dist/prebuilt/Android-x86_64/share/gdal/gml_registry.xsd +66 -0
  103. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_center.csv +251 -0
  104. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_process.csv +102 -0
  105. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_subcenter.csv +63 -0
  106. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_0.csv +261 -0
  107. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_1.csv +261 -0
  108. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_13.csv +261 -0
  109. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_14.csv +261 -0
  110. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_15.csv +261 -0
  111. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_16.csv +261 -0
  112. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_17.csv +11 -0
  113. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_18.csv +261 -0
  114. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_19.csv +261 -0
  115. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_190.csv +261 -0
  116. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_191.csv +261 -0
  117. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_2.csv +261 -0
  118. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_20.csv +261 -0
  119. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_21.csv +261 -0
  120. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_3.csv +261 -0
  121. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_4.csv +261 -0
  122. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_5.csv +261 -0
  123. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_6.csv +261 -0
  124. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_0_7.csv +261 -0
  125. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_10_0.csv +261 -0
  126. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_10_1.csv +261 -0
  127. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_10_191.csv +261 -0
  128. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_10_2.csv +261 -0
  129. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_10_3.csv +261 -0
  130. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_10_4.csv +261 -0
  131. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_1_0.csv +261 -0
  132. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_1_1.csv +261 -0
  133. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_1_2.csv +261 -0
  134. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_20_0.csv +261 -0
  135. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_20_1.csv +261 -0
  136. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_20_2.csv +261 -0
  137. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_2_0.csv +261 -0
  138. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_2_3.csv +261 -0
  139. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_2_4.csv +261 -0
  140. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_2_5.csv +261 -0
  141. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_2_6.csv +261 -0
  142. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_3_0.csv +261 -0
  143. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_3_1.csv +261 -0
  144. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_3_2.csv +28 -0
  145. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_3_3.csv +8 -0
  146. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_3_4.csv +14 -0
  147. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_3_5.csv +11 -0
  148. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_3_6.csv +11 -0
  149. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_4_0.csv +261 -0
  150. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_4_1.csv +261 -0
  151. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_4_10.csv +261 -0
  152. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_4_2.csv +261 -0
  153. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_4_3.csv +261 -0
  154. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_4_4.csv +261 -0
  155. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_4_5.csv +261 -0
  156. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_4_6.csv +261 -0
  157. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_4_7.csv +261 -0
  158. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_4_8.csv +261 -0
  159. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_4_9.csv +261 -0
  160. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_local_Canada.csv +5 -0
  161. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_local_HPC.csv +2 -0
  162. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_local_MRMS.csv +175 -0
  163. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_local_NCEP.csv +401 -0
  164. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_local_NDFD.csv +38 -0
  165. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_2_local_index.csv +7 -0
  166. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_4_5.csv +261 -0
  167. package/dist/prebuilt/Android-x86_64/share/gdal/grib2_table_versions.csv +3 -0
  168. package/dist/prebuilt/Android-x86_64/share/gdal/gt_datum.csv +229 -0
  169. package/dist/prebuilt/Android-x86_64/share/gdal/gt_ellips.csv +24 -0
  170. package/dist/prebuilt/Android-x86_64/share/gdal/header.dxf +1124 -0
  171. package/dist/prebuilt/Android-x86_64/share/gdal/inspire_cp_BasicPropertyUnit.gfs +57 -0
  172. package/dist/prebuilt/Android-x86_64/share/gdal/inspire_cp_CadastralBoundary.gfs +60 -0
  173. package/dist/prebuilt/Android-x86_64/share/gdal/inspire_cp_CadastralParcel.gfs +81 -0
  174. package/dist/prebuilt/Android-x86_64/share/gdal/inspire_cp_CadastralZoning.gfs +161 -0
  175. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_AdmArea.gfs +59 -0
  176. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_AdmBdry.gfs +49 -0
  177. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_AdmPt.gfs +59 -0
  178. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_BldA.gfs +54 -0
  179. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_BldL.gfs +54 -0
  180. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_Cntr.gfs +54 -0
  181. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_CommBdry.gfs +49 -0
  182. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_CommPt.gfs +59 -0
  183. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_Cstline.gfs +54 -0
  184. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_ElevPt.gfs +54 -0
  185. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_GCP.gfs +94 -0
  186. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_LeveeEdge.gfs +49 -0
  187. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_RailCL.gfs +54 -0
  188. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_RdASL.gfs +44 -0
  189. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_RdArea.gfs +54 -0
  190. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_RdCompt.gfs +59 -0
  191. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_RdEdg.gfs +59 -0
  192. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_RdMgtBdry.gfs +49 -0
  193. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_RdSgmtA.gfs +59 -0
  194. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_RvrMgtBdry.gfs +49 -0
  195. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_SBAPt.gfs +49 -0
  196. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_SBArea.gfs +54 -0
  197. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_SBBdry.gfs +44 -0
  198. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_WA.gfs +54 -0
  199. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_WL.gfs +54 -0
  200. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_WStrA.gfs +54 -0
  201. package/dist/prebuilt/Android-x86_64/share/gdal/jpfgdgml_WStrL.gfs +54 -0
  202. package/dist/prebuilt/Android-x86_64/share/gdal/nitf_spec.xml +3290 -0
  203. package/dist/prebuilt/Android-x86_64/share/gdal/nitf_spec.xsd +173 -0
  204. package/dist/prebuilt/Android-x86_64/share/gdal/ogrinfo_output.schema.json +528 -0
  205. package/dist/prebuilt/Android-x86_64/share/gdal/ogrvrt.xsd +530 -0
  206. package/dist/prebuilt/Android-x86_64/share/gdal/osmconf.ini +134 -0
  207. package/dist/prebuilt/Android-x86_64/share/gdal/ozi_datum.csv +131 -0
  208. package/dist/prebuilt/Android-x86_64/share/gdal/ozi_ellips.csv +35 -0
  209. package/dist/prebuilt/Android-x86_64/share/gdal/pci_datum.txt +530 -0
  210. package/dist/prebuilt/Android-x86_64/share/gdal/pci_ellips.txt +129 -0
  211. package/dist/prebuilt/Android-x86_64/share/gdal/pdfcomposition.xsd +705 -0
  212. package/dist/prebuilt/Android-x86_64/share/gdal/ruian_vf_ob_v1.gfs +1455 -0
  213. package/dist/prebuilt/Android-x86_64/share/gdal/ruian_vf_st_uvoh_v1.gfs +86 -0
  214. package/dist/prebuilt/Android-x86_64/share/gdal/ruian_vf_st_v1.gfs +1489 -0
  215. package/dist/prebuilt/Android-x86_64/share/gdal/ruian_vf_v1.gfs +2126 -0
  216. package/dist/prebuilt/Android-x86_64/share/gdal/s57agencies.csv +249 -0
  217. package/dist/prebuilt/Android-x86_64/share/gdal/s57attributes.csv +484 -0
  218. package/dist/prebuilt/Android-x86_64/share/gdal/s57expectedinput.csv +1008 -0
  219. package/dist/prebuilt/Android-x86_64/share/gdal/s57objectclasses.csv +287 -0
  220. package/dist/prebuilt/Android-x86_64/share/gdal/seed_2d.dgn +0 -0
  221. package/dist/prebuilt/Android-x86_64/share/gdal/seed_3d.dgn +0 -0
  222. package/dist/prebuilt/Android-x86_64/share/gdal/stateplane.csv +259 -0
  223. package/dist/prebuilt/Android-x86_64/share/gdal/tms_LINZAntarticaMapTileGrid.json +190 -0
  224. package/dist/prebuilt/Android-x86_64/share/gdal/tms_MapML_APSTILE.json +268 -0
  225. package/dist/prebuilt/Android-x86_64/share/gdal/tms_MapML_CBMTILE.json +346 -0
  226. package/dist/prebuilt/Android-x86_64/share/gdal/tms_NZTM2000.json +243 -0
  227. package/dist/prebuilt/Android-x86_64/share/gdal/trailer.dxf +434 -0
  228. package/dist/prebuilt/Android-x86_64/share/gdal/vdv452.xml +351 -0
  229. package/dist/prebuilt/Android-x86_64/share/gdal/vdv452.xsd +47 -0
  230. package/dist/prebuilt/Emscripten-x86_64/include/gdal_version.h +3 -3
  231. package/dist/prebuilt/Emscripten-x86_64/include/ogr_api.h +4 -4
  232. package/dist/prebuilt/Emscripten-x86_64/include/ogr_feature.h +2 -2
  233. package/dist/prebuilt/Emscripten-x86_64/lib/cmake/gdal/GDALConfigVersion.cmake +3 -3
  234. package/dist/prebuilt/Emscripten-x86_64/lib/cmake/gdal/thirdparty/FindDotnet.cmake +33 -36
  235. package/dist/prebuilt/Emscripten-x86_64/lib/libgdal.a +0 -0
  236. package/dist/prebuilt/Emscripten-x86_64/lib/pkgconfig/gdal.pc +1 -1
  237. package/dist/prebuilt/Emscripten-x86_64/share/gdal/gdalvrt.xsd +30 -24
  238. package/dist/prebuilt/iOS-iphoneos/include/gdal_version.h +3 -3
  239. package/dist/prebuilt/iOS-iphoneos/include/ogr_api.h +4 -4
  240. package/dist/prebuilt/iOS-iphoneos/include/ogr_feature.h +2 -2
  241. package/dist/prebuilt/iOS-iphoneos/share/gdal/gdalvrt.xsd +30 -24
  242. package/dist/prebuilt/iOS-iphonesimulator/include/gdal_version.h +3 -3
  243. package/dist/prebuilt/iOS-iphonesimulator/include/ogr_api.h +4 -4
  244. package/dist/prebuilt/iOS-iphonesimulator/include/ogr_feature.h +2 -2
  245. package/dist/prebuilt/iOS-iphonesimulator/share/gdal/gdalvrt.xsd +30 -24
  246. package/gdal.xcframework/ios-arm64_arm64e/Headers/gdal_version.h +3 -3
  247. package/gdal.xcframework/ios-arm64_arm64e/Headers/ogr_api.h +4 -4
  248. package/gdal.xcframework/ios-arm64_arm64e/Headers/ogr_feature.h +2 -2
  249. package/gdal.xcframework/ios-arm64_arm64e/libgdal.a +0 -0
  250. package/gdal.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/gdal_version.h +3 -3
  251. package/gdal.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/ogr_api.h +4 -4
  252. package/gdal.xcframework/ios-arm64_arm64e_x86_64-simulator/Headers/ogr_feature.h +2 -2
  253. package/gdal.xcframework/ios-arm64_arm64e_x86_64-simulator/libgdal.a +0 -0
  254. package/package.json +13 -13
  255. package/dist/prebuilt/Emscripten-x86_64/lib/cmake/gdal/packages/FindDB2.cmake +0 -103
@@ -0,0 +1,1981 @@
1
+ /******************************************************************************
2
+ * $Id$
3
+ *
4
+ * Project: OpenGIS Simple Features Reference Implementation
5
+ * Purpose: Class for representing a whole feature, and layer schemas.
6
+ * Author: Frank Warmerdam, warmerdam@pobox.com
7
+ *
8
+ ******************************************************************************
9
+ * Copyright (c) 1999, Les Technologies SoftMap Inc.
10
+ * Copyright (c) 2008-2013, Even Rouault <even dot rouault at spatialys.com>
11
+ *
12
+ * SPDX-License-Identifier: MIT
13
+ ****************************************************************************/
14
+
15
+ #ifndef OGR_FEATURE_H_INCLUDED
16
+ #define OGR_FEATURE_H_INCLUDED
17
+
18
+ #include "cpl_atomic_ops.h"
19
+ #include "ogr_featurestyle.h"
20
+ #include "ogr_geometry.h"
21
+ #include "ogr_geomcoordinateprecision.h"
22
+
23
+ #include <cstddef>
24
+
25
+ #include <exception>
26
+ #include <memory>
27
+ #include <string>
28
+ #include <vector>
29
+
30
+ /**
31
+ * \file ogr_feature.h
32
+ *
33
+ * Simple feature classes.
34
+ */
35
+
36
+ #ifndef DEFINE_OGRFeatureH
37
+ /*! @cond Doxygen_Suppress */
38
+ #define DEFINE_OGRFeatureH
39
+ /*! @endcond */
40
+ #ifdef DEBUG
41
+ typedef struct OGRFieldDefnHS *OGRFieldDefnH;
42
+ typedef struct OGRFeatureDefnHS *OGRFeatureDefnH;
43
+ typedef struct OGRFeatureHS *OGRFeatureH;
44
+ typedef struct OGRStyleTableHS *OGRStyleTableH;
45
+ #else
46
+ /** Opaque type for a field definition (OGRFieldDefn) */
47
+ typedef void *OGRFieldDefnH;
48
+ /** Opaque type for a feature definition (OGRFeatureDefn) */
49
+ typedef void *OGRFeatureDefnH;
50
+ /** Opaque type for a feature (OGRFeature) */
51
+ typedef void *OGRFeatureH;
52
+ /** Opaque type for a style table (OGRStyleTable) */
53
+ typedef void *OGRStyleTableH;
54
+ #endif
55
+ /** Opaque type for a geometry field definition (OGRGeomFieldDefn) */
56
+ typedef struct OGRGeomFieldDefnHS *OGRGeomFieldDefnH;
57
+
58
+ /** Opaque type for a field domain definition (OGRFieldDomain) */
59
+ typedef struct OGRFieldDomainHS *OGRFieldDomainH;
60
+ #endif /* DEFINE_OGRFeatureH */
61
+
62
+ class OGRStyleTable;
63
+
64
+ /************************************************************************/
65
+ /* OGRFieldDefn */
66
+ /************************************************************************/
67
+
68
+ /**
69
+ * Definition of an attribute of an OGRFeatureDefn. A field is described by :
70
+ * <ul>
71
+ * <li>a name. See SetName() / GetNameRef()</li>
72
+ * <li>an alternative name (optional): alternative descriptive name for the
73
+ * field (sometimes referred to as an "alias"). See SetAlternativeName() /
74
+ * GetAlternativeNameRef()</li> <li>a type: OFTString, OFTInteger, OFTReal, ...
75
+ * See SetType() / GetType()</li> <li>a subtype (optional): OFSTBoolean, ... See
76
+ * SetSubType() / GetSubType()</li> <li>a width (optional): maximal number of
77
+ * characters. See SetWidth() / GetWidth()</li> <li>a precision (optional):
78
+ * number of digits after decimal point. See SetPrecision() /
79
+ * GetPrecision()</li> <li>a NOT NULL constraint (optional). See SetNullable() /
80
+ * IsNullable()</li> <li>a UNIQUE constraint (optional). See SetUnique() /
81
+ * IsUnique()</li> <li>a default value (optional). See SetDefault() /
82
+ * GetDefault()</li> <li>a boolean to indicate whether it should be ignored when
83
+ * retrieving features. See SetIgnored() / IsIgnored()</li> <li>a field domain
84
+ * name (optional). See SetDomainName() / Get DomainName()</li>
85
+ * </ul>
86
+ *
87
+ * Note that once a OGRFieldDefn has been added to a layer definition with
88
+ * OGRLayer::AddFieldDefn(), its setter methods should not be called on the
89
+ * object returned with OGRLayer::GetLayerDefn()->GetFieldDefn(). Instead,
90
+ * OGRLayer::AlterFieldDefn() should be called on a new instance of
91
+ * OGRFieldDefn, for drivers that support AlterFieldDefn().
92
+ */
93
+
94
+ class CPL_DLL OGRFieldDefn
95
+ {
96
+ private:
97
+ char *pszName;
98
+ char *pszAlternativeName;
99
+ OGRFieldType eType;
100
+ OGRJustification eJustify;
101
+ int nWidth; // Zero is variable.
102
+ int nPrecision;
103
+ char *pszDefault;
104
+
105
+ int bIgnore;
106
+ OGRFieldSubType eSubType;
107
+
108
+ int bNullable;
109
+ int bUnique;
110
+
111
+ std::string m_osDomainName{}; // field domain name. Might be empty
112
+
113
+ std::string m_osComment{}; // field comment. Might be empty
114
+
115
+ int m_nTZFlag = OGR_TZFLAG_UNKNOWN;
116
+ bool m_bSealed = false;
117
+
118
+ public:
119
+ OGRFieldDefn(const char *, OGRFieldType);
120
+ explicit OGRFieldDefn(const OGRFieldDefn *);
121
+ ~OGRFieldDefn();
122
+
123
+ void SetName(const char *);
124
+
125
+ const char *GetNameRef() const
126
+ {
127
+ return pszName;
128
+ }
129
+
130
+ void SetAlternativeName(const char *);
131
+
132
+ const char *GetAlternativeNameRef() const
133
+ {
134
+ return pszAlternativeName;
135
+ }
136
+
137
+ OGRFieldType GetType() const
138
+ {
139
+ return eType;
140
+ }
141
+
142
+ void SetType(OGRFieldType eTypeIn);
143
+ static const char *GetFieldTypeName(OGRFieldType);
144
+
145
+ OGRFieldSubType GetSubType() const
146
+ {
147
+ return eSubType;
148
+ }
149
+
150
+ void SetSubType(OGRFieldSubType eSubTypeIn);
151
+ static const char *GetFieldSubTypeName(OGRFieldSubType);
152
+
153
+ OGRJustification GetJustify() const
154
+ {
155
+ return eJustify;
156
+ }
157
+
158
+ void SetJustify(OGRJustification eJustifyIn)
159
+ {
160
+ eJustify = eJustifyIn;
161
+ }
162
+
163
+ int GetWidth() const
164
+ {
165
+ return nWidth;
166
+ }
167
+
168
+ void SetWidth(int nWidthIn);
169
+
170
+ int GetPrecision() const
171
+ {
172
+ return nPrecision;
173
+ }
174
+
175
+ void SetPrecision(int nPrecisionIn);
176
+
177
+ int GetTZFlag() const
178
+ {
179
+ return m_nTZFlag;
180
+ }
181
+
182
+ void SetTZFlag(int nTZFlag);
183
+
184
+ void Set(const char *, OGRFieldType, int = 0, int = 0,
185
+ OGRJustification = OJUndefined);
186
+
187
+ void SetDefault(const char *);
188
+ const char *GetDefault() const;
189
+ int IsDefaultDriverSpecific() const;
190
+
191
+ int IsIgnored() const
192
+ {
193
+ return bIgnore;
194
+ }
195
+
196
+ void SetIgnored(int bIgnoreIn)
197
+ {
198
+ bIgnore = bIgnoreIn;
199
+ }
200
+
201
+ int IsNullable() const
202
+ {
203
+ return bNullable;
204
+ }
205
+
206
+ void SetNullable(int bNullableIn);
207
+
208
+ int IsUnique() const
209
+ {
210
+ return bUnique;
211
+ }
212
+
213
+ void SetUnique(int bUniqueIn);
214
+
215
+ const std::string &GetDomainName() const
216
+ {
217
+ return m_osDomainName;
218
+ }
219
+
220
+ void SetDomainName(const std::string &osDomainName);
221
+
222
+ const std::string &GetComment() const
223
+ {
224
+ return m_osComment;
225
+ }
226
+
227
+ void SetComment(const std::string &osComment);
228
+
229
+ int IsSame(const OGRFieldDefn *) const;
230
+
231
+ /** Convert a OGRFieldDefn* to a OGRFieldDefnH.
232
+ * @since GDAL 2.3
233
+ */
234
+ static inline OGRFieldDefnH ToHandle(OGRFieldDefn *poFieldDefn)
235
+ {
236
+ return reinterpret_cast<OGRFieldDefnH>(poFieldDefn);
237
+ }
238
+
239
+ /** Convert a OGRFieldDefnH to a OGRFieldDefn*.
240
+ * @since GDAL 2.3
241
+ */
242
+ static inline OGRFieldDefn *FromHandle(OGRFieldDefnH hFieldDefn)
243
+ {
244
+ return reinterpret_cast<OGRFieldDefn *>(hFieldDefn);
245
+ }
246
+
247
+ void Seal();
248
+
249
+ void Unseal();
250
+
251
+ /*! @cond Doxygen_Suppress */
252
+ struct CPL_DLL TemporaryUnsealer
253
+ {
254
+ private:
255
+ OGRFieldDefn *m_poFieldDefn = nullptr;
256
+ CPL_DISALLOW_COPY_ASSIGN(TemporaryUnsealer)
257
+ public:
258
+ explicit TemporaryUnsealer(OGRFieldDefn *poFieldDefn)
259
+ : m_poFieldDefn(poFieldDefn)
260
+ {
261
+ m_poFieldDefn->Unseal();
262
+ }
263
+
264
+ TemporaryUnsealer(TemporaryUnsealer &&) = default;
265
+ TemporaryUnsealer &operator=(TemporaryUnsealer &&) = default;
266
+
267
+ ~TemporaryUnsealer()
268
+ {
269
+ m_poFieldDefn->Seal();
270
+ }
271
+
272
+ OGRFieldDefn *operator->()
273
+ {
274
+ return m_poFieldDefn;
275
+ }
276
+ };
277
+
278
+ /*! @endcond */
279
+
280
+ TemporaryUnsealer GetTemporaryUnsealer();
281
+
282
+ private:
283
+ CPL_DISALLOW_COPY_ASSIGN(OGRFieldDefn)
284
+ };
285
+
286
+ #ifdef GDAL_COMPILATION
287
+ /** Return an object that temporary unseals the OGRFieldDefn.
288
+ *
289
+ * The returned object calls Unseal() initially, and when it is destroyed
290
+ * it calls Seal().
291
+ *
292
+ * This method should only be called by driver implementations.
293
+ *
294
+ * Usage: whileUnsealing(poFieldDefn)->some_method();
295
+ *
296
+ * @since GDAL 3.9
297
+ */
298
+ inline OGRFieldDefn::TemporaryUnsealer whileUnsealing(OGRFieldDefn *object)
299
+ {
300
+ return object->GetTemporaryUnsealer();
301
+ }
302
+ #endif
303
+
304
+ /************************************************************************/
305
+ /* OGRGeomFieldDefn */
306
+ /************************************************************************/
307
+
308
+ /**
309
+ * Definition of a geometry field of an OGRFeatureDefn. A geometry field is
310
+ * described by :
311
+ * <ul>
312
+ * <li>a name. See SetName() / GetNameRef()</li>
313
+ * <li>a type: wkbPoint, wkbLineString, ... See SetType() / GetType()</li>
314
+ * <li>a spatial reference system (optional). See SetSpatialRef() /
315
+ * GetSpatialRef()</li> <li>a NOT NULL constraint (optional). See SetNullable()
316
+ * / IsNullable()</li> <li>a boolean to indicate whether it should be ignored
317
+ * when retrieving features. See SetIgnored() / IsIgnored()</li>
318
+ * </ul>
319
+ *
320
+ * Note that once a OGRGeomFieldDefn has been added to a layer definition with
321
+ * OGRLayer::AddGeomFieldDefn(), its setter methods should not be called on the
322
+ * object returned with OGRLayer::GetLayerDefn()->GetGeomFieldDefn(). Instead,
323
+ * OGRLayer::AlterGeomFieldDefn() should be called on a new instance of
324
+ * OGRFieldDefn, for drivers that support AlterFieldDefn().
325
+ *
326
+ * @since OGR 1.11
327
+ */
328
+
329
+ class CPL_DLL OGRGeomFieldDefn
330
+ {
331
+ protected:
332
+ //! @cond Doxygen_Suppress
333
+ char *pszName = nullptr;
334
+ OGRwkbGeometryType eGeomType =
335
+ wkbUnknown; /* all values possible except wkbNone */
336
+ mutable const OGRSpatialReference *poSRS = nullptr;
337
+
338
+ int bIgnore = false;
339
+ mutable int bNullable = true;
340
+ bool m_bSealed = false;
341
+ OGRGeomCoordinatePrecision m_oCoordPrecision{};
342
+
343
+ void Initialize(const char *, OGRwkbGeometryType);
344
+ //! @endcond
345
+
346
+ public:
347
+ OGRGeomFieldDefn(const char *pszNameIn, OGRwkbGeometryType eGeomTypeIn);
348
+ explicit OGRGeomFieldDefn(const OGRGeomFieldDefn *);
349
+ virtual ~OGRGeomFieldDefn();
350
+
351
+ void SetName(const char *);
352
+
353
+ const char *GetNameRef() const
354
+ {
355
+ return pszName;
356
+ }
357
+
358
+ OGRwkbGeometryType GetType() const
359
+ {
360
+ return eGeomType;
361
+ }
362
+
363
+ void SetType(OGRwkbGeometryType eTypeIn);
364
+
365
+ virtual const OGRSpatialReference *GetSpatialRef() const;
366
+ void SetSpatialRef(const OGRSpatialReference *poSRSIn);
367
+
368
+ int IsIgnored() const
369
+ {
370
+ return bIgnore;
371
+ }
372
+
373
+ void SetIgnored(int bIgnoreIn)
374
+ {
375
+ bIgnore = bIgnoreIn;
376
+ }
377
+
378
+ int IsNullable() const
379
+ {
380
+ return bNullable;
381
+ }
382
+
383
+ void SetNullable(int bNullableIn);
384
+
385
+ const OGRGeomCoordinatePrecision &GetCoordinatePrecision() const
386
+ {
387
+ return m_oCoordPrecision;
388
+ }
389
+
390
+ void SetCoordinatePrecision(const OGRGeomCoordinatePrecision &prec);
391
+
392
+ int IsSame(const OGRGeomFieldDefn *) const;
393
+
394
+ /** Convert a OGRGeomFieldDefn* to a OGRGeomFieldDefnH.
395
+ * @since GDAL 2.3
396
+ */
397
+ static inline OGRGeomFieldDefnH ToHandle(OGRGeomFieldDefn *poGeomFieldDefn)
398
+ {
399
+ return reinterpret_cast<OGRGeomFieldDefnH>(poGeomFieldDefn);
400
+ }
401
+
402
+ /** Convert a OGRGeomFieldDefnH to a OGRGeomFieldDefn*.
403
+ * @since GDAL 2.3
404
+ */
405
+ static inline OGRGeomFieldDefn *FromHandle(OGRGeomFieldDefnH hGeomFieldDefn)
406
+ {
407
+ return reinterpret_cast<OGRGeomFieldDefn *>(hGeomFieldDefn);
408
+ }
409
+
410
+ void Seal();
411
+
412
+ void Unseal();
413
+
414
+ /*! @cond Doxygen_Suppress */
415
+ struct CPL_DLL TemporaryUnsealer
416
+ {
417
+ private:
418
+ OGRGeomFieldDefn *m_poFieldDefn = nullptr;
419
+ CPL_DISALLOW_COPY_ASSIGN(TemporaryUnsealer)
420
+ public:
421
+ explicit TemporaryUnsealer(OGRGeomFieldDefn *poFieldDefn)
422
+ : m_poFieldDefn(poFieldDefn)
423
+ {
424
+ m_poFieldDefn->Unseal();
425
+ }
426
+
427
+ TemporaryUnsealer(TemporaryUnsealer &&) = default;
428
+ TemporaryUnsealer &operator=(TemporaryUnsealer &&) = default;
429
+
430
+ ~TemporaryUnsealer()
431
+ {
432
+ m_poFieldDefn->Seal();
433
+ }
434
+
435
+ OGRGeomFieldDefn *operator->()
436
+ {
437
+ return m_poFieldDefn;
438
+ }
439
+ };
440
+
441
+ /*! @endcond */
442
+
443
+ TemporaryUnsealer GetTemporaryUnsealer();
444
+
445
+ private:
446
+ CPL_DISALLOW_COPY_ASSIGN(OGRGeomFieldDefn)
447
+ };
448
+
449
+ #ifdef GDAL_COMPILATION
450
+ /** Return an object that temporary unseals the OGRGeomFieldDefn.
451
+ *
452
+ * The returned object calls Unseal() initially, and when it is destroyed
453
+ * it calls Seal().
454
+ *
455
+ * This method should only be called by driver implementations.
456
+ *
457
+ * Usage: whileUnsealing(poGeomFieldDefn)->some_method();
458
+ *
459
+ * @since GDAL 3.9
460
+ */
461
+ inline OGRGeomFieldDefn::TemporaryUnsealer
462
+ whileUnsealing(OGRGeomFieldDefn *object)
463
+ {
464
+ return object->GetTemporaryUnsealer();
465
+ }
466
+ #endif
467
+
468
+ /************************************************************************/
469
+ /* OGRFeatureDefn */
470
+ /************************************************************************/
471
+
472
+ /**
473
+ * Definition of a feature class or feature layer.
474
+ *
475
+ * This object contains schema information for a set of OGRFeatures. In
476
+ * table based systems, an OGRFeatureDefn is essentially a layer. In more
477
+ * object oriented approaches (such as SF CORBA) this can represent a class
478
+ * of features but doesn't necessarily relate to all of a layer, or just one
479
+ * layer.
480
+ *
481
+ * This object also can contain some other information such as a name and
482
+ * potentially other metadata.
483
+ *
484
+ * It is essentially a collection of field descriptions (OGRFieldDefn class).
485
+ * Starting with GDAL 1.11, in addition to attribute fields, it can also
486
+ * contain multiple geometry fields (OGRGeomFieldDefn class).
487
+ *
488
+ * It is reasonable for different translators to derive classes from
489
+ * OGRFeatureDefn with additional translator specific information.
490
+ *
491
+ * Note that adding, modifying, removing, reordering a OGRFieldDefn (or a
492
+ * OGRGeomFieldDefn) from/to a OGRFeatureDefn that belongs to a OGRLayer should
493
+ * not be done through the OGRFeatureDefn::AddFieldDefn(),
494
+ * OGRFeatureDefn::DeleteFieldDefn() or OGRFeatureDefn::ReorderFieldDefns()
495
+ * methods, but rather through OGRLayer::CreateField(),
496
+ * OGRLayer::AlterFieldDefn() or OGRLayer::ReorderFields(), for drivers that
497
+ * support those operations.
498
+ */
499
+
500
+ class CPL_DLL OGRFeatureDefn
501
+ {
502
+ protected:
503
+ //! @cond Doxygen_Suppress
504
+ volatile int nRefCount = 0;
505
+
506
+ mutable std::vector<std::unique_ptr<OGRFieldDefn>> apoFieldDefn{};
507
+ mutable std::vector<std::unique_ptr<OGRGeomFieldDefn>> apoGeomFieldDefn{};
508
+
509
+ char *pszFeatureClassName = nullptr;
510
+
511
+ bool bIgnoreStyle = false;
512
+
513
+ friend class TemporaryUnsealer;
514
+ bool m_bSealed = false;
515
+ int m_nTemporaryUnsealCount = 0;
516
+ //! @endcond
517
+
518
+ public:
519
+ explicit OGRFeatureDefn(const char *pszName = nullptr);
520
+ virtual ~OGRFeatureDefn();
521
+
522
+ void SetName(const char *pszName);
523
+ virtual const char *GetName() const;
524
+
525
+ virtual int GetFieldCount() const;
526
+ virtual OGRFieldDefn *GetFieldDefn(int i);
527
+ virtual const OGRFieldDefn *GetFieldDefn(int i) const;
528
+ virtual int GetFieldIndex(const char *) const;
529
+ int GetFieldIndexCaseSensitive(const char *) const;
530
+
531
+ //! @cond Doxygen_Suppress
532
+ /** Helper class to iterate over non-geometry fields.
533
+ *
534
+ * Note: fields should not be added or removed while iterating over them.
535
+ */
536
+ struct CPL_DLL Fields
537
+ {
538
+ private:
539
+ OGRFeatureDefn *m_poFDefn;
540
+
541
+ public:
542
+ inline explicit Fields(OGRFeatureDefn *poFDefn) : m_poFDefn(poFDefn)
543
+ {
544
+ }
545
+
546
+ struct CPL_DLL ConstIterator
547
+ {
548
+ private:
549
+ OGRFeatureDefn *m_poFDefn;
550
+ int m_nIdx;
551
+
552
+ public:
553
+ inline ConstIterator(OGRFeatureDefn *poFDefn, int nIdx)
554
+ : m_poFDefn(poFDefn), m_nIdx(nIdx)
555
+ {
556
+ }
557
+
558
+ inline const OGRFieldDefn *operator*() const
559
+ {
560
+ return m_poFDefn->GetFieldDefn(m_nIdx);
561
+ }
562
+
563
+ inline ConstIterator &operator++()
564
+ {
565
+ m_nIdx++;
566
+ return *this;
567
+ }
568
+
569
+ inline bool operator!=(const ConstIterator &it) const
570
+ {
571
+ return m_nIdx != it.m_nIdx;
572
+ }
573
+ };
574
+
575
+ inline ConstIterator begin()
576
+ {
577
+ return ConstIterator(m_poFDefn, 0);
578
+ }
579
+
580
+ inline ConstIterator end()
581
+ {
582
+ return ConstIterator(m_poFDefn, m_poFDefn->GetFieldCount());
583
+ }
584
+
585
+ inline size_t size() const
586
+ {
587
+ return static_cast<std::size_t>(m_poFDefn->GetFieldCount());
588
+ }
589
+
590
+ inline OGRFieldDefn *operator[](size_t i)
591
+ {
592
+ return m_poFDefn->GetFieldDefn(static_cast<int>(i));
593
+ }
594
+
595
+ inline const OGRFieldDefn *operator[](size_t i) const
596
+ {
597
+ return m_poFDefn->GetFieldDefn(static_cast<int>(i));
598
+ }
599
+ };
600
+
601
+ //! @endcond
602
+
603
+ /** Return an object that can be used to iterate over non-geometry fields.
604
+ \verbatim
605
+ for( const auto* poFieldDefn: poFeatureDefn->GetFields() )
606
+ {
607
+ // do something
608
+ }
609
+ \endverbatim
610
+
611
+ @since GDAL 3.7
612
+ */
613
+ inline Fields GetFields()
614
+ {
615
+ return Fields(this);
616
+ }
617
+
618
+ //! @cond Doxygen_Suppress
619
+ // That method should only be called if there's a guarantee that
620
+ // GetFieldCount() has been called before
621
+ int GetFieldCountUnsafe() const
622
+ {
623
+ return static_cast<int>(apoFieldDefn.size());
624
+ }
625
+
626
+ // Those methods don't check i is n range.
627
+ OGRFieldDefn *GetFieldDefnUnsafe(int i)
628
+ {
629
+ if (apoFieldDefn.empty())
630
+ GetFieldDefn(i);
631
+ return apoFieldDefn[static_cast<std::size_t>(i)].get();
632
+ }
633
+
634
+ const OGRFieldDefn *GetFieldDefnUnsafe(int i) const
635
+ {
636
+ if (apoFieldDefn.empty())
637
+ GetFieldDefn(i);
638
+ return apoFieldDefn[static_cast<std::size_t>(i)].get();
639
+ }
640
+
641
+ //! @endcond
642
+
643
+ virtual void AddFieldDefn(const OGRFieldDefn *);
644
+ virtual OGRErr DeleteFieldDefn(int iField);
645
+ virtual OGRErr ReorderFieldDefns(const int *panMap);
646
+
647
+ virtual int GetGeomFieldCount() const;
648
+ virtual OGRGeomFieldDefn *GetGeomFieldDefn(int i);
649
+ virtual const OGRGeomFieldDefn *GetGeomFieldDefn(int i) const;
650
+ virtual int GetGeomFieldIndex(const char *) const;
651
+
652
+ //! @cond Doxygen_Suppress
653
+ /** Helper class to iterate over geometry fields.
654
+ *
655
+ * Note: fields should not be added or removed while iterating over them.
656
+ */
657
+ struct CPL_DLL GeomFields
658
+ {
659
+ private:
660
+ OGRFeatureDefn *m_poFDefn;
661
+
662
+ public:
663
+ inline explicit GeomFields(OGRFeatureDefn *poFDefn) : m_poFDefn(poFDefn)
664
+ {
665
+ }
666
+
667
+ struct CPL_DLL ConstIterator
668
+ {
669
+ private:
670
+ OGRFeatureDefn *m_poFDefn;
671
+ int m_nIdx;
672
+
673
+ public:
674
+ inline ConstIterator(OGRFeatureDefn *poFDefn, int nIdx)
675
+ : m_poFDefn(poFDefn), m_nIdx(nIdx)
676
+ {
677
+ }
678
+
679
+ inline const OGRGeomFieldDefn *operator*() const
680
+ {
681
+ return m_poFDefn->GetGeomFieldDefn(m_nIdx);
682
+ }
683
+
684
+ inline ConstIterator &operator++()
685
+ {
686
+ m_nIdx++;
687
+ return *this;
688
+ }
689
+
690
+ inline bool operator!=(const ConstIterator &it) const
691
+ {
692
+ return m_nIdx != it.m_nIdx;
693
+ }
694
+ };
695
+
696
+ inline ConstIterator begin()
697
+ {
698
+ return ConstIterator(m_poFDefn, 0);
699
+ }
700
+
701
+ inline ConstIterator end()
702
+ {
703
+ return ConstIterator(m_poFDefn, m_poFDefn->GetGeomFieldCount());
704
+ }
705
+
706
+ inline size_t size() const
707
+ {
708
+ return static_cast<std::size_t>(m_poFDefn->GetGeomFieldCount());
709
+ }
710
+
711
+ inline OGRGeomFieldDefn *operator[](size_t i)
712
+ {
713
+ return m_poFDefn->GetGeomFieldDefn(static_cast<int>(i));
714
+ }
715
+
716
+ inline const OGRGeomFieldDefn *operator[](size_t i) const
717
+ {
718
+ return m_poFDefn->GetGeomFieldDefn(static_cast<int>(i));
719
+ }
720
+ };
721
+
722
+ //! @endcond
723
+
724
+ /** Return an object that can be used to iterate over geometry fields.
725
+ \verbatim
726
+ for( const auto* poGeomFieldDefn: poFeatureDefn->GetGeomFields() )
727
+ {
728
+ // do something
729
+ }
730
+ \endverbatim
731
+
732
+ @since GDAL 3.7
733
+ */
734
+ inline GeomFields GetGeomFields()
735
+ {
736
+ return GeomFields(this);
737
+ }
738
+
739
+ virtual void AddGeomFieldDefn(const OGRGeomFieldDefn *);
740
+ virtual void AddGeomFieldDefn(std::unique_ptr<OGRGeomFieldDefn> &&);
741
+ virtual OGRErr DeleteGeomFieldDefn(int iGeomField);
742
+
743
+ virtual OGRwkbGeometryType GetGeomType() const;
744
+ virtual void SetGeomType(OGRwkbGeometryType);
745
+
746
+ virtual OGRFeatureDefn *Clone() const;
747
+
748
+ int Reference()
749
+ {
750
+ return CPLAtomicInc(&nRefCount);
751
+ }
752
+
753
+ int Dereference()
754
+ {
755
+ return CPLAtomicDec(&nRefCount);
756
+ }
757
+
758
+ int GetReferenceCount() const
759
+ {
760
+ return nRefCount;
761
+ }
762
+
763
+ void Release();
764
+
765
+ virtual int IsGeometryIgnored() const;
766
+ virtual void SetGeometryIgnored(int bIgnore);
767
+
768
+ virtual bool IsStyleIgnored() const
769
+ {
770
+ return bIgnoreStyle;
771
+ }
772
+
773
+ virtual void SetStyleIgnored(bool bIgnore)
774
+ {
775
+ bIgnoreStyle = bIgnore;
776
+ }
777
+
778
+ virtual int IsSame(const OGRFeatureDefn *poOtherFeatureDefn) const;
779
+
780
+ //! @cond Doxygen_Suppress
781
+ void ReserveSpaceForFields(int nFieldCountIn);
782
+ //! @endcond
783
+
784
+ std::vector<int> ComputeMapForSetFrom(const OGRFeatureDefn *poSrcFDefn,
785
+ bool bForgiving = true) const;
786
+
787
+ static OGRFeatureDefn *CreateFeatureDefn(const char *pszName = nullptr);
788
+ static void DestroyFeatureDefn(OGRFeatureDefn *);
789
+
790
+ /** Convert a OGRFeatureDefn* to a OGRFeatureDefnH.
791
+ * @since GDAL 2.3
792
+ */
793
+ static inline OGRFeatureDefnH ToHandle(OGRFeatureDefn *poFeatureDefn)
794
+ {
795
+ return reinterpret_cast<OGRFeatureDefnH>(poFeatureDefn);
796
+ }
797
+
798
+ /** Convert a OGRFeatureDefnH to a OGRFeatureDefn*.
799
+ * @since GDAL 2.3
800
+ */
801
+ static inline OGRFeatureDefn *FromHandle(OGRFeatureDefnH hFeatureDefn)
802
+ {
803
+ return reinterpret_cast<OGRFeatureDefn *>(hFeatureDefn);
804
+ }
805
+
806
+ void Seal(bool bSealFields);
807
+
808
+ void Unseal(bool bUnsealFields);
809
+
810
+ /*! @cond Doxygen_Suppress */
811
+ struct CPL_DLL TemporaryUnsealer
812
+ {
813
+ private:
814
+ OGRFeatureDefn *m_poFeatureDefn = nullptr;
815
+ bool m_bSealFields = false;
816
+ CPL_DISALLOW_COPY_ASSIGN(TemporaryUnsealer)
817
+ public:
818
+ explicit TemporaryUnsealer(OGRFeatureDefn *poFeatureDefn,
819
+ bool bSealFields);
820
+
821
+ TemporaryUnsealer(TemporaryUnsealer &&) = default;
822
+ TemporaryUnsealer &operator=(TemporaryUnsealer &&) = default;
823
+
824
+ ~TemporaryUnsealer();
825
+
826
+ OGRFeatureDefn *operator->()
827
+ {
828
+ return m_poFeatureDefn;
829
+ }
830
+ };
831
+
832
+ /*! @endcond */
833
+
834
+ TemporaryUnsealer GetTemporaryUnsealer(bool bSealFields = true);
835
+
836
+ private:
837
+ CPL_DISALLOW_COPY_ASSIGN(OGRFeatureDefn)
838
+ };
839
+
840
+ #ifdef GDAL_COMPILATION
841
+ /** Return an object that temporary unseals the OGRFeatureDefn
842
+ *
843
+ * The returned object calls Unseal() initially, and when it is destroyed
844
+ * it calls Seal().
845
+ * This method should be called on a OGRFeatureDefn that has been sealed
846
+ * previously.
847
+ * GetTemporaryUnsealer() calls may be nested, in which case only the first
848
+ * one has an effect (similarly to a recursive mutex locked in a nested way
849
+ * from the same thread).
850
+ *
851
+ * This method should only be called by driver implementations.
852
+ *
853
+ * Usage: whileUnsealing(poFeatureDefn)->some_method();
854
+ *
855
+ * @param bSealFields Whether fields and geometry fields should be unsealed and
856
+ * resealed.
857
+ * This is generally desirabled, but in case of deferred
858
+ * resolution of them, this parameter should be set to false.
859
+ * @since GDAL 3.9
860
+ */
861
+ inline OGRFeatureDefn::TemporaryUnsealer whileUnsealing(OGRFeatureDefn *object,
862
+ bool bSealFields = true)
863
+ {
864
+ return object->GetTemporaryUnsealer(bSealFields);
865
+ }
866
+ #endif
867
+
868
+ /************************************************************************/
869
+ /* OGRFeature */
870
+ /************************************************************************/
871
+
872
+ /**
873
+ * A simple feature, including geometry and attributes.
874
+ */
875
+
876
+ class CPL_DLL OGRFeature
877
+ {
878
+ private:
879
+ GIntBig nFID;
880
+ OGRFeatureDefn *poDefn;
881
+ OGRGeometry **papoGeometries;
882
+ OGRField *pauFields;
883
+ char *m_pszNativeData;
884
+ char *m_pszNativeMediaType;
885
+
886
+ bool SetFieldInternal(int i, const OGRField *puValue);
887
+
888
+ protected:
889
+ //! @cond Doxygen_Suppress
890
+ mutable char *m_pszStyleString;
891
+ mutable OGRStyleTable *m_poStyleTable;
892
+ mutable char *m_pszTmpFieldValue;
893
+ //! @endcond
894
+
895
+ bool CopySelfTo(OGRFeature *poNew) const;
896
+
897
+ public:
898
+ explicit OGRFeature(OGRFeatureDefn *);
899
+ virtual ~OGRFeature();
900
+
901
+ /** Field value. */
902
+ class CPL_DLL FieldValue
903
+ {
904
+ friend class OGRFeature;
905
+ struct Private;
906
+ std::unique_ptr<Private> m_poPrivate;
907
+
908
+ FieldValue(OGRFeature *poFeature, int iFieldIndex);
909
+ FieldValue(const OGRFeature *poFeature, int iFieldIndex);
910
+ FieldValue(const FieldValue &oOther) = delete;
911
+ FieldValue &Assign(const FieldValue &oOther);
912
+
913
+ public:
914
+ //! @cond Doxygen_Suppress
915
+ ~FieldValue();
916
+
917
+ FieldValue &operator=(FieldValue &&oOther);
918
+ //! @endcond
919
+
920
+ /** Set a field value from another one. */
921
+ FieldValue &operator=(const FieldValue &oOther);
922
+ /** Set an integer value to the field. */
923
+ FieldValue &operator=(int nVal);
924
+ /** Set an integer value to the field. */
925
+ FieldValue &operator=(GIntBig nVal);
926
+ /** Set a real value to the field. */
927
+ FieldValue &operator=(double dfVal);
928
+ /** Set a string value to the field. */
929
+ FieldValue &operator=(const char *pszVal);
930
+ /** Set a string value to the field. */
931
+ FieldValue &operator=(const std::string &osVal);
932
+ /** Set an array of integer to the field. */
933
+ FieldValue &operator=(const std::vector<int> &oArray);
934
+ /** Set an array of big integer to the field. */
935
+ FieldValue &operator=(const std::vector<GIntBig> &oArray);
936
+ /** Set an array of double to the field. */
937
+ FieldValue &operator=(const std::vector<double> &oArray);
938
+ /** Set an array of strings to the field. */
939
+ FieldValue &operator=(const std::vector<std::string> &oArray);
940
+ /** Set an array of strings to the field. */
941
+ FieldValue &operator=(CSLConstList papszValues);
942
+ /** Set a null value to the field. */
943
+ void SetNull();
944
+ /** Unset the field. */
945
+ void clear();
946
+
947
+ /** Unset the field. */
948
+ void Unset()
949
+ {
950
+ clear();
951
+ }
952
+
953
+ /** Set date time value/ */
954
+ void SetDateTime(int nYear, int nMonth, int nDay, int nHour = 0,
955
+ int nMinute = 0, float fSecond = 0.f, int nTZFlag = 0);
956
+
957
+ /** Return field index. */
958
+ int GetIndex() const;
959
+ /** Return field definition. */
960
+ const OGRFieldDefn *GetDefn() const;
961
+
962
+ /** Return field name. */
963
+ const char *GetName() const
964
+ {
965
+ return GetDefn()->GetNameRef();
966
+ }
967
+
968
+ /** Return field type. */
969
+ OGRFieldType GetType() const
970
+ {
971
+ return GetDefn()->GetType();
972
+ }
973
+
974
+ /** Return field subtype. */
975
+ OGRFieldSubType GetSubType() const
976
+ {
977
+ return GetDefn()->GetSubType();
978
+ }
979
+
980
+ /** Return whether the field value is unset/empty. */
981
+ // cppcheck-suppress functionStatic
982
+ bool empty() const
983
+ {
984
+ return IsUnset();
985
+ }
986
+
987
+ /** Return whether the field value is unset/empty. */
988
+ // cppcheck-suppress functionStatic
989
+ bool IsUnset() const;
990
+
991
+ /** Return whether the field value is null. */
992
+ // cppcheck-suppress functionStatic
993
+ bool IsNull() const;
994
+
995
+ /** Return the raw field value */
996
+ const OGRField *GetRawValue() const;
997
+
998
+ /** Return the integer value.
999
+ * Only use that method if and only if GetType() == OFTInteger.
1000
+ */
1001
+ // cppcheck-suppress functionStatic
1002
+ int GetInteger() const
1003
+ {
1004
+ return GetRawValue()->Integer;
1005
+ }
1006
+
1007
+ /** Return the 64-bit integer value.
1008
+ * Only use that method if and only if GetType() == OFTInteger64.
1009
+ */
1010
+ // cppcheck-suppress functionStatic
1011
+ GIntBig GetInteger64() const
1012
+ {
1013
+ return GetRawValue()->Integer64;
1014
+ }
1015
+
1016
+ /** Return the double value.
1017
+ * Only use that method if and only if GetType() == OFTReal.
1018
+ */
1019
+ // cppcheck-suppress functionStatic
1020
+ double GetDouble() const
1021
+ {
1022
+ return GetRawValue()->Real;
1023
+ }
1024
+
1025
+ /** Return the string value.
1026
+ * Only use that method if and only if GetType() == OFTString.
1027
+ */
1028
+ // cppcheck-suppress functionStatic
1029
+ const char *GetString() const
1030
+ {
1031
+ return GetRawValue()->String;
1032
+ }
1033
+
1034
+ /** Return the date/time/datetime value. */
1035
+ bool GetDateTime(int *pnYear, int *pnMonth, int *pnDay, int *pnHour,
1036
+ int *pnMinute, float *pfSecond, int *pnTZFlag) const;
1037
+
1038
+ /** Return the field value as integer, with potential conversion */
1039
+ operator int() const
1040
+ {
1041
+ return GetAsInteger();
1042
+ }
1043
+
1044
+ /** Return the field value as 64-bit integer, with potential conversion
1045
+ */
1046
+ operator GIntBig() const
1047
+ {
1048
+ return GetAsInteger64();
1049
+ }
1050
+
1051
+ /** Return the field value as double, with potential conversion */
1052
+ operator double() const
1053
+ {
1054
+ return GetAsDouble();
1055
+ }
1056
+
1057
+ /** Return the field value as string, with potential conversion */
1058
+ operator const char *() const
1059
+ {
1060
+ return GetAsString();
1061
+ }
1062
+
1063
+ /** Return the field value as integer list, with potential conversion */
1064
+ operator const std::vector<int> &() const
1065
+ {
1066
+ return GetAsIntegerList();
1067
+ }
1068
+
1069
+ /** Return the field value as 64-bit integer list, with potential
1070
+ * conversion */
1071
+ operator const std::vector<GIntBig> &() const
1072
+ {
1073
+ return GetAsInteger64List();
1074
+ }
1075
+
1076
+ /** Return the field value as double list, with potential conversion */
1077
+ operator const std::vector<double> &() const
1078
+ {
1079
+ return GetAsDoubleList();
1080
+ }
1081
+
1082
+ /** Return the field value as string list, with potential conversion */
1083
+ operator const std::vector<std::string> &() const
1084
+ {
1085
+ return GetAsStringList();
1086
+ }
1087
+
1088
+ /** Return the field value as string list, with potential conversion */
1089
+ operator CSLConstList() const;
1090
+
1091
+ /** Return the field value as integer, with potential conversion */
1092
+ int GetAsInteger() const;
1093
+ /** Return the field value as 64-bit integer, with potential conversion
1094
+ */
1095
+ GIntBig GetAsInteger64() const;
1096
+ /** Return the field value as double, with potential conversion */
1097
+ double GetAsDouble() const;
1098
+ /** Return the field value as string, with potential conversion */
1099
+ const char *GetAsString() const;
1100
+ /** Return the field value as integer list, with potential conversion */
1101
+ const std::vector<int> &GetAsIntegerList() const;
1102
+ /** Return the field value as 64-bit integer list, with potential
1103
+ * conversion */
1104
+ const std::vector<GIntBig> &GetAsInteger64List() const;
1105
+ /** Return the field value as double list, with potential conversion */
1106
+ const std::vector<double> &GetAsDoubleList() const;
1107
+ /** Return the field value as string list, with potential conversion */
1108
+ const std::vector<std::string> &GetAsStringList() const;
1109
+ };
1110
+
1111
+ /** Field value iterator class. */
1112
+ class CPL_DLL ConstFieldIterator
1113
+ {
1114
+ friend class OGRFeature;
1115
+ struct Private;
1116
+ std::unique_ptr<Private> m_poPrivate;
1117
+
1118
+ ConstFieldIterator(const OGRFeature *poSelf, int nPos);
1119
+
1120
+ public:
1121
+ //! @cond Doxygen_Suppress
1122
+ ConstFieldIterator(
1123
+ ConstFieldIterator &&oOther) noexcept; // declared but not defined.
1124
+ // Needed for gcc 5.4 at least
1125
+ ~ConstFieldIterator();
1126
+ const FieldValue &operator*() const;
1127
+ ConstFieldIterator &operator++();
1128
+ bool operator!=(const ConstFieldIterator &it) const;
1129
+ //! @endcond
1130
+ };
1131
+
1132
+ /** Return begin of field value iterator.
1133
+ *
1134
+ * Using this iterator for standard range-based loops is safe, but
1135
+ * due to implementation limitations, you shouldn't try to access
1136
+ * (dereference) more than one iterator step at a time, since you will get
1137
+ * a reference to the same object (FieldValue) at each iteration step.
1138
+ *
1139
+ * \code{.cpp}
1140
+ * for( auto&& oField: poFeature )
1141
+ * {
1142
+ * std::cout << oField.GetIndex() << "," << oField.GetName()<< ": " <<
1143
+ * oField.GetAsString() << std::endl;
1144
+ * }
1145
+ * \endcode
1146
+ *
1147
+ * @since GDAL 2.3
1148
+ */
1149
+ ConstFieldIterator begin() const;
1150
+ /** Return end of field value iterator. */
1151
+ ConstFieldIterator end() const;
1152
+
1153
+ const FieldValue operator[](int iField) const;
1154
+ FieldValue operator[](int iField);
1155
+
1156
+ /** Exception raised by operator[](const char*) when a field is not found.
1157
+ */
1158
+ class FieldNotFoundException : public std::exception
1159
+ {
1160
+ };
1161
+
1162
+ const FieldValue operator[](const char *pszFieldName) const;
1163
+ FieldValue operator[](const char *pszFieldName);
1164
+
1165
+ OGRFeatureDefn *GetDefnRef()
1166
+ {
1167
+ return poDefn;
1168
+ }
1169
+
1170
+ const OGRFeatureDefn *GetDefnRef() const
1171
+ {
1172
+ return poDefn;
1173
+ }
1174
+
1175
+ //! @cond Doxygen_Suppress
1176
+ void SetFDefnUnsafe(OGRFeatureDefn *poNewFDefn);
1177
+ //! @endcond
1178
+
1179
+ OGRErr SetGeometryDirectly(OGRGeometry *);
1180
+ OGRErr SetGeometry(const OGRGeometry *);
1181
+ OGRGeometry *GetGeometryRef();
1182
+ const OGRGeometry *GetGeometryRef() const;
1183
+ OGRGeometry *StealGeometry() CPL_WARN_UNUSED_RESULT;
1184
+
1185
+ int GetGeomFieldCount() const
1186
+ {
1187
+ return poDefn->GetGeomFieldCount();
1188
+ }
1189
+
1190
+ OGRGeomFieldDefn *GetGeomFieldDefnRef(int iField)
1191
+ {
1192
+ return poDefn->GetGeomFieldDefn(iField);
1193
+ }
1194
+
1195
+ const OGRGeomFieldDefn *GetGeomFieldDefnRef(int iField) const
1196
+ {
1197
+ return poDefn->GetGeomFieldDefn(iField);
1198
+ }
1199
+
1200
+ int GetGeomFieldIndex(const char *pszName) const
1201
+ {
1202
+ return poDefn->GetGeomFieldIndex(pszName);
1203
+ }
1204
+
1205
+ OGRGeometry *GetGeomFieldRef(int iField);
1206
+ const OGRGeometry *GetGeomFieldRef(int iField) const;
1207
+ OGRGeometry *StealGeometry(int iField);
1208
+ OGRGeometry *GetGeomFieldRef(const char *pszFName);
1209
+ const OGRGeometry *GetGeomFieldRef(const char *pszFName) const;
1210
+ OGRErr SetGeomFieldDirectly(int iField, OGRGeometry *);
1211
+ OGRErr SetGeomField(int iField, const OGRGeometry *);
1212
+
1213
+ void Reset();
1214
+
1215
+ OGRFeature *Clone() const CPL_WARN_UNUSED_RESULT;
1216
+ virtual OGRBoolean Equal(const OGRFeature *poFeature) const;
1217
+
1218
+ int GetFieldCount() const
1219
+ {
1220
+ return poDefn->GetFieldCount();
1221
+ }
1222
+
1223
+ const OGRFieldDefn *GetFieldDefnRef(int iField) const
1224
+ {
1225
+ return poDefn->GetFieldDefn(iField);
1226
+ }
1227
+
1228
+ OGRFieldDefn *GetFieldDefnRef(int iField)
1229
+ {
1230
+ return poDefn->GetFieldDefn(iField);
1231
+ }
1232
+
1233
+ int GetFieldIndex(const char *pszName) const
1234
+ {
1235
+ return poDefn->GetFieldIndex(pszName);
1236
+ }
1237
+
1238
+ int IsFieldSet(int iField) const;
1239
+
1240
+ void UnsetField(int iField);
1241
+
1242
+ bool IsFieldNull(int iField) const;
1243
+
1244
+ void SetFieldNull(int iField);
1245
+
1246
+ bool IsFieldSetAndNotNull(int iField) const;
1247
+
1248
+ OGRField *GetRawFieldRef(int i)
1249
+ {
1250
+ return pauFields + i;
1251
+ }
1252
+
1253
+ const OGRField *GetRawFieldRef(int i) const
1254
+ {
1255
+ return pauFields + i;
1256
+ }
1257
+
1258
+ int GetFieldAsInteger(int i) const;
1259
+ GIntBig GetFieldAsInteger64(int i) const;
1260
+ double GetFieldAsDouble(int i) const;
1261
+ const char *GetFieldAsString(int i) const;
1262
+ const char *GetFieldAsISO8601DateTime(int i,
1263
+ CSLConstList papszOptions) const;
1264
+ const int *GetFieldAsIntegerList(int i, int *pnCount) const;
1265
+ const GIntBig *GetFieldAsInteger64List(int i, int *pnCount) const;
1266
+ const double *GetFieldAsDoubleList(int i, int *pnCount) const;
1267
+ char **GetFieldAsStringList(int i) const;
1268
+ GByte *GetFieldAsBinary(int i, int *pnCount) const;
1269
+ int GetFieldAsDateTime(int i, int *pnYear, int *pnMonth, int *pnDay,
1270
+ int *pnHour, int *pnMinute, int *pnSecond,
1271
+ int *pnTZFlag) const;
1272
+ int GetFieldAsDateTime(int i, int *pnYear, int *pnMonth, int *pnDay,
1273
+ int *pnHour, int *pnMinute, float *pfSecond,
1274
+ int *pnTZFlag) const;
1275
+ char *GetFieldAsSerializedJSon(int i) const;
1276
+
1277
+ //! @cond Doxygen_Suppress
1278
+ bool IsFieldSetUnsafe(int i) const
1279
+ {
1280
+ return !(pauFields[i].Set.nMarker1 == OGRUnsetMarker &&
1281
+ pauFields[i].Set.nMarker2 == OGRUnsetMarker &&
1282
+ pauFields[i].Set.nMarker3 == OGRUnsetMarker);
1283
+ }
1284
+
1285
+ bool IsFieldNullUnsafe(int i) const
1286
+ {
1287
+ return (pauFields[i].Set.nMarker1 == OGRNullMarker &&
1288
+ pauFields[i].Set.nMarker2 == OGRNullMarker &&
1289
+ pauFields[i].Set.nMarker3 == OGRNullMarker);
1290
+ }
1291
+
1292
+ bool IsFieldSetAndNotNullUnsafe(int i) const
1293
+ {
1294
+ return IsFieldSetUnsafe(i) && !IsFieldNullUnsafe(i);
1295
+ }
1296
+
1297
+ // Those methods should only be called on a field that is of the type
1298
+ // consistent with the value, and that is set.
1299
+ int GetFieldAsIntegerUnsafe(int i) const
1300
+ {
1301
+ return pauFields[i].Integer;
1302
+ }
1303
+
1304
+ GIntBig GetFieldAsInteger64Unsafe(int i) const
1305
+ {
1306
+ return pauFields[i].Integer64;
1307
+ }
1308
+
1309
+ double GetFieldAsDoubleUnsafe(int i) const
1310
+ {
1311
+ return pauFields[i].Real;
1312
+ }
1313
+
1314
+ const char *GetFieldAsStringUnsafe(int i) const
1315
+ {
1316
+ return pauFields[i].String;
1317
+ }
1318
+
1319
+ //! @endcond
1320
+
1321
+ int GetFieldAsInteger(const char *pszFName) const
1322
+ {
1323
+ return GetFieldAsInteger(GetFieldIndex(pszFName));
1324
+ }
1325
+
1326
+ GIntBig GetFieldAsInteger64(const char *pszFName) const
1327
+ {
1328
+ return GetFieldAsInteger64(GetFieldIndex(pszFName));
1329
+ }
1330
+
1331
+ double GetFieldAsDouble(const char *pszFName) const
1332
+ {
1333
+ return GetFieldAsDouble(GetFieldIndex(pszFName));
1334
+ }
1335
+
1336
+ const char *GetFieldAsString(const char *pszFName) const
1337
+ {
1338
+ return GetFieldAsString(GetFieldIndex(pszFName));
1339
+ }
1340
+
1341
+ const char *GetFieldAsISO8601DateTime(const char *pszFName,
1342
+ CSLConstList papszOptions) const
1343
+ {
1344
+ return GetFieldAsISO8601DateTime(GetFieldIndex(pszFName), papszOptions);
1345
+ }
1346
+
1347
+ const int *GetFieldAsIntegerList(const char *pszFName, int *pnCount) const
1348
+ {
1349
+ return GetFieldAsIntegerList(GetFieldIndex(pszFName), pnCount);
1350
+ }
1351
+
1352
+ const GIntBig *GetFieldAsInteger64List(const char *pszFName,
1353
+ int *pnCount) const
1354
+ {
1355
+ return GetFieldAsInteger64List(GetFieldIndex(pszFName), pnCount);
1356
+ }
1357
+
1358
+ const double *GetFieldAsDoubleList(const char *pszFName, int *pnCount) const
1359
+ {
1360
+ return GetFieldAsDoubleList(GetFieldIndex(pszFName), pnCount);
1361
+ }
1362
+
1363
+ char **GetFieldAsStringList(const char *pszFName) const
1364
+ {
1365
+ return GetFieldAsStringList(GetFieldIndex(pszFName));
1366
+ }
1367
+
1368
+ void SetField(int i, int nValue);
1369
+ void SetField(int i, GIntBig nValue);
1370
+ void SetField(int i, double dfValue);
1371
+ void SetField(int i, const char *pszValue);
1372
+ void SetField(int i, int nCount, const int *panValues);
1373
+ void SetField(int i, int nCount, const GIntBig *panValues);
1374
+ void SetField(int i, int nCount, const double *padfValues);
1375
+ void SetField(int i, const char *const *papszValues);
1376
+ void SetField(int i, const OGRField *puValue);
1377
+ void SetField(int i, int nCount, const void *pabyBinary);
1378
+ void SetField(int i, int nYear, int nMonth, int nDay, int nHour = 0,
1379
+ int nMinute = 0, float fSecond = 0.f, int nTZFlag = 0);
1380
+
1381
+ //! @cond Doxygen_Suppress
1382
+ // Those methods should only be called on a field that is of the type
1383
+ // consistent with the value, and in a unset state.
1384
+ void SetFieldSameTypeUnsafe(int i, int nValue)
1385
+ {
1386
+ pauFields[i].Integer = nValue;
1387
+ pauFields[i].Set.nMarker2 = 0;
1388
+ pauFields[i].Set.nMarker3 = 0;
1389
+ }
1390
+
1391
+ void SetFieldSameTypeUnsafe(int i, GIntBig nValue)
1392
+ {
1393
+ pauFields[i].Integer64 = nValue;
1394
+ }
1395
+
1396
+ void SetFieldSameTypeUnsafe(int i, double dfValue)
1397
+ {
1398
+ pauFields[i].Real = dfValue;
1399
+ }
1400
+
1401
+ void SetFieldSameTypeUnsafe(int i, char *pszValueTransferred)
1402
+ {
1403
+ pauFields[i].String = pszValueTransferred;
1404
+ }
1405
+
1406
+ //! @endcond
1407
+
1408
+ void SetField(const char *pszFName, int nValue)
1409
+ {
1410
+ SetField(GetFieldIndex(pszFName), nValue);
1411
+ }
1412
+
1413
+ void SetField(const char *pszFName, GIntBig nValue)
1414
+ {
1415
+ SetField(GetFieldIndex(pszFName), nValue);
1416
+ }
1417
+
1418
+ void SetField(const char *pszFName, double dfValue)
1419
+ {
1420
+ SetField(GetFieldIndex(pszFName), dfValue);
1421
+ }
1422
+
1423
+ void SetField(const char *pszFName, const char *pszValue)
1424
+ {
1425
+ SetField(GetFieldIndex(pszFName), pszValue);
1426
+ }
1427
+
1428
+ void SetField(const char *pszFName, int nCount, const int *panValues)
1429
+ {
1430
+ SetField(GetFieldIndex(pszFName), nCount, panValues);
1431
+ }
1432
+
1433
+ void SetField(const char *pszFName, int nCount, const GIntBig *panValues)
1434
+ {
1435
+ SetField(GetFieldIndex(pszFName), nCount, panValues);
1436
+ }
1437
+
1438
+ void SetField(const char *pszFName, int nCount, const double *padfValues)
1439
+ {
1440
+ SetField(GetFieldIndex(pszFName), nCount, padfValues);
1441
+ }
1442
+
1443
+ void SetField(const char *pszFName, const char *const *papszValues)
1444
+ {
1445
+ SetField(GetFieldIndex(pszFName), papszValues);
1446
+ }
1447
+
1448
+ void SetField(const char *pszFName, const OGRField *puValue)
1449
+ {
1450
+ SetField(GetFieldIndex(pszFName), puValue);
1451
+ }
1452
+
1453
+ void SetField(const char *pszFName, int nYear, int nMonth, int nDay,
1454
+ int nHour = 0, int nMinute = 0, float fSecond = 0.f,
1455
+ int nTZFlag = 0)
1456
+ {
1457
+ SetField(GetFieldIndex(pszFName), nYear, nMonth, nDay, nHour, nMinute,
1458
+ fSecond, nTZFlag);
1459
+ }
1460
+
1461
+ GIntBig GetFID() const
1462
+ {
1463
+ return nFID;
1464
+ }
1465
+
1466
+ virtual OGRErr SetFID(GIntBig nFIDIn);
1467
+
1468
+ void DumpReadable(FILE *, CSLConstList papszOptions = nullptr) const;
1469
+ std::string DumpReadableAsString(CSLConstList papszOptions = nullptr) const;
1470
+
1471
+ OGRErr SetFrom(const OGRFeature *, int bForgiving = TRUE);
1472
+ OGRErr SetFrom(const OGRFeature *, const int *panMap, int bForgiving = TRUE,
1473
+ bool bUseISO8601ForDateTimeAsString = false);
1474
+ OGRErr SetFieldsFrom(const OGRFeature *, const int *panMap,
1475
+ int bForgiving = TRUE,
1476
+ bool bUseISO8601ForDateTimeAsString = false);
1477
+
1478
+ //! @cond Doxygen_Suppress
1479
+ OGRErr RemapFields(OGRFeatureDefn *poNewDefn, const int *panRemapSource);
1480
+ void AppendField();
1481
+ OGRErr RemapGeomFields(OGRFeatureDefn *poNewDefn,
1482
+ const int *panRemapSource);
1483
+ //! @endcond
1484
+
1485
+ int Validate(int nValidateFlags, int bEmitError) const;
1486
+ void FillUnsetWithDefault(int bNotNullableOnly, char **papszOptions);
1487
+
1488
+ bool SerializeToBinary(std::vector<GByte> &abyBuffer) const;
1489
+ bool DeserializeFromBinary(const GByte *pabyBuffer, size_t nSize);
1490
+
1491
+ virtual const char *GetStyleString() const;
1492
+ virtual void SetStyleString(const char *);
1493
+ virtual void SetStyleStringDirectly(char *);
1494
+
1495
+ /** Return style table.
1496
+ * @return style table.
1497
+ */
1498
+ virtual OGRStyleTable *GetStyleTable() const
1499
+ {
1500
+ return m_poStyleTable;
1501
+ } /* f.i.x.m.e: add a const qualifier for return type */
1502
+
1503
+ virtual void SetStyleTable(OGRStyleTable *poStyleTable);
1504
+ virtual void SetStyleTableDirectly(OGRStyleTable *poStyleTable);
1505
+
1506
+ const char *GetNativeData() const
1507
+ {
1508
+ return m_pszNativeData;
1509
+ }
1510
+
1511
+ const char *GetNativeMediaType() const
1512
+ {
1513
+ return m_pszNativeMediaType;
1514
+ }
1515
+
1516
+ void SetNativeData(const char *pszNativeData);
1517
+ void SetNativeMediaType(const char *pszNativeMediaType);
1518
+
1519
+ static OGRFeature *CreateFeature(OGRFeatureDefn *);
1520
+ static void DestroyFeature(OGRFeature *);
1521
+
1522
+ /** Convert a OGRFeature* to a OGRFeatureH.
1523
+ * @since GDAL 2.3
1524
+ */
1525
+ static inline OGRFeatureH ToHandle(OGRFeature *poFeature)
1526
+ {
1527
+ return reinterpret_cast<OGRFeatureH>(poFeature);
1528
+ }
1529
+
1530
+ /** Convert a OGRFeatureH to a OGRFeature*.
1531
+ * @since GDAL 2.3
1532
+ */
1533
+ static inline OGRFeature *FromHandle(OGRFeatureH hFeature)
1534
+ {
1535
+ return reinterpret_cast<OGRFeature *>(hFeature);
1536
+ }
1537
+
1538
+ private:
1539
+ CPL_DISALLOW_COPY_ASSIGN(OGRFeature)
1540
+ };
1541
+
1542
+ //! @cond Doxygen_Suppress
1543
+ struct CPL_DLL OGRFeatureUniquePtrDeleter
1544
+ {
1545
+ void operator()(OGRFeature *) const;
1546
+ };
1547
+
1548
+ //! @endcond
1549
+
1550
+ /** Unique pointer type for OGRFeature.
1551
+ * @since GDAL 2.3
1552
+ */
1553
+ typedef std::unique_ptr<OGRFeature, OGRFeatureUniquePtrDeleter>
1554
+ OGRFeatureUniquePtr;
1555
+
1556
+ //! @cond Doxygen_Suppress
1557
+ /** @see OGRFeature::begin() const */
1558
+ inline OGRFeature::ConstFieldIterator begin(const OGRFeature *poFeature)
1559
+ {
1560
+ return poFeature->begin();
1561
+ }
1562
+
1563
+ /** @see OGRFeature::end() const */
1564
+ inline OGRFeature::ConstFieldIterator end(const OGRFeature *poFeature)
1565
+ {
1566
+ return poFeature->end();
1567
+ }
1568
+
1569
+ /** @see OGRFeature::begin() const */
1570
+ inline OGRFeature::ConstFieldIterator
1571
+ begin(const OGRFeatureUniquePtr &poFeature)
1572
+ {
1573
+ return poFeature->begin();
1574
+ }
1575
+
1576
+ /** @see OGRFeature::end() const */
1577
+ inline OGRFeature::ConstFieldIterator end(const OGRFeatureUniquePtr &poFeature)
1578
+ {
1579
+ return poFeature->end();
1580
+ }
1581
+
1582
+ //! @endcond
1583
+
1584
+ /************************************************************************/
1585
+ /* OGRFieldDomain */
1586
+ /************************************************************************/
1587
+
1588
+ /* clang-format off */
1589
+ /**
1590
+ * Definition of a field domain.
1591
+ *
1592
+ * A field domain is a set of constraints that apply to one or several fields.
1593
+ *
1594
+ * This is a concept found in
1595
+ * <a href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/an-overview-of-attribute-domains.htm">File
1596
+ * Geodatabase</a> or GeoPackage (using the <a href="http://www.geopackage.org/spec/#extension_schema">schema extension</a>)
1597
+ * for example.
1598
+ *
1599
+ * A field domain can be:
1600
+ * <ul>
1601
+ * <li>OGRCodedFieldDomain: an enumerated list of (code, value) tuples.</li>
1602
+ * <li>OGRRangeFieldDomain: a range constraint (min, max).</li>
1603
+ * <li>OGRGlobFieldDomain: a glob expression.</li>
1604
+ * </ul>
1605
+ *
1606
+ * @since GDAL 3.3
1607
+ */
1608
+ /* clang-format on */
1609
+
1610
+ class CPL_DLL OGRFieldDomain
1611
+ {
1612
+ protected:
1613
+ /*! @cond Doxygen_Suppress */
1614
+ std::string m_osName;
1615
+ std::string m_osDescription;
1616
+ OGRFieldDomainType m_eDomainType;
1617
+ OGRFieldType m_eFieldType;
1618
+ OGRFieldSubType m_eFieldSubType;
1619
+ OGRFieldDomainSplitPolicy m_eSplitPolicy = OFDSP_DEFAULT_VALUE;
1620
+ OGRFieldDomainMergePolicy m_eMergePolicy = OFDMP_DEFAULT_VALUE;
1621
+
1622
+ OGRFieldDomain(const std::string &osName, const std::string &osDescription,
1623
+ OGRFieldDomainType eDomainType, OGRFieldType eFieldType,
1624
+ OGRFieldSubType eFieldSubType);
1625
+ /*! @endcond */
1626
+
1627
+ public:
1628
+ /** Destructor.
1629
+ *
1630
+ * This is the same as the C function OGR_FldDomain_Destroy().
1631
+ */
1632
+ virtual ~OGRFieldDomain() = 0;
1633
+
1634
+ /** Clone.
1635
+ *
1636
+ * Return a cloned object, or nullptr in case of error.
1637
+ */
1638
+ virtual OGRFieldDomain *Clone() const = 0;
1639
+
1640
+ /** Get the name of the field domain.
1641
+ *
1642
+ * This is the same as the C function OGR_FldDomain_GetName().
1643
+ */
1644
+ const std::string &GetName() const
1645
+ {
1646
+ return m_osName;
1647
+ }
1648
+
1649
+ /** Get the description of the field domain.
1650
+ * Empty string if there is none.
1651
+ *
1652
+ * This is the same as the C function OGR_FldDomain_GetDescription().
1653
+ */
1654
+ const std::string &GetDescription() const
1655
+ {
1656
+ return m_osDescription;
1657
+ }
1658
+
1659
+ /** Get the type of the field domain.
1660
+ *
1661
+ * This is the same as the C function OGR_FldDomain_GetDomainType().
1662
+ */
1663
+ OGRFieldDomainType GetDomainType() const
1664
+ {
1665
+ return m_eDomainType;
1666
+ }
1667
+
1668
+ /** Get the field type.
1669
+ *
1670
+ * This is the same as the C function OGR_FldDomain_GetFieldType().
1671
+ */
1672
+ OGRFieldType GetFieldType() const
1673
+ {
1674
+ return m_eFieldType;
1675
+ }
1676
+
1677
+ /** Get the field subtype.
1678
+ *
1679
+ * This is the same as the C function OGR_FldDomain_GetFieldSubType().
1680
+ */
1681
+ OGRFieldSubType GetFieldSubType() const
1682
+ {
1683
+ return m_eFieldSubType;
1684
+ }
1685
+
1686
+ /** Convert a OGRFieldDomain* to a OGRFieldDomainH. */
1687
+ static inline OGRFieldDomainH ToHandle(OGRFieldDomain *poFieldDomain)
1688
+ {
1689
+ return reinterpret_cast<OGRFieldDomainH>(poFieldDomain);
1690
+ }
1691
+
1692
+ /** Convert a OGRFieldDomainH to a OGRFieldDomain*. */
1693
+ static inline OGRFieldDomain *FromHandle(OGRFieldDomainH hFieldDomain)
1694
+ {
1695
+ return reinterpret_cast<OGRFieldDomain *>(hFieldDomain);
1696
+ }
1697
+
1698
+ /** Get the split policy.
1699
+ *
1700
+ * This is the same as the C function OGR_FldDomain_GetSplitPolicy().
1701
+ */
1702
+ OGRFieldDomainSplitPolicy GetSplitPolicy() const
1703
+ {
1704
+ return m_eSplitPolicy;
1705
+ }
1706
+
1707
+ /** Set the split policy.
1708
+ *
1709
+ * This is the same as the C function OGR_FldDomain_SetSplitPolicy().
1710
+ */
1711
+ void SetSplitPolicy(OGRFieldDomainSplitPolicy policy)
1712
+ {
1713
+ m_eSplitPolicy = policy;
1714
+ }
1715
+
1716
+ /** Get the merge policy.
1717
+ *
1718
+ * This is the same as the C function OGR_FldDomain_GetMergePolicy().
1719
+ */
1720
+ OGRFieldDomainMergePolicy GetMergePolicy() const
1721
+ {
1722
+ return m_eMergePolicy;
1723
+ }
1724
+
1725
+ /** Set the merge policy.
1726
+ *
1727
+ * This is the same as the C function OGR_FldDomain_SetMergePolicy().
1728
+ */
1729
+ void SetMergePolicy(OGRFieldDomainMergePolicy policy)
1730
+ {
1731
+ m_eMergePolicy = policy;
1732
+ }
1733
+ };
1734
+
1735
+ /** Definition of a coded / enumerated field domain.
1736
+ *
1737
+ * A code field domain is a domain for which only a limited set of codes,
1738
+ * associated with their expanded value, are allowed.
1739
+ * The type of the code should be the one of the field domain.
1740
+ */
1741
+ class CPL_DLL OGRCodedFieldDomain final : public OGRFieldDomain
1742
+ {
1743
+ private:
1744
+ std::vector<OGRCodedValue> m_asValues{};
1745
+
1746
+ OGRCodedFieldDomain(const OGRCodedFieldDomain &) = delete;
1747
+ OGRCodedFieldDomain &operator=(const OGRCodedFieldDomain &) = delete;
1748
+
1749
+ public:
1750
+ /** Constructor.
1751
+ *
1752
+ * This is the same as the C function OGR_CodedFldDomain_Create()
1753
+ * (except that the C function copies the enumeration, whereas the C++
1754
+ * method moves it)
1755
+ *
1756
+ * @param osName Domain name.
1757
+ * @param osDescription Domain description.
1758
+ * @param eFieldType Field type. Generally numeric. Potentially
1759
+ * OFTDateTime
1760
+ * @param eFieldSubType Field subtype.
1761
+ * @param asValues Enumeration as (code, value) pairs.
1762
+ * Each code should appear only once, but it is the
1763
+ * responsibility of the user to check it.
1764
+ */
1765
+ OGRCodedFieldDomain(const std::string &osName,
1766
+ const std::string &osDescription,
1767
+ OGRFieldType eFieldType, OGRFieldSubType eFieldSubType,
1768
+ std::vector<OGRCodedValue> &&asValues);
1769
+
1770
+ ~OGRCodedFieldDomain() override;
1771
+
1772
+ OGRCodedFieldDomain *Clone() const override;
1773
+
1774
+ /** Get the enumeration as (code, value) pairs.
1775
+ * The end of the enumeration is signaled by code == NULL.
1776
+ *
1777
+ * This is the same as the C function OGR_CodedFldDomain_GetEnumeration().
1778
+ */
1779
+ const OGRCodedValue *GetEnumeration() const
1780
+ {
1781
+ return m_asValues.data();
1782
+ }
1783
+ };
1784
+
1785
+ /** Definition of a numeric field domain with a range of validity for values.
1786
+ */
1787
+ class CPL_DLL OGRRangeFieldDomain final : public OGRFieldDomain
1788
+ {
1789
+ private:
1790
+ OGRField m_sMin;
1791
+ OGRField m_sMax;
1792
+ bool m_bMinIsInclusive;
1793
+ bool m_bMaxIsInclusive;
1794
+
1795
+ OGRRangeFieldDomain(const OGRRangeFieldDomain &) = delete;
1796
+ OGRRangeFieldDomain &operator=(const OGRRangeFieldDomain &) = delete;
1797
+
1798
+ public:
1799
+ /** Constructor.
1800
+ *
1801
+ * This is the same as the C function OGR_RangeFldDomain_Create().
1802
+ *
1803
+ * @param osName Domain name.
1804
+ * @param osDescription Domain description.
1805
+ * @param eFieldType Field type.
1806
+ * One among OFTInteger, OFTInteger64, OFTReal or
1807
+ * OFTDateTime
1808
+ * @param eFieldSubType Field subtype.
1809
+ * @param sMin Minimum value.
1810
+ * Which member in the OGRField enum must be read
1811
+ * depends on the field type.
1812
+ * If no minimum is set (might not be supported by
1813
+ * all backends), then initialize the value with
1814
+ * OGR_RawField_SetUnset().
1815
+ * @param bMinIsInclusive Whether the minimum value is included in the
1816
+ * range.
1817
+ * @param sMax Minimum value.
1818
+ * Which member in the OGRField enum must be read
1819
+ * depends on the field type.
1820
+ * If no maximum is set (might not be supported by
1821
+ * all backends), then initialize the value with
1822
+ * OGR_RawField_SetUnset().
1823
+ * @param bMaxIsInclusive Whether the minimum value is included in the
1824
+ * range.
1825
+ */
1826
+ OGRRangeFieldDomain(const std::string &osName,
1827
+ const std::string &osDescription,
1828
+ OGRFieldType eFieldType, OGRFieldSubType eFieldSubType,
1829
+ const OGRField &sMin, bool bMinIsInclusive,
1830
+ const OGRField &sMax, bool bMaxIsInclusive);
1831
+
1832
+ OGRRangeFieldDomain *Clone() const override
1833
+ {
1834
+ auto poDomain = new OGRRangeFieldDomain(
1835
+ m_osName, m_osDescription, m_eFieldType, m_eFieldSubType, m_sMin,
1836
+ m_bMinIsInclusive, m_sMax, m_bMaxIsInclusive);
1837
+ poDomain->SetMergePolicy(m_eMergePolicy);
1838
+ poDomain->SetSplitPolicy(m_eSplitPolicy);
1839
+ return poDomain;
1840
+ }
1841
+
1842
+ /** Get the minimum value.
1843
+ *
1844
+ * Which member in the returned OGRField enum must be read depends on the
1845
+ * field type.
1846
+ *
1847
+ * If no minimum value is set, the OGR_RawField_IsUnset() will return true
1848
+ * when called on the result.
1849
+ *
1850
+ * This is the same as the C function OGR_RangeFldDomain_GetMin().
1851
+ *
1852
+ * @param bIsInclusiveOut set to true if the minimum is included in the
1853
+ * range.
1854
+ */
1855
+ const OGRField &GetMin(bool &bIsInclusiveOut) const
1856
+ {
1857
+ bIsInclusiveOut = m_bMinIsInclusive;
1858
+ return m_sMin;
1859
+ }
1860
+
1861
+ /** Get the maximum value.
1862
+ *
1863
+ * Which member in the returned OGRField enum must be read depends on the
1864
+ * field type.
1865
+ *
1866
+ * If no maximum value is set, the OGR_RawField_IsUnset() will return true
1867
+ * when called on the result.
1868
+ *
1869
+ * This is the same as the C function OGR_RangeFldDomain_GetMax().
1870
+ *
1871
+ * @param bIsInclusiveOut set to true if the maximum is included in the
1872
+ * range.
1873
+ */
1874
+ const OGRField &GetMax(bool &bIsInclusiveOut) const
1875
+ {
1876
+ bIsInclusiveOut = m_bMaxIsInclusive;
1877
+ return m_sMax;
1878
+ }
1879
+ };
1880
+
1881
+ /** Definition of a field domain for field content validated by a glob.
1882
+ *
1883
+ * Globs are matching expression like "*[a-z][0-1]?"
1884
+ */
1885
+ class CPL_DLL OGRGlobFieldDomain final : public OGRFieldDomain
1886
+ {
1887
+ private:
1888
+ std::string m_osGlob;
1889
+
1890
+ OGRGlobFieldDomain(const OGRGlobFieldDomain &) = delete;
1891
+ OGRGlobFieldDomain &operator=(const OGRGlobFieldDomain &) = delete;
1892
+
1893
+ public:
1894
+ /** Constructor.
1895
+ *
1896
+ * This is the same as the C function OGR_GlobFldDomain_Create().
1897
+ *
1898
+ * @param osName Domain name.
1899
+ * @param osDescription Domain description.
1900
+ * @param eFieldType Field type.
1901
+ * @param eFieldSubType Field subtype.
1902
+ * @param osBlob Blob expression
1903
+ */
1904
+ OGRGlobFieldDomain(const std::string &osName,
1905
+ const std::string &osDescription,
1906
+ OGRFieldType eFieldType, OGRFieldSubType eFieldSubType,
1907
+ const std::string &osBlob);
1908
+
1909
+ OGRGlobFieldDomain *Clone() const override
1910
+ {
1911
+ auto poDomain = new OGRGlobFieldDomain(
1912
+ m_osName, m_osDescription, m_eFieldType, m_eFieldSubType, m_osGlob);
1913
+ poDomain->SetMergePolicy(m_eMergePolicy);
1914
+ poDomain->SetSplitPolicy(m_eSplitPolicy);
1915
+ return poDomain;
1916
+ }
1917
+
1918
+ /** Get the glob expression.
1919
+ *
1920
+ * This is the same as the C function OGR_GlobFldDomain_GetGlob().
1921
+ */
1922
+ const std::string &GetGlob() const
1923
+ {
1924
+ return m_osGlob;
1925
+ }
1926
+ };
1927
+
1928
+ /************************************************************************/
1929
+ /* OGRFeatureQuery */
1930
+ /************************************************************************/
1931
+
1932
+ //! @cond Doxygen_Suppress
1933
+ class OGRLayer;
1934
+ class swq_expr_node;
1935
+ class swq_custom_func_registrar;
1936
+ struct swq_evaluation_context;
1937
+
1938
+ class CPL_DLL OGRFeatureQuery
1939
+ {
1940
+ private:
1941
+ OGRFeatureDefn *poTargetDefn;
1942
+ void *pSWQExpr;
1943
+ swq_evaluation_context *m_psContext = nullptr;
1944
+
1945
+ char **FieldCollector(void *, char **);
1946
+
1947
+ static GIntBig *EvaluateAgainstIndices(const swq_expr_node *, OGRLayer *,
1948
+ GIntBig &nFIDCount);
1949
+
1950
+ static int CanUseIndex(const swq_expr_node *, OGRLayer *);
1951
+
1952
+ OGRErr Compile(OGRLayer *, OGRFeatureDefn *, const char *, int bCheck,
1953
+ swq_custom_func_registrar *poCustomFuncRegistrar);
1954
+
1955
+ CPL_DISALLOW_COPY_ASSIGN(OGRFeatureQuery)
1956
+
1957
+ public:
1958
+ OGRFeatureQuery();
1959
+ ~OGRFeatureQuery();
1960
+
1961
+ OGRErr Compile(OGRLayer *, const char *, int bCheck = TRUE,
1962
+ swq_custom_func_registrar *poCustomFuncRegistrar = nullptr);
1963
+ OGRErr Compile(OGRFeatureDefn *, const char *, int bCheck = TRUE,
1964
+ swq_custom_func_registrar *poCustomFuncRegistrar = nullptr);
1965
+ int Evaluate(OGRFeature *);
1966
+
1967
+ GIntBig *EvaluateAgainstIndices(OGRLayer *, OGRErr *);
1968
+
1969
+ int CanUseIndex(OGRLayer *);
1970
+
1971
+ char **GetUsedFields();
1972
+
1973
+ void *GetSWQExpr()
1974
+ {
1975
+ return pSWQExpr;
1976
+ }
1977
+ };
1978
+
1979
+ //! @endcond
1980
+
1981
+ #endif /* ndef OGR_FEATURE_H_INCLUDED */