|
1 | 1 | # ofmx2pgsql – TODO List |
2 | 2 |
|
3 | | -Build a lightweight importer for OpenFlightMaps OFMX data into PostgreSQL/PostGIS. |
4 | | - |
5 | | ---- |
6 | | - |
7 | | -## Phase -1 — Repository Setup |
8 | | - |
9 | | -- [x] Add contributor guidelines (`AGENTS.md`) |
10 | | -- [x] Add project overview (`README.md`) |
11 | | -- [x] Add progress log (`PROGRESS.md`) |
12 | | -- [x] Add base ignore rules (`.gitignore`) |
13 | | - |
14 | | ---- |
15 | | - |
16 | | -## Phase 0 — Scope & Principles |
17 | | - |
18 | | -- [ ] Define non-goals |
19 | | - - [ ] No rendering optimizations |
20 | | - - [ ] No tile generation |
21 | | - - [ ] No attempt to support all OFMX edge cases initially |
22 | | -- [ ] Decide target CRS |
23 | | - - [ ] Use EPSG:4326 only |
24 | | -- [ ] Decide geometry fidelity |
25 | | - - [ ] Points and polygons only (no arcs initially) |
26 | | -- [ ] Define vertical dimension handling |
27 | | - - [ ] Store altitudes as attributes (`lower_ft`, `upper_ft`) |
28 | | - - [ ] No 3D geometries in v1 |
29 | | - |
30 | | ---- |
31 | | - |
32 | | -## Phase 1 — Understand OFMX Structure |
33 | | - |
34 | | -- [ ] Obtain OFMX XSD schema |
35 | | -- [ ] Identify top-level entities |
36 | | - - [ ] Airports |
37 | | - - [ ] Runways |
38 | | - - [ ] RunwayEnds |
39 | | - - [ ] Airspaces |
40 | | - - [ ] Navaids |
41 | | - - [ ] Waypoints |
42 | | -- [ ] Map ID relationships |
43 | | - - [ ] Airport ↔ Runway |
44 | | - - [ ] Runway ↔ RunwayEnd |
45 | | -- [ ] Identify coordinate representations |
46 | | - - [ ] Lat/Lon formats |
47 | | - - [ ] Polygon definitions |
48 | | - - [ ] Circles / arcs |
49 | | -- [ ] Document mandatory vs optional fields |
50 | | - |
51 | | ---- |
52 | | - |
53 | | -## Phase 2 — Define PostGIS Schema |
54 | | - |
55 | | -- [x] Design core tables |
56 | | - - [ ] airports |
57 | | - - [ ] runways |
58 | | - - [ ] runway_ends |
59 | | - - [ ] airspaces |
60 | | - - [ ] navaids |
61 | | - - [ ] waypoints |
62 | | -- [x] Define primary keys |
63 | | -- [x] Store OFMX source IDs |
64 | | -- [x] Define foreign keys |
65 | | -- [x] Define geometry columns |
66 | | - - [x] POINT for airports, navaids, waypoints |
67 | | - - [x] LINESTRING for runways, POINT for runway ends |
68 | | - - [x] MULTIPOLYGON for airspaces |
69 | | -- [x] Add metadata fields |
70 | | - - [ ] source |
71 | | - - [ ] cycle |
72 | | - - [ ] valid_from |
73 | | - - [ ] valid_to |
74 | | -- [x] Create spatial indexes (GIST) |
75 | | - |
76 | | ---- |
77 | | - |
78 | | -## Phase 3 — Project Skeleton |
79 | | - |
80 | | -- [x] Create repository `ofmx2pgsql` |
81 | | -- [x] Choose language |
82 | | - - [x] Python |
83 | | -- [ ] Setup virtual environment |
84 | | -- [x] Setup CLI framework (`argparse` or `typer`) |
85 | | -- [x] Define project structure |
86 | | - |
87 | | ---- |
88 | | - |
89 | | -## Phase 4 — XML Parsing Layer |
90 | | - |
91 | | -- [x] Add parser module scaffold |
92 | | -- [x] Implement streaming XML parser (`xml.etree.ElementTree.iterparse`) |
93 | | -- [x] Implement entity parsers |
94 | | -- [x] Normalize coordinates to decimal degrees |
95 | | -- [x] Preserve OFMX IDs |
96 | | - |
97 | | ---- |
98 | | - |
99 | | -## Phase 5 — Geometry Construction |
100 | | - |
101 | | -- [ ] Convert coordinates to Shapely geometries |
102 | | -- [ ] Validate geometries |
103 | | -- [ ] Parse altitude limits |
104 | | - |
105 | | ---- |
106 | | - |
107 | | -## Phase 6 — Database Writer |
108 | | - |
109 | | -- [x] Implement database connection |
110 | | -- [x] Implement bulk inserts |
111 | | -- [x] Implement idempotent loads |
112 | | - |
113 | | ---- |
114 | | - |
115 | | -## Phase 7 — CLI Features |
116 | | - |
117 | | -- [x] Import command |
118 | | -- [x] Schema selection |
119 | | -- [x] Dry run |
120 | | -- [x] Verbose logging |
121 | | -- [x] Config file defaults |
122 | | - |
123 | | ---- |
124 | | - |
125 | | -## Phase 8 — Validation & QA |
126 | | - |
127 | | -- [x] Compare counts with source |
128 | | -- [x] JSON validation output |
129 | | -- [ ] Visual inspection in QGIS |
130 | | - |
131 | | ---- |
132 | | - |
133 | | -## Phase 9 — Documentation |
134 | | - |
135 | | -- [ ] README |
136 | | -- [ ] Example config |
| 3 | +Focused, remaining work for the OFMX-to-PostGIS importer. |
| 4 | + |
| 5 | +## Done (Milestones) |
| 6 | +- Repository bootstrapped (docs, config, tests, schema, CLI). |
| 7 | +- Parser and importer wired to LK sample data. |
| 8 | +- Import validation and dry-run workflows implemented. |
| 9 | +## Scope Decisions |
| 10 | +- Confirm non-goals (no rendering, no tile generation, limited edge-case support). |
| 11 | +- Lock CRS (EPSG:4326 only). |
| 12 | +- Confirm geometry fidelity (points, lines, polygons; arcs handled only via extension). |
| 13 | +- Decide altitude handling (attribute columns vs 3D geometries). |
| 14 | + |
| 15 | +## OFMX Understanding |
| 16 | +- Obtain and pin the OFMX XSD schema version used by the dataset. |
| 17 | +- Document mandatory vs optional fields for Ahp/Rwy/Rdn/Ase/Dpn/Ndb/Vor/Dme. |
| 18 | +- Clarify coordinate formats and arc/circle handling in core XML vs extensions. |
| 19 | + |
| 20 | +## Parsing & Geometry |
| 21 | +- Add geometry construction helpers (Shapely or raw WKT) for non-airspace shapes. |
| 22 | +- Validate geometries (self-intersections, ring closure, SRID consistency). |
| 23 | +- Parse altitude limits into numeric fields with normalized units. |
| 24 | + |
| 25 | +## Database & Import |
| 26 | +- Populate metadata fields (`source`, `cycle`, `valid_from`, `valid_to`) during import. |
| 27 | +- Decide how to version or archive imports across cycles. |
| 28 | + |
| 29 | +## Validation & QA |
| 30 | +- Visual inspection in QGIS for a sample import. |
| 31 | +- Add a lightweight regression dataset comparison (counts + spot checks). |
0 commit comments