Strange behavior of UriImageProvider

2 posts, 0 answers
  1. David
    David avatar
    34 posts
    Member since:
    Nov 2015

    Posted 18 Nov Link to this post

    I'm using the UriImageProvider to add multiple tiles I've generated using GDAL to the map control. Each image covers exactly one degree of latitude and longitude.

    When I loop through my image files to add them, the resulting tiles don't seem to be added in the correct place. Attached is a screen shot and here is my code to add the images.

    var files = Directory.GetFiles( $"{Directory.GetCurrentDirectory()}\\Assets\\Terrain\\", "*_comp.tif" );
     
                foreach( var f in files )
                {
                    Location bottomLeftCorner = ParseHgtFileCoordinates( f );
                    Location topLeft = new Location( bottomLeftCorner.Latitude + 1, bottomLeftCorner.Longitude );
                    Location bottomRight = new Location( bottomLeftCorner.Latitude, bottomLeftCorner.Longitude + 1 );
                    LocationRect bounds = new LocationRect( topLeft, bottomRight );
     
                    UriImageProvider p = new UriImageProvider();
                    p.GeoBounds = bounds;
                    p.Uri = new Uri( f );
                     
                    map.Providers.Add( p );
                }
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2997 posts

    Posted 22 Nov Link to this post

    Hello David,

    To be honest we haven't used UriImageProviders in such way to combine images into one bigger image. Isn't it actually easier to combine the images first and then use one single ImageProvider ? To double check your calculation methods, we encourage you to use multiple Map instances (with one image in every map) placed one next to other and check if the positions of all small images are correct. If none if these helps, can you send us the edge calculating functions and the Images, so that we can test this locally. Of course, runnable sample would be the best possible option for us. Thank you in advance for your cooperation.

    Regards,
    Petar Mladenov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top