70 lines
1.9 KiB
Nix
70 lines
1.9 KiB
Nix
{
|
|
lib,
|
|
pkgs,
|
|
stdenv,
|
|
fetchFromGitea,
|
|
}: let
|
|
runways = fetchTarball {
|
|
url = "https://opendata.arcgis.com/datasets/4d8fa46181aa470d809776c57a8ab1f6_0.zip";
|
|
sha256 = "sha256:1ivwx8glk8yk68nmqz467yzvlb3l66l1s3ibmd9p41wz737lmz88";
|
|
};
|
|
provinces = fetchTarball {
|
|
url = "https://naciscdn.org/naturalearth/10m/cultural/ne_10m_admin_1_states_provinces.zip";
|
|
sha256 = "sha256:06ai02b8rfsfzpa0gq4nsg29lxvwy4zvjw44099hc78vr7dkfsdp";
|
|
};
|
|
places = fetchTarball {
|
|
url = "https://naciscdn.org/naturalearth/10m/cultural/ne_10m_populated_places.zip";
|
|
sha256 = "sha256:1dhh569520f02yml1m5zp2znjv85cqbccl4nvpmigynxd37kid3j";
|
|
};
|
|
airports = fetchTarball {
|
|
url = "https://naciscdn.org/naturalearth/10m/cultural/ne_10m_airports.zip";
|
|
sha256 = "sha256:0893zg63ygr2l2d1wpyigls1syfkryjlygvnbbjikpqk5i5cwr56";
|
|
};
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
pname = "viz1090-mapdata";
|
|
version = "0.1.0";
|
|
|
|
src = fetchFromGitea {
|
|
domain = "git.vulpecula.zone";
|
|
owner = "tasiaiso";
|
|
repo = pname;
|
|
rev = "d1f53019b22a9e605506bed90fcffcdc5f7e6186";
|
|
hash = "sha256-gtv0u7o+5fqVgA0CHDWdZr0h9A1Nbky1+okHvSv1cVU=";
|
|
};
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
python3
|
|
python312Packages.pip
|
|
python312Packages.shapely
|
|
python312Packages.fiona
|
|
python312Packages.tqdm
|
|
python312Packages.requests
|
|
];
|
|
|
|
buildPhase = ''
|
|
mkdir -p mapdata
|
|
|
|
cp ${runways}/* mapdata
|
|
cp ${provinces}/* mapdata
|
|
cp ${places}/* mapdata
|
|
cp ${airports}/* mapdata
|
|
# ls -al mapdata
|
|
|
|
python3 mapconverter.py \
|
|
--mapfile mapdata/ne_10m_admin_1_states_provinces.shp \
|
|
--mapnames mapdata/ne_10m_populated_places.shp \
|
|
--airportfile mapdata/Runways.shp \
|
|
--airportnames mapdata/ne_10m_airports.shp
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
|
|
cp airportdata.bin $out
|
|
cp airportnames $out
|
|
cp mapdata.bin $out
|
|
cp mapnames $out
|
|
'';
|
|
}
|