Closed
Conversation
… errors Agent-Logs-Url: https://github.com/paolobia/StradarioApp/sessions/633dd479-ebbd-4377-ac06-c2d7b2f504b2 Co-authored-by: paolobia <633707+paolobia@users.noreply.github.com>
…ount, improve comment Agent-Logs-Url: https://github.com/paolobia/StradarioApp/sessions/633dd479-ebbd-4377-ac06-c2d7b2f504b2 Co-authored-by: paolobia <633707+paolobia@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Create StradarioApp implementation with specified requirements
Implement StradarioApp from scratch
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creates a full Avalonia 11.2.0 desktop app for generating cartographic PDF stradarios from OpenStreetMap tile data. Nothing existed in the repo beyond a README.
Stack
Avalonia 11.2.0 · SkiaSharp 2.88.8 · BruTile 4.0.0 · PdfSharpCore 1.3.65 · Newtonsoft.Json 13.0.3
Structure
Models/StradarioModels.cs—PageSize/PageOrientation/MapScaleenums,TileServers(5 hardcoded OSM-compatible servers),StradarioSettingswith page-dimension and km-coverage helpers,GeoRect,MapPage,StradarioProject(.stradario= plain JSON)Services/GeoUtils.cs— WebMercator pixel↔geo conversions, tile index helpers, haversine.CalcOptimalZoomuses fixed 96 DPI (OSM reference), notsettings.Dpi, to avoid over-zoomed rendersServices/MapRenderer.cs—TileCachebacked by twoConcurrentDictionarys (hits + in-flight); failed tiles are intentionally not cached so they retry next frame.RenderMapis synchronous (SKCanvas not thread-safe); tile downloads are fire-and-forgetTask.Runwith 8 s timeout, callingInvalidateVisualon successServices/PdfGenerator.cs—SortPagesgroups pages into latitude rows with 40% height tolerance before sorting N→S, W→E (plain lat sort breaks adjacent pages with slight misalignment).RenderTilesAsyncusesSemaphoreSlim(4)to respect OSM policy. Overview zoom useslatExtent * cosLatin the denominator (not divided bycosLat) to avoid deformed rectanglesServices/FontResolver.cs—IFontResolverfor PdfSharpCore on Linux; scans/usr/share/fonts,~/.fonts,C:\Windows\Fonts;DefaultFontNameis"dejavusans|false|false"(required by interface)Services/CityDatabase.cs— Singleton lazy-loaded fromcities500.csv(GeoNames format). Custom CSV parser handles quoted numeric fields.Describe()returns top-N cities by population within aGeoRectUI/MapCanvas.cs— CustomControl(no external SkiaSharp-Avalonia package); hooks intoISkiaSharpApiLeaseFeatureviaICustomDrawOperation.Render:Posts
InvalidateVisualatBackgroundpriority for continuous tile-driven redrawsUI/MainWindow.cs— Code-only layout with toolbar, scrollable page list, and map canvas. Pan usesTileYToLaton the translated tile-Y coordinate (correct non-linear Mercator), not a linear lat offset. UsesStorageProvider.OpenFilePickerAsync/SaveFilePickerAsync(Avalonia 11 API). Unsaved-changes guard is fully async for both window close and New/Open actionsUI/SettingsWindow.cs— Combos for format/orientation/DPI/scale/server with live km-coverage preview;BuildSettingsFromControls()reconstructsStradarioSettingsfrom indicesUI/EditPageWindow.cs— Accepts both.and,as decimal separator; "📍 Città principali" button callsCityDatabase.Describeagainst the computed page boundsUI/ProgressWindow.cs—Window.Close()is non-virtual; usesSafeClose()pattern (sets_allowCloseflag before callingbase.Close()) to bypass theClosingguardProgram.cs—FontResolver.Register()before anything,CityDatabase.EnsureLoaded()onTask.Run,FluentTheme+ThemeVariant.Light(prevents illegible white text on Windows dark mode)Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
av-build-tel-api-v1.avaloniaui.net/usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.29/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.29/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll(dns block)/usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.29/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.29/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll 0 -j ACCEPT(dns block)/usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.29/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.29/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll 1 1(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Create StradarioApp from scratch as specified in the provided Italian prompt. Implement the exact file structure and all code requirements, using Avalonia 11.2.0, SkiaSharp 2.88.8, BruTile 4.0.0, PdfSharpCore 1.3.65, Newtonsoft.Json 13.0.3. Do not use non-existent or forbidden packages. Ensure Program.cs calls FontResolver.Register() before everything, starts CityDatabase.EnsureLoaded() in background, sets FluentTheme and RequestedThemeVariant Light. Implement Models enums, TileServers list, StradarioSettings methods, GeoRect, MapPage, StradarioProject. Implement GeoUtils WebMercator conversions and CalcOptimalZoom using fixed 96 DPI, plus tile conversion functions and haversine. Implement MapRenderer with TileCache that caches only successes and tracks in-flight downloads, HttpClient user-agent and timeout, synchronous RenderMap that draws cached tiles and fires background downloads, plus DrawPages overlay with selected style and label shadow. Implement custom MapCanvas control using Avalonia.Skia ISkiaSharpApiLeaseFeature with continuous invalidation. Implement MainWindow in code-only with toolbar, left page list, map interactions (pan/zoom/add page/drag page) per spec, StorageProvider dialogs, dirty state, closing confirm dialog, and settings integration with cache clear on server change. Implement SettingsWindow with combos, live preview, nullable combo fields, BuildSettingsFromControls. Implement EditPageWindow with coords parsing accepting ',' and '.', and button to fill description using CityDatabase.Describe and GeoUtils.CalcPageBounds. Implement ProgressWindow with using Avalonia for Thickness and safe Close override. Implement PdfGenerator with SortPages grouping tolerance, PDF structure (index, overview, pages), index table formatting, overview zoom formula with latExtent*cosLat, shared RenderTilesAsync parallel downloads with SemaphoreSlim(4), 10s tile timeout, draw only after WhenAll, and page borders (15mm margin and rotated text strips). Implement FontResolver for PdfSharpCore scanning system fonts; must implement DefaultFontName property and Register sets GlobalFontSettings.FontResolver. Implement CityDatabase loading cities500.csv from multiple locations, custom CSV parser handling quoted numeric fields, singleton/lazy load, FindTopCities and Describe.
Also implement ProjectService for load/save .stradario JSON and updating LastModified and view state. Ensure app compiles and runs on Windows/Linux. Add any minimal supporting code needed (e.g., SkiaPaintEventArgs, MapDrawOperation, helper dialogs). Do not add AXAML; everything code-only.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: # Prompt per ricreare StradarioApp da zero
Obiettivo
Crea un'applicazione desktop C# portabile Linux/Windows chiamata StradarioApp
per creare stradari cartografici in PDF con dati OpenStreetMap.
Stack tecnologico
.csproj — versioni ESATTE, non cambiarle
SkiaSharp.Views.Avalonia→ non esiste, il canvas si implementa a manoAvalonia.Controls.Skia→ instabile per Avalonia 11, non usareBruTile.MbTiles→ non necessarioStruttura file
Program.cs
FontResolver.Register()PRIMA di tuttoCityDatabase.EnsureLoaded()in background conTask.Run()FluentThemeRequestedThemeVariant = ThemeVariant.Lightper evitare testibianchi illeggibili su Windows dark mode
Models/StradarioModels.cs
Enums:
PageSize: A5,...This pull request was created from Copilot chat.