/src/MapServer/src/flatgeobuf/geometryreader.h
Line | Count | Source |
1 | | #ifndef FLATGEOBUF_GEOMETRYREADER_H |
2 | | #define FLATGEOBUF_GEOMETRYREADER_H |
3 | | |
4 | | #include "../../mapserver.h" |
5 | | #include "../../maperror.h" |
6 | | #include "../../mapprimitive.h" |
7 | | |
8 | | #include "flatgeobuf_c.h" |
9 | | #include "feature_generated.h" |
10 | | |
11 | | namespace mapserver { |
12 | | namespace FlatGeobuf { |
13 | | |
14 | | class GeometryReader { |
15 | | private: |
16 | | flatgeobuf_ctx *m_ctx; |
17 | | const FlatGeobuf::Geometry *m_geometry; |
18 | | FlatGeobuf::GeometryType m_geometry_type; |
19 | | bool m_has_z; |
20 | | bool m_has_m; |
21 | | |
22 | | const double *m_xy = nullptr; |
23 | | uint32_t m_length = 0; |
24 | | uint32_t m_offset = 0; |
25 | | |
26 | | void readPoint(shapeObj *); |
27 | | void readMultiPoint(shapeObj *); |
28 | | void readLineString(shapeObj *); |
29 | | void readMultiLineString(shapeObj *); |
30 | | void readPolygon(shapeObj *); |
31 | | void readMultiPolygon(shapeObj *); |
32 | | //void readGeometryCollection(shapeObj *); |
33 | | |
34 | | void readLineObj(lineObj *line); |
35 | | |
36 | | public: |
37 | | GeometryReader( |
38 | | flatgeobuf_ctx *ctx, |
39 | | const FlatGeobuf::Geometry *geometry) : |
40 | 0 | m_ctx (ctx), |
41 | 0 | m_geometry (geometry), |
42 | 0 | m_geometry_type ((FlatGeobuf::GeometryType) ctx->geometry_type), |
43 | 0 | m_has_z (ctx->has_z), |
44 | 0 | m_has_m (ctx->has_m) |
45 | 0 | { } |
46 | | GeometryReader( |
47 | | flatgeobuf_ctx *ctx, |
48 | | const FlatGeobuf::Geometry *geometry, |
49 | | const FlatGeobuf::GeometryType geometry_type) : |
50 | 0 | m_ctx (ctx), |
51 | 0 | m_geometry (geometry), |
52 | 0 | m_geometry_type (geometry_type), |
53 | 0 | m_has_z (ctx->has_z), |
54 | 0 | m_has_m (ctx->has_m) |
55 | 0 | { } |
56 | | void read(shapeObj *); |
57 | | }; |
58 | | |
59 | | } |
60 | | } |
61 | | |
62 | | |
63 | | #endif /* FLATGEOBUF_GEOMETRYREADER_H */ |