Kosmos bugs

From OpenStreetMap Wiki
Jump to: navigation, search

Kosmos Bugs

Here you can discuss bugs found in the Kosmos renderer.

Funny Looking Letters In Street Names

Hello Breki! Very great & excellent overall product! I am astonished at your progress! I have noticed something maybe you can help. But I noticed when I render maps, sometimes street or neighborhood level names appear with letters hard-angle turned in some odd or funny directions, like even almost upside down or +45 degree and -45 degree angles side-by-side when they don't need to be. What I mean is, usually not consistent enough smooth 'wrapping' around a turn or bend they might be trying to wrapping around. I guess that is what I am feeling looking at it. Large labels look great!... but only on straight lines or streets. It's just the streets seem to boggle the renderer. Is there anyway to smooth this out for the little names, or is this a impossible hard-code rendering issue? :-)

I think what you described happens when the label tries to wrap around a particularly awkward bend of a way (if not, please upload a sample rendering). It should be possible to fix this, but it would require more complexity for an already complex algorithm for drawing text along ways - which means a lot of development work and also slower drawing in Kosmos. So for now you'll have to live with it, I'm afraid :). As a consolation, observe how other renderers have similar problems: [1] (see how elevations for relief contours are rendered awkwardly) --Breki 14:45, 8 September 2008 (UTC)
Ah I see. I actually run Kosmos on a QUAD-CORE with 18 GB of RAM (kinda hefty I know). I use this production machine for lots of heavy lifting work, and it runs like a snap. I have uploaded a couple samples.

Map example1.gif Map example2.jpg

Although not perfect, you can see how smoothing is handled on Google. I tried to get the approximate same street spots to compare apples to apples. Maybe a switch like -smoothing or something would be a sacrifice to enable higher quality (albeit maybe slower) renderings on older machines. You can see how there seems to also be some rough ends on the streets, vs. curved bends and ends, which probably makes the wrapping easier to follow I guess :)
Nice compliment to Kosmos - comparing it with Google Maps, thanks ;) Juat joking. But comparison with Google Maps isn't the right one, since the underlying data (ways) is not the same. As for high quality/low quality switch for text rendering - this is possible (actually it already exists in Kosmos GUI for some other stuff), but with all the features still missing in Kosmos it's not on top of my priority list. Mainly because it will probably require a lot more than just a few hours of work. You have to understand that Kosmos was not intended to replace Mapnik and Osmarender in terms of rendering capabilities - it will (probably?) never do that. I try to steer it towards mapping interactivity and features which are not present in other OSM renderers. But hopefully the quality of rendering should also improve in the future. --Breki 16:00, 11 September 2008 (UTC)
Hehe, I was really looking more at presentation -- but I think Google maps have their own unique problems. But, in some ways I think it is better (your stuff - toolset wise & freedom wise to do many neat things with the data), ... and we (my dev team) think you are getting pretty close on presentation. Just a few little cosmetic things, hopefully will not take months of hard labor, but a weekend of beer & patience haha. But, I hope you will offer special new options to tidy up lines and corners maybe different smoothing options, rounded or courser maybe (Fuzzy-type logic?), and cap off street ends, and maybe do some neat stuff with little text that wraps around circle, cul-de-sacs, etc. The work will result in going beyond Google in terms of tools & its features for sure :D My thinking is it appears the Kosmos rendered street names are logically trying to wrap around the direction of the street the way they are being generated... so a hard-45 degree turn sort of forces letters to flip abnormally, instead of maybe a slight 1 degree at a time incline to the end (er, maybe more of a math problem I see). I hope you will spend some time on this, because the icing on the cake will make this a truly flawless & unique gift to us all out here! Forget those other packages :P Best wishes & REGARDS, --Zebra2



Generating Shaded Relief (both methods)

When trying to generate a shaded relief while the rendered scope contains areas whithout OSM data (blank areas), an error is thrown:

  Kosmos Version: 2.0.311.1
  OS Version: Microsoft Windows NT 6.0.6001 Service Pack 1
  CLR Version: 2.0.50727.1434
  Current culture: English (United States)
  Current UI culture: English (United States)
  
  System.ArgumentException: Der Wert -2147483648 ist für alpha ungültig. alpha muss größer als oder gleich 0 und kleiner als oder gleich 255 sein.
     at System.Drawing.Color.CheckByte(Int32 value, String name)
     at System.Drawing.Color.FromArgb(Int32 alpha, Int32 red, Int32 green, Int32 blue)
     at Brejc.DemLibrary.Shading.IgorShadingMethod.CalculateColor(Double elevation, Double aspect, Double slope) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Brejc.DemLibrary\Shading\IgorShadingMethod.cs:line 41
     at Brejc.DemLibrary.DemProcessor.GenerateShadedReliefImage(IRasterDigitalElevationModel dem, IShadingMethod shadingMethod, ShadingParameters shadingParameters) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Brejc.DemLibrary\DemProcessor.cs:line 74
     at Kosmos.Gui.Activities.GenerateShadedReliefActivity.Run(IActivityRunner runner, Object[] args) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos.Gui.Controls\Activities\GenerateShadedReliefActivity.cs:line 42
     at BrekiViews.WinForms.BlockingActivityRunner.worker_DoWork(Object sender, DoWorkEventArgs e) in d:\MyStuff\BuildArea\Sandbox\BrekiViews\trunk\source\BrekiViews.WinForms\BlockingActivityRunner.cs:line 130

Zooming in until no "blank" areas are rendered fixes the symptom.

--dea 21:46, 21 October 2008 (UTC)

Thanks for the report, I'll fix this for the next release --Breki 04:22, 24 October 2008 (UTC)

Importing Project

This exception is appear, when i open project. But before it was ok. Before means: I ve try to load 100m+ OSM file, but failed too

Kosmos Version: 2.0.116.1
OS Version: Microsoft Windows NT 5.1.2600 Service Pack 3
CLR Version: 2.0.50727.832
Current culture: English (United States)
Current UI culture: English (United States)

System.OverflowException: Value for Double was too low or too high

  at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
  at System.Double.Parse(String s, NumberStyles style, NumberFormatInfo info)
  at Brejc.Geometry.Bounds2.Parse(String value) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Brejc.Geometry\Bounds2.cs:line 335
  at Kosmos.KosmosProject.Load(String fileName, AsyncOperationCallback callback) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\KosmosProject.cs:line 312
  at Kosmos.Gui.Activities.LoadKosmosProjectActivity.Run(IActivityRunner runner, Object[] args) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos.Gui.Controls\Activities\LoadKosmosProjectActivity.cs:line 35
  at BrekiViews.WinForms.BlockingActivityRunner.worker_DoWork(Object sender, DoWorkEventArgs e) in d:\MyStuff\BuildArea\Sandbox\BrekiViews\trunk\source\BrekiViews.WinForms\BlockingActivityRunner.cs:line 130
Looks like Kosmos saved a corrupted project file, probably because of a bug in the previous versions. I recommend downloading the latest version of Kosmos and recreating the project in the GUI. If this happens again after that, please let me know. --Breki 05:36, 29 July 2008 (UTC)

Importing Project - RenderRules problem

I installed Kosmos 2 today without reading about it as I've dabbled with previous versions. Realised projects are saved differently but got over that, created a new one anyway and saved to the new file format. On trying to open the project later I got some errors.

  • The first error was looking for DefaultRules.txt yet I never heard I needed one of those in the same folder as my project(not the Kosmos folder). I got round it by renaming my local rules file to that name.
  • Second error is this...

Kosmos Version: 2.0.116.1 OS Version: Microsoft Windows NT 5.1.2600 Service Pack 2 CLR Version: 2.0.50727.42 Current culture: English (United States) Current UI culture: English (United States)

Kosmos.RenderingRules.RenderingRulesParseException: Invalid template parameter: '13:1;17:6'

  at Kosmos.RenderingRules.OsmWikiRenderingRulesSource.ParseParameters(IElementRenderingTemplate template, String textToParse, String line, Int32 lineCount) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\RenderingRules\OsmWikiRenderingRulesSource.cs:line 157
  at Kosmos.RenderingRules.OsmWikiRenderingRulesSource.TryParseTemplatesStandardForm(FileParser parser, String textToParse) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\RenderingRules\OsmWikiRenderingRulesSource.cs:line 399
  at Kosmos.RenderingRules.OsmWikiRenderingRulesSource.ParseRules(RenderingRuleSet rules) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\RenderingRules\OsmWikiRenderingRulesSource.cs:line 361
  at Kosmos.RenderingRules.OsmWikiRenderingRulesSource.LoadRules() in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\RenderingRules\OsmWikiRenderingRulesSource.cs:line 59
  at Kosmos.Gui.RenderingRulesLoader.Load() in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos.Gui.Controls\RenderingRulesLoader.cs:line 89
  at Kosmos.Gui.Activities.LoadKosmosProjectActivity.Run(IActivityRunner runner, Object[] args) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos.Gui.Controls\Activities\LoadKosmosProjectActivity.cs:line 41
  at BrekiViews.WinForms.BlockingActivityRunner.worker_DoWork(Object sender, DoWorkEventArgs e) in d:\MyStuff\BuildArea\Sandbox\BrekiViews\trunk\source\BrekiViews.WinForms\BlockingActivityRunner.cs:line 130
- LastGrape 21:59, 29 July 2008 (UTC)
The DefaultRules problem is a bug - you don't need DefaultRules in the project directory, I'll fix this. The DefaultRules.txt come with the package and are used only if the project wants to download the rules using HTTP and the download fails. As for the second problem: are you using the latest version of Kosmos? In general if you encounter problems with Kosmos, please download the latest version and check if the problem occurs there. --Breki 09:33, 30 July 2008 (UTC)

Illegal value for Int32

Some colours are giving me problems, with error messages like "3BB347 is not a valid value for Int32".

Edit: Which is a user error (missing # in colour definition), but the error message is not the most user friendly. Gustavf 11:11, 23 July 2008 (UTC)

Kosmos.Gui

   Assembly Version: 2.0.0.0
   Win32 Version: 2.1.21.0
   CodeBase: file:///C:/Users/gustavf/Programmer/Kosmos/Gui/Kosmos.Gui.exe

System.Exception: 3BB347 is not a valid value for Int32. ---> System.FormatException: Input string was not in a correct format.

  at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
  at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
  at System.ComponentModel.Int32Converter.FromString(String value, NumberFormatInfo formatInfo)
  at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
  --- End of inner exception stack trace ---
  at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
  at System.ComponentModel.TypeConverter.ConvertFromString(ITypeDescriptorContext context, CultureInfo culture, String text)
  at System.Drawing.ColorConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
  at System.ComponentModel.TypeConverter.ConvertFromString(String text)
  at System.Drawing.ColorTranslator.FromHtml(String htmlColor)
  at Kosmos.GdiMapPainting.GdiMapPainter.GetColorFromHtml(String htmlColor) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\GdiMapPainting\GdiMapPainter.cs:line 412
  at Kosmos.GdiMapPainting.GdiMapPainter.GetBrush(String color) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\GdiMapPainting\GdiMapPainter.cs:line 285
  at Kosmos.GdiMapPainting.StyleHelpers.GdiMapPainterPolygonStyleHelper.DoPrepare(GdiMapPainter mapPainter, IMapView mapView) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\GdiMapPainting\StyleHelpers\GdiMapPainterPolygonStyleHelper.cs:line 51
  at Kosmos.GdiMapPainting.StyleHelpers.StyleHelperBase.Prepare(GdiMapPainter mapPainter, IMapView mapView) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\GdiMapPainting\StyleHelpers\StyleHelperBase.cs:line 18
  at Kosmos.GdiMapPainting.GdiMapPainter.RequestStyleHelper[T](Guid styleId, GdiMapPainterCommandBase styleHelperCreator, IMapView mapView) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\GdiMapPainting\GdiMapPainter.cs:line 85
  at Kosmos.GdiMapPainting.GdiMapPainterPolygonCommand.DoDraw(IMapView mapView, MapPaintingStage paintingStage, Boolean preparationPhase) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\GdiMapPainting\GdiMapPainterPolygonCommand.cs:line 112
  at Kosmos.GdiMapPainting.GdiMapPainterCommandBase.Draw(IMapView mapView, MapPaintingStage paintingStage, Boolean preparationPhase) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\GdiMapPainting\GdiMapPainterCommandBase.cs:line 66
  at Kosmos.GdiMapPainting.GdiMapPainter.PaintMap(IMapView mapView) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\GdiMapPainting\GdiMapPainter.cs:line 172
  at Kosmos.Gui.Forms.MapDisplayForm.pictureBoxMap_Paint(Object sender, PaintEventArgs e) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos.Gui.Controls\Forms\MapDisplayForm.cs:line 282
  at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
  at System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe)
  at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
  at System.Windows.Forms.Control.WmPaint(Message& m)
  at System.Windows.Forms.Control.WndProc(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Gustavf 11:02, 23 July 2008 (UTC)

I agree with you, unfortunately there are a lot of these "user data entry" points in Kosmos and it's difficult to cover them all in a user friendly way - I'm doing it in small steps. I'll add a more friendly error description for this one right now. --Breki 14:30, 23 July 2008 (UTC)

Error opening osm.bz2 file (about 10Mbytes)

Version: 2.0.508.0

Reporter: ----Astrofreak85 13:46, 17 July 2008 (UTC)

Error Description

Kosmos starts loading of the file, but the this error apears. Maybe the file is to big, but the Kosmos should show an Error like: "OSM file to big for processing, please select an smaler one." Or something like this...

Kosmos Version: 2.0.108.0
OS Version: Microsoft Windows NT 6.0.6001 Service Pack 1
CLR Version: 2.0.50727.1434
Current culture: English (United States)
Current UI culture: English (United States)
System.ArgumentException: Ein Element mit dem gleichen Schlüssel wurde bereits hinzugefügt.
  at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
  at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
  at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
  at OsmUtils.Framework.OsmDatabase.ImportData(osm osmData, Boolean ignoreDuplicates) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\OsmUtils.Framework\OsmDatabase.cs:line 297
  at Kosmos.MapSources.OsmDataFile.Load(String projectDirectory) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\MapSources\OsmDataFile.cs:line 56
  at Kosmos.Gui.Activities.AddFilesToProjectActivity.Run(IActivityRunner runner, Object[] args) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos.Gui.Controls\Activities\AddFilesToProjectActivity.cs:line 98
  at BrekiViews.WinForms.BlockingActivityRunner.worker_DoWork(Object sender, DoWorkEventArgs e) in d:\MyStuff\BuildArea\Sandbox\BrekiViews\trunk\source\BrekiViews.WinForms\BlockingActivityRunner.cs:line 130
This issue is being resolved. The problem is that the OSM file in question has relations with ways appearing multiple times in a relation. As far as I know this is not legal in OSM, but I'll make some additional checks. --Breki 05:16, 18 July 2008 (UTC)

Error opening GPX file with "xmlns" tag

Version: 2.0.508.0

Reporter: --Indomapper 09:34, 16 July 2008 (UTC)

Error Description

I have several gpx files which throw following exception when opened in Kosmos:

Kosmos Version: 2.0.108.0
OS Version: Microsoft Windows NT 6.0.6001 Service Pack 1
CLR Version: 2.0.50727.1434
Current culture: English (United States)
Current UI culture: English (United States)
System.InvalidOperationException: There is an error in XML document (2, 2). ---> System.InvalidOperationException: <gpx xmlns='http://www.topografix.com/GPX/1/0'> was not expected.
  at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReadergpxType.Read15_gpx()
  --- End of inner exception stack trace ---
  at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
  at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
  at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream)
  at Brejc.GpsLibrary.Gpx.GpxFile.Load(Stream stream) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Brejc.GpsLibrary\Gpx\GpxFile.cs:line 116
  at Brejc.GpsLibrary.Gpx.GpxFile.Load(String filePath) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Brejc.GpsLibrary\Gpx\GpxFile.cs:line 102
  at Kosmos.MapSources.GpxDataFile.Load(String projectDirectory) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\MapSources\GpxDataFile.cs:line 48
  at Kosmos.Gui.Activities.AddFilesToProjectActivity.Run(IActivityRunner runner, Object[] args) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos.Gui.Controls\Activities\AddFilesToProjectActivity.cs:line 97
  at BrekiViews.WinForms.BlockingActivityRunner.worker_DoWork(Object sender, DoWorkEventArgs e) in d:\MyStuff\BuildArea\Sandbox\BrekiViews\trunk\source\BrekiViews.WinForms\BlockingActivityRunner.cs:line 130

If I changed the gpx tag from <gpx xmlns="http://www.topografix.com/GPX/1/0" to <gpx xmlns="http://www.topografix.com/GPX/1/1" everything works again.

It's a great program, thanks for creating this!

Update: The error also happens if the gpx tag does not have the xmlns tag --Indomapper 09:53, 16 July 2008 (UTC)

The code for paring GPX files has been generated automatically, so I don't have much control over it. Also, it was generated from a GPX version 1.1 schema and it doesn't know how to parse version 1.0 files. I'll try to fix these problems in the future, in the meantime I suggest using gpsbabel to convert 1.0 GPX files to 1.1. --Breki 05:18, 18 July 2008 (UTC)

Error exporting to pictures (probably solved)

Occurred in version 2.0.508.0

Error Description

Seems to be fixed by adding RAM to my machine. However a program should give a message when it runs out of memory.

When I export the first picture everything is fine. When I then pan the map to another position and try to export the new position then I get exactly the same picture as the last one. I used a fairly large osm file (13M zipped). Am I doing something wrong? (By the way it's a wonderful program. Thanks for writing and maintaining!) Gary68

This is a bug, it should be working the way you wanted it to work. I'll fix it, thanks for the report. --Breki 05:20, 18 July 2008 (UTC)

Error during Start-up (Fixed)

Occurred in version: 2.0.507.2

Fixed in version: 2.0.508.0

Error Description

When I start Kosmos by clicking on \Gui\Kosmos.Gui I get the following error message:

  System.ArgumentException: Illegal hotkey 'Ctrl+N'.
  bei BrekiViews.WinForms.WinFormsMenuItem.set_Hotkey(String value) in d:\MyStuff\BuildArea\Sandbox\BrekiViews\trunk\source\BrekiViews.WinForms\WinFormsMenuItem.cs:Zeile 107.
  bei BrekiViews.Framework.MenuBuilder.Hotkey(String hotkey) in d:\MyStuff\BuildArea\Sandbox\BrekiViews\trunk\source\BrekiViews.Framework\MenuBuilder.cs:Zeile 76.
  bei Kosmos.Gui.KosmosGuiModule.OnLoad() in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos.Gui.Controls\KosmosGuiModule.cs:Zeile 171.
  bei BrekiViews.WinForms.ApplicationShell.LoadModule(String moduleName) in d:\MyStuff\BuildArea\Sandbox\BrekiViews\trunk\source\BrekiViews.WinForms\ApplicationShell.cs:Zeile 113.
  bei BrekiViews.WinForms.ApplicationShell.Initialize() in d:\MyStuff\BuildArea\Sandbox\BrekiViews\trunk\source\BrekiViews.WinForms\ApplicationShell.cs:Zeile 82.
  bei BrekiViews.WinForms.TdiShellForm.OnLoad(EventArgs e) in d:\MyStuff\BuildArea\Sandbox\BrekiViews\trunk\source\BrekiViews.WinForms\TdiShellForm.cs:Zeile 565.
  bei System.Windows.Forms.Form.OnCreateControl()
  bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
  bei System.Windows.Forms.Control.CreateControl()
  bei System.Windows.Forms.Control.WmShowWindow(Message& m)
  bei System.Windows.Forms.Control.WndProc(Message& m)
  bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
  bei System.Windows.Forms.ContainerControl.WndProc(Message& m)
  bei System.Windows.Forms.Form.WmShowWindow(Message& m)
  bei System.Windows.Forms.Form.WndProc(Message& m)
  bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
  bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Solution

It looks like the Microsoft's method for parsing hotkeys I used in Kosmos works differently on non-English Windows. I'll have to investigate this further before coming out with any patch. --Breki 03:53, 8 July 2008 (UTC)

Seems fixed in version 508.0 --John07 16:24, 8 July 2008 (UTC)
Thx a lot for the fix. Version 2.0.508.0 runs perfectly on a German Vista. --DelphiN 21:14, 9 July 2008 (UTC)

Error during Start-up

Occurred in version: 2.5.405.6

Error Description

When I start Kosmos by clicking on \Gui\Kosmos.Gui I get the following error message:

  Kosmos Version: 2.1.1.0
  OS Version: Microsoft Windows NT 6.0.6002 Service Pack 2
  CLR Version: 2.0.50727.4200
  Current culture: English (United States)
  Current UI culture: English (United States)
  System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for castle: That assembly does not allow partially trusted callers. (R:\download\garmin\Kosmos-2.5.405.6\Gui\Kosmos.Gui.exe.Config line 4) ---> System.Security.SecurityException: That assembly does not allow partially trusted callers.
  at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
  at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
  at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
  at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
  at System.Activator.CreateInstance(Type type, Boolean nonPublic)
  at System.Configuration.TypeUtil.CreateInstanceWithReflectionPermission(Type type)
  at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.Init(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
  at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.InitWithRestrictedPermissions(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
  at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory..ctor(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
  at System.Configuration.RuntimeConfigurationRecord.CreateSectionFactory(FactoryRecord factoryRecord)
  at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)
  The action that failed was:
  LinkDemand
  The assembly or AppDomain that failed was:
  System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  The Zone of the assembly that failed was:
  MyComputer
  The Url of the assembly that failed was:
  file:///C:/windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
  --- End of inner exception stack trace ---
  at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)
  at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
  at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission)
  at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
  at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
  at System.Configuration.ConfigurationManager.GetSection(String sectionName)
  at Castle.Core.Resource.ConfigResource..ctor(String sectionName)
  at Kosmos.Gui.Program.ConfigureWindsor() in d:\MyStuff\BuildArea\Sandbox\Kosmos\trunk\Kosmos.Solution\Kosmos.Gui\Program.cs:line 87
  at Kosmos.Gui.Program.Main(String[] args) in d:\MyStuff\BuildArea\Sandbox\Kosmos\trunk\Kosmos.Solution\Kosmos.Gui\Program.cs:line 48

Two things:

  1. From the log you pasted I see the actual version of Kosmos is 2.1.1.0
  2. Are perhaps running Kosmos from some kind of a network share?

Please try downloading Kosmos again and unzipping it locally to a completely new directory (no overwriting of old). Then let me know if you still have this problem. --Breki 18:32, 12 November 2009 (UTC)


OK now, tanks :-)

Kosmos 1.x support

It's not a bug, it's change request.

Error Description

I tried to open old Kosmos 1.x project that has .xml extension, but in new Kosmos 2 there is only *.kpr and all files. I was able to open old project with "all files" feature, but it can be useful to add .xml addtionaly.

Changing Rendering Rules

It is not easy to find how to change rules.

Once looking at that property on the root item, I try to change the url and get: Property value is not valid..
I've tried most of the rules in the, but none work.
- LastGrape 22:31, 29 July 2008 (UTC)
Again, are you using the latest version of Kosmos? --Breki 09:34, 30 July 2008 (UTC)

Problems With Expressions

I tried to switch to Kosmos_max_speed_rendering, but Kosmos 2.1.21.0 answered with an Error. What I did: Started Kosmos, created new project, added osm file (data got rendered with default rules), saved project, changed rules property of project, Kosmos shows an error message. Toralf 19:02, 9 August 2008 (UTC)

This is probably due to some maxspeed=* value not being a proper number. I'll add some exception handling for this in the next release. Can you tell me approximately what part of the world are you trying to render? --Breki 20:22, 10 August 2008 (UTC)
Yep this "bug" is cased because of some invalid integer values in the osm files. You can reproduce this with the Bremen area for example (or just add maxspeed=50 kmh or something like this to your example rendering. Problem is that the "ValueNum(e,"maxspeed")" part does not like non-integer. If you could add a way to ignore non integer or maybe adda way to strip any non-integer chars from the string automaticly, this would be great. --Etric Celine 23:11, 10 August 2008 (UTC)
Ignoring will probably be the only option, since I don't have much control over parsing and evaluating the expression - this is done by a 3rd party library. I'll look into it --Breki 11:32, 11 August 2008 (UTC)
I've just implemented a more robust handling of expressions - Kosmos should now not fail if the value is missing or invalid. It will be available in the next release (2.2) --Breki 19:47, 11 August 2008 (UTC)
great. thanks. --Etric Celine 22:49, 11 August 2008 (UTC)
Thanks a lot, guys. I shortend the above message. Toralf 06:56, 12 August 2008 (UTC)

Error while loading a map

When I load France in KOSMOS a error occurs which says "An item with the same key has already been added". Then I started searching what is wrong in the OSM. After a little bit of searching I figured out that the problem occurs when there are more than one <relation>-Tags in the OSM-File which have the type "multipolygon" and referes tu the same id.

example:

 <relation id="11962" timestamp="2008-05-01T15:57:00Z">
   <member type="way" ref="24061906" role="outer"/>
   <tag k="created_by" v="JOSM"/>
   <tag k="type" v="multipolygon"/>
 </relation>
 <relation id="11963" timestamp="2008-05-01T15:57:00Z">
   <member type="way" ref="24061906" role="outer"/>
   <tag k="created_by" v="JOSM"/>
   <tag k="type" v="multipolygon"/>
 </relation>

will NOT work cause both entries referse to the id "24061906".

Added by chrisz 16.08.2008

This has been fixed in Kosmos v2.2 --Breki 15:54, 25 September 2008 (UTC)


Exception on project reload

Loving Kosmos. I've been trying to experiment with rendering rules, but get an exception whenever I reload the project. I get this even for a reload of the sample Isle of Wight project, with all default settings.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at Kosmos.GdiMapPainting.GdiMapPainterBitmapCommand.GetElementBounds(Double zoomFactor) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\GdiMapPainting\GdiMapPainterBitmapCommand.cs:line 32
   at Kosmos.GdiMapPainting.GdiMapPainterCommandBase.Draw(IMapView mapView, MapPaintingStage paintingStage, Boolean preparationPhase) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\GdiMapPainting\GdiMapPainterCommandBase.cs:line 56
   at Kosmos.GdiMapPainting.GdiMapPainter.PaintMap(IMapView mapView) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos\GdiMapPainting\GdiMapPainter.cs:line 220
   at Kosmos.Gui.Forms.MapDisplayForm.pictureBoxMap_Paint(Object sender, PaintEventArgs e) in d:\MyStuff\BuildArea\Sandbox\OsmUtils\trunk\Kosmos.Gui.Controls\Forms\MapDisplayForm.cs:line 296
   at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
    CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Kosmos.Gui
    Assembly Version: 2.0.0.0
    Win32 Version: 2.3.213.0
    CodeBase: file:///C:/Program%20Files/Kosmos/Gui/Kosmos.Gui.exe
----------------------------------------
log4net
    Assembly Version: 1.2.10.0
    Win32 Version: 1.2.10.0
    CodeBase: file:///C:/Program%20Files/Kosmos/Gui/log4net.DLL
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0

Hardcoding of dir paths? d:\MyStuff\etc is not mine.

Not really my hardcoding :). The paths are mine, but they are stored automatically in the DLL debug information. They are purely for informational purposes, so that's not the reason the exception occurs. I'll take a look into it, thanks for the report. --Breki 18:55, 27 January 2009 (UTC)

Hi: I've installed Kosmos-2.4.27.6 on another windows xp machine and get exactly the same bug. Any ideas on this? Dave (13 Mar 1009)

I've fixed this, the fix will be available in the next release (2.5) soon --Breki 20:53, 13 March 2009 (UTC)

Problem with rendering rules

Hi, I've defined rendering rules for cycle lanes in pedestrian and residential streets. You can see them in the following image as light green and white streets contoured by green lines.

Kosmos rendering problem.png

The problem is that some ways are being rendered further than desired. It happens to ways identically named but split, one with the tag cycleway=lane while the other doesn't have that tag. Please compare to the Osmarender rendering for the same area. You can see that i.e. "Calle Vilaragut" shouldn't be completely rendered as a street with a cyclelane. Oddly enough, even some streets that haven't such tag at all are rendered with a cyclelane, i.e. "Calle de la Cruz". These streets are always adjacent to a cyclelan street. I think that something might be wrong with the engine.

Osmarender rendering cyclelanes.png

Or maybe I got wrong with my rendering rules :P These are my rendering rules for pedestrian and residential streets:

HighwayPedestrian Way highway=pedestrian EliminateSeams
.Cycleway cycleway=lane Polyline (MinZoom=13, Color=#dffcb8, BorderColor=green, Width=14:2;17:10, BorderWidth=30%)
.* Polyline (MinZoom=13, Color=#dffcb8, Width=14:2;17:10)
HighwayPedestrianArea Area highway=pedestrian area=yes Polygon (MinZoom=13, Color=#dffcb8, BorderColor=gray, BorderWidth=1)
Text (MinZoom=15, Color=black, TagToUse=name, FontName=Arial, FontStyle=regular, FontSize=15:6;17:9, TextMode=AreaCenter)
EliminateSeams
HighwayPedestrianText Way highway=pedestrian Text (MinZoom=15, Color=black, TagToUse=name, FontName=Arial, FontStyle=regular, FontSize=15:6;17:9)
HighwayResidential Way highway=residential EliminateSeams
.Cycleway cycleway=lane Polyline (MinZoom=11, Color=white, BorderColor=green, Width=11:1;13:1;17:10, BorderWidth=30%)
.* Polyline (MinZoom=11, Color=white, Width=11:1;13:1;17:10)
HighwayResidentialText Way highway=residential Text (MinZoom=15, Color=black, TagToUse=name, FontName=Arial, FontStyle=regular, FontSize=15:6;17:8)

The complete rules can be found in Kosmos_ValenciaVerda_Rules.

And of course congrats for a great work!

Hi, funny thing, I admit :). I'll have to take a look at the engine code (the rules look OK to me). One thing that could be the reason for this behaviour is the EliminateSeams setting - it extends the way to the next two points of the adjacent way. Try turning it off and let me know if the problem persists. EliminateSeams isn't an ideal solution, I'll try to create a better one for the Kosmos v3. BTW: you don't need a separate HighwayPedestrianText rule, just place the Text template in the root HighwayPedestrian template cell. --Breki 12:35, 1 July 2009 (UTC)
Ok, fixed using two different rules, one for cycleways without EliminateSeams option. Thanks also for the tip with the text tag :) --Nosolomusic 11:16, 4 July 2009 (UTC)

Problem with mutlipolygons

Version 2.5.405.6

The tags from an inner member of a multipolygon-relation are ignored. Example: A leisure=park is the inner member, a landuse=residential is the outer member of a multipolygon-relation. The landuse is colored as in the rendering-rules and the park is cut out, but not colored as in the rules. Brogo 13:38, 24 October 2009 (UTC)

Yes, this will be fixed in Kosmos v3. I'm working on a completely new rendering rules system --Breki 18:33, 12 November 2009 (UTC)

Coastline not rendered

Version 2.5.405.6

I downloaded data from an bounding-box (10.5,53.8,11.5,54.7) via XAPI and rendered it with Kosmos. But the sea won't be rendered. I get the error: "[11:04:21] Some coastlines cannot make polygons. [11:04:21] Aborted coastline processing." Brogo 13:38, 24 October 2009 (UTC)

It's either a bug in Kosmos coastline processor, or the XAPI data is not complete, or both. I've improved the coastline processor and it will be available in Kosmos v3 --Breki 13:07, 30 October 2009 (UTC)

Print area doesn't work

Version 2.5.405.6

I'm having trouble getting the print area function to work. I've set the print area using the menu option, adjusted it with the pointer and saved the project file, but in both the print preview and the printed output the whole map is still printed. Am I missing something? Jonathan Bennett 15:16, 25 January 2010 (UTC)

I suggest waiting for Maperitive, Kosmos' successor. --Breki 05:24, 15 February 2010 (UTC)

Export of large maps

Version 2.5.405.6 (this is the version I have downloaded but the error message claims I am using 2.1.1.0)

Dear Breki, I just tried to export a large map in a highly detailed zoom into a bitmap. The parameters: 600000 nodes, zoom 16, bitmap size 74000x35000. Immediately after the start of the export, an error message appears:

System.ArgumentException: Invalid parameter.
   at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
   at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
   at Kosmos.Gui.Activities.ExportBitmapActivity.Run(IActivityRunner runner, Object[] args) in d:\MyStuff\BuildArea\Sandbox\Kosmos\trunk\Kosmos.Solution\Kosmos.Gui.Controls\Activities\ExportBitmapActivity.cs:line 27
   at BrekiViews.WinForms.BlockingActivityRunner.worker_DoWork(Object sender, DoWorkEventArgs e) in d:\MyStuff\BuildArea\Sandbox\BrekiViews\trunk\source\BrekiViews.WinForms\BlockingActivityRunner.cs:line 130

I will try the same export on a faster machine if it is a memory problem. --BlackEyedLion 14:17, 13 February 2010 (UTC)

I think the problem is the bitmap width/height, and this error is reported by the underlying graphics engine, so it's out of my control. Maperitive will have SVG export function, which should be more appropriate for large size prints than bitmaps. --Breki 05:23, 15 February 2010 (UTC)

Problem with boundaries

Version 2.5.405.6

Dear Breki, I encountered a problem with the presentation of boundaries:

Boundary problem in Kosmos.jpgBoundary problem in Kosmos (Potlatch).jpg

The left image shows a screen dump from Kosmos, the right one a screen dump from Potlatch. The tags of the three boundaries (link to the respective position on OSM) are as following:

  • To the left:
    • boundary: administrative
    • admin_level: 8
    • Part of one multipolygon relation:
      • boundary: administrative
      • admin_level: 8
  • To the right:
    • boundary: administrative
    • admin_level: 6
    • Part of three multipolygon relations:
      • boundary: administrative each
      • admin_level: 6/6/8
  • Down:
    • boundary: administrative
    • admin_level: 6
    • Part of two multipolygon relations:
      • boundary: administrative each
      • admin_level: 6/6

The problem that the boundary going down from the intersection is not rendered is independent from the rendering rules. --BlackEyedLion 16:59, 14 February 2010 (UTC)

Kosmos has a limited support for multipolygons. I've already implemented a better support in Mapertive, so this should be fixed with the first release --Breki 05:27, 15 February 2010 (UTC)