epgsql_geometry.hrl 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. -type point_type() :: '2d' | '3d' | '2dm' | '3dm'.
  2. -record(point,{
  3. point_type :: point_type(),
  4. x :: float(),
  5. y :: float(),
  6. z :: float(),
  7. m :: float()
  8. }).
  9. -type point() :: #point{}.
  10. -record(multi_point,{
  11. point_type :: point_type() ,
  12. points :: [point()]
  13. }).
  14. -type multi_point() :: #multi_point{}.
  15. -record(line_string,{
  16. point_type :: point_type(),
  17. points :: [point()]
  18. }).
  19. -type line_string() :: #line_string{}.
  20. -record(multi_line_string,{
  21. point_type :: point_type(),
  22. line_strings :: [line_string()]
  23. }).
  24. -type multi_line_string() :: #multi_line_string{}.
  25. -record(circular_string,{
  26. point_type :: point_type(),
  27. points :: [point()]
  28. }).
  29. -type basic_string() :: #circular_string{} | #line_string{}.
  30. -record(compound_curve,{
  31. point_type :: point_type(),
  32. lines :: [basic_string()]
  33. }).
  34. -type curve() :: #circular_string{} | #line_string{} | #compound_curve{}.
  35. -record(multi_curve,{
  36. point_type :: point_type(),
  37. curves :: [curve()]
  38. }).
  39. -type multi_curve() :: #multi_curve{}.
  40. -record(polygon,{
  41. point_type :: point_type(),
  42. rings :: [line_string()]
  43. }).
  44. -type polygon() :: #polygon{}.
  45. -record(multi_polygon,{
  46. point_type :: point_type(),
  47. polygons :: [polygon()]
  48. }).
  49. -type multi_polygon() :: #multi_polygon{}.
  50. -record(triangle,{
  51. point_type :: point_type(),
  52. rings :: [line_string()]
  53. }).
  54. -type triangle() :: #triangle{}.
  55. -record(curve_polygon,{
  56. point_type :: point_type(),
  57. rings :: [curve()]
  58. }).
  59. -type curve_polygon() :: #curve_polygon{}.
  60. -record(polyhedral_surface,{
  61. point_type :: point_type(),
  62. polygons :: [polygon()]
  63. }).
  64. -type polyhedral_surface() :: #polyhedral_surface{}.
  65. -type surface() :: polygon() | curve_polygon() | polyhedral_surface().
  66. -record(multi_surface,{
  67. point_type :: point_type(),
  68. surfaces :: [surface()]
  69. }).
  70. -type multi_surface() :: #multi_surface{}.
  71. -record(tin,{
  72. point_type :: point_type(),
  73. triangles :: [triangle()]
  74. }).
  75. -type tin() :: #tin{}.
  76. -type geometry() :: point() |
  77. line_string() |
  78. triangle() |
  79. tin() |
  80. curve() |
  81. surface() |
  82. multi_point() |
  83. multi_line_string() |
  84. multi_polygon() |
  85. multi_curve() |
  86. multi_surface() |
  87. geometry_collection().
  88. -type geometry_collection() :: [geometry()].