Update docs and provide data

This commit is contained in:
2024-02-14 13:53:06 +13:00
parent cb11134c6e
commit c5a2c547b1
16 changed files with 381141 additions and 82470 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-51
View File
@@ -56,8 +56,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kotuku.Yehudi", "Kotuku.Yeh
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kPFD", "kPFD\kPFD.vcxproj", "{3EEE26F1-E7E8-4143-B41F-F62CC3240B74}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gluon", "gluon\gluon.vcxproj", "{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -1075,54 +1073,6 @@ Global
{3EEE26F1-E7E8-4143-B41F-F62CC3240B74}.Release|x64.Build.0 = Release|x64
{3EEE26F1-E7E8-4143-B41F-F62CC3240B74}.Release|x86.ActiveCfg = Release|Win32
{3EEE26F1-E7E8-4143-B41F-F62CC3240B74}.Release|x86.Build.0 = Release|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Debug|Any CPU.ActiveCfg = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Debug|Any CPU.Build.0 = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Debug|ARM.ActiveCfg = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Debug|ARM.Build.0 = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Debug|ARM64.ActiveCfg = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Debug|ARM64.Build.0 = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Debug|Win32.ActiveCfg = Debug|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Debug|Win32.Build.0 = Debug|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Debug|x64.ActiveCfg = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Debug|x64.Build.0 = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Debug|x86.ActiveCfg = Debug|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Debug|x86.Build.0 = Debug|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.MFD3 ATT Debug|Any CPU.ActiveCfg = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.MFD3 ATT Debug|Any CPU.Build.0 = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.MFD3 ATT Debug|ARM.ActiveCfg = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.MFD3 ATT Debug|ARM.Build.0 = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.MFD3 ATT Debug|ARM64.ActiveCfg = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.MFD3 ATT Debug|ARM64.Build.0 = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.MFD3 ATT Debug|Win32.ActiveCfg = Debug|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.MFD3 ATT Debug|Win32.Build.0 = Debug|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.MFD3 ATT Debug|x64.ActiveCfg = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.MFD3 ATT Debug|x64.Build.0 = Debug|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.MFD3 ATT Debug|x86.ActiveCfg = Debug|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.MFD3 ATT Debug|x86.Build.0 = Debug|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release Library|Any CPU.ActiveCfg = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release Library|Any CPU.Build.0 = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release Library|ARM.ActiveCfg = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release Library|ARM.Build.0 = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release Library|ARM64.ActiveCfg = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release Library|ARM64.Build.0 = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release Library|Win32.ActiveCfg = Release|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release Library|Win32.Build.0 = Release|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release Library|x64.ActiveCfg = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release Library|x64.Build.0 = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release Library|x86.ActiveCfg = Release|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release Library|x86.Build.0 = Release|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release|Any CPU.ActiveCfg = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release|Any CPU.Build.0 = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release|ARM.ActiveCfg = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release|ARM.Build.0 = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release|ARM64.ActiveCfg = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release|ARM64.Build.0 = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release|Win32.ActiveCfg = Release|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release|Win32.Build.0 = Release|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release|x64.ActiveCfg = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release|x64.Build.0 = Release|x64
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release|x86.ActiveCfg = Release|Win32
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1150,7 +1100,6 @@ Global
{C051ED84-1371-44C9-9E00-8B62087EA08D} = {1C4FE345-57D4-457D-9CEC-91A1FEF73BBD}
{1C90B5C4-E118-4472-9537-7C01CD9A317A} = {4CB3C7E9-6443-45F6-826C-83A9B340409E}
{3EEE26F1-E7E8-4143-B41F-F62CC3240B74} = {4CB3C7E9-6443-45F6-826C-83A9B340409E}
{62BF2F9A-6810-4768-A8B9-B149F6DE2D76} = {1C4FE345-57D4-457D-9CEC-91A1FEF73BBD}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F5E45BE9-C085-4F05-A7C3-CF7D629E779B}
+12
View File
@@ -0,0 +1,12 @@
This project is used to dump the contents of a CanFly database.
Usag: dumpdb options path
Options are one of:
-r <w,n,e,s> set the spatial rect as west, north, east, south
-h Print help
Example: dumpdb \Projects\map_data\coastlines.db
+1 -1
View File
@@ -12,7 +12,7 @@ static void print_help()
<< " Options are one of:" << endl
<< " -r <w,n,e,s> set the spatial rect as west, north, east, south" << endl
<< " -h Print help" << endl
<< "example: shp2db \\Projects\\map_data\\coastlines.db" << endl;
<< "example: dumpdb \\Projects\\map_data\\coastlines.db" << endl;
}
static bool has_option(cargs_t& args, const char* opt)
+73
View File
@@ -0,0 +1,73 @@
This project encapsulates the client side tools library to create a mapping database. The mapping database is an optimized structure for use on small systems.
The database contains a 128 byte header that describes the contents of the database. The header exists at the project location:
libs\atomdb\atomdb_schema.h
/* This file describes the on-disk format of all spatial objects.
* The definition of the spatial types is in spatial.h
*/
typedef enum {
db_null, // not a valid database type
db_terrain, // a terrain database
db_spatial, // some sort of goepspatial features
db_index, // indexed to strings in another database
} spatial_db_format;
typedef struct PACKED _ymd_t {
uint16_t year;
uint8_t month;
uint8_t day;
} ymd_t;
// is KOTU
#define DB_MAGIC 0x54554b4f
/**
* @brief All database files start with this header (96 bytes long)
*/
typedef struct PACKED _db_header_t {
uint32_t magic; // header magic 4
uint32_t length; // size of the header 4
spatial_db_format db_type; // storage type of the database 4
uint32_t content_type; // what is stored in this database 4
ymd_t effective_from; // effective from 4
ymd_t effective_to; // when expires 4
char name[32]; // database name 32
spatial_rect_t bounds; // area described by this database 16
uint32_t string_table; // offset to the strings 4
uint32_t string_table_length; // length of the string table 4
// the following are used to select display objects
//
uint16_t min_scale; // min mtrs * 100 to display 2
uint16_t max_scale; // max mtrs * 100 to display (0 = no limit) 2
uint8_t reserved[12];
} db_header_t;
This library has routines to write this header and subsequent headers. Depending on the type of database there will be a different header. The database types are:
- Terrain - stores pixel maps 120x120 pixels that are dependent on the resolution. For 30 arc seconds data from GTOPO30 this is 1 degree, for 15 arc seconds this is 0.5 degrees and for
7.5 arc seconds this is 0.25 degrees. The terrain data is stored with calculated hillshading using the tool gtopo2db
- Spatial - this is the most common, but also smallest database type. It stores vector information for contours, airspaces, routes etc. Created by a variety of tools.
- Index - After the header and spatial index the system stores strings. String are stored in
utf-8 and the system will re-use strings where possible.
## Strings
To save space strings are stored in the spatial database in packed form. The code in this
library will coalesce strings and re-use string fragments. Any strings stored in spatial
entities are referred to using a string reference:
/**
* @brief This is referred to a string
* in the database. These are stored as packed
* strings, and the function resolve_string() must be called
* to resolve it.
* Allows for overlapped string usage
*/
typedef struct PACKED _spatial_string_t {
uint32_t offset; // offset into the database string table
uint32_t length; // length of the string in the packed table
} spatial_string_t;
A Spatial index can then index a field in a spatial database such as a waypoint name using the string reference only.
+16
View File
@@ -0,0 +1,16 @@
This project will take a directory that contains geo json files and generate a database from them.
example usage:
nzaip2db -s "C:\Projects\NZDATA" -r W180,N90,E180,S60 -n "NZ Airspace" C:\Projects\map_data\nz_airspace.db
The path C:\Projects\map_data is also hard coded at present in the map constructor at
diy-efis\libs\mfdlib\mfd_layout.c : Line 83
if (failed(result = load_layers(wnd, "C:\\Projects\\map_data")))
return result;
All of the tools put the databases in there
+1 -1
View File
@@ -32,7 +32,7 @@ static void print_help()
<< " -n <name> set the name" << endl
<< " -z <min>,<max> set the min-max scale for the geography (required)"
<< " -m <filename> create a metadata file that exports the shape metadata" << endl
<< "example: air2db -s /Projects/NZDATA -c 2301 -n \"NZANR\" /Projects/map_data/nz.db" << endl;
<< "example: nzaip2db -s /Projects/NZDATA -c 2301 -n \"NZANR\" /Projects/map_data/nz.db" << endl;
}
static void add_path(kotuku::spatial_entity* entity, const rapidjson::Value& path,
-40
View File
@@ -1,40 +0,0 @@
set(PROJECT_NAME shp2db)
################################################################################
# Source groups
################################################################################
set(no_group_source_files
"cargs.cpp"
"cargs.h"
"db_geometry.h"
"dbfopen.c"
"geometry_db.cpp"
"main.cpp"
"safileio.c"
"sbnsearch.c"
"shapefil.h"
"shpopen.c"
"shptree.c"
"spatial_entity.cpp"
"spatial_linestring.cpp"
"spatial_point.cpp"
"spatial_polygon.cpp"
"spatial_polyline.cpp"
)
source_group("" FILES ${no_group_source_files})
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_C_STANDARD 99)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
add_compile_options(/EHsc)
set(ALL_FILES
${no_group_source_files}
)
################################################################################
# Target
################################################################################
add_executable(${PROJECT_NAME} ${ALL_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "apps/dbtools")
+22
View File
@@ -0,0 +1,22 @@
This is probably the most complex of the database tools in that it converts shapefiles into databases.
Usage: shp2db Options path
Options are one of:
-h Print help
-s <path> set source path to <path> (as many as required)
-t <type> set the container type (required)
-r <w,n,e,s> set the spatial rect as west, north, east, south
-n <name> set the name
-z <min>,<max> set the min-max scale for the geography (required)
-m <filename> create a metadata file that exports the shape metadata
example: shp2db -s \\Projects\\contours\\land.shp -t coastlines -r W180,N90,E180,S60 -n \"Coastlines 7.5 arcsec\" -c 2301 \\Projects\\map_data\\coastlines.db;
File diff suppressed because it is too large Load Diff