I am using a geographic map with a static geotiff image that I converted to tiles.
If I don't specify the world rect, my map and symbol series both show, but my symbol series is in the wrong location. When I set the world rect to the parameters of my image, then the symbol series shows accurately but the map does not appear at all.
It seems to be a similar problem to this post which had no answer given: https://ko.infragistics.com/community/forums/f/ultimate-ui-for-wpf/72598/setting-worldrect-of-xamgographicmap-no-calls-to-gettilelayers-of-custom-maptilesource
Some code:
public class LocalMapTileSource : Maps.XamMultiScaleTileSource { public LocalMapTileSource() : base(3033, 3033, 256, 256, 0) { } private const string TileOriginalPath = @"C:\ProgramData\SmartSnow7\Tiles\{Z}\{X}\{Y}.png"; protected override void GetTileLayers(int tileLevel, int tilePositionX, int tilePositionY, System.Collections.Generic.IList<object> tileImageLayerSources) { var zoom = tileLevel - 8; var invY = (int)Math.Pow(2.0, zoom) - tilePositionY - 1; if (zoom > 0) { var uriString = TileOriginalPath; uriString = uriString.Replace("{Z}", zoom.ToString()); uriString = uriString.Replace("{X}", tilePositionX.ToString()); uriString = uriString.Replace("{Y}", invY.ToString()); tileImageLayerSources.Add(new Uri(uriString)); } } }
public InfragisticsMap() { InitializeComponent(); GeoMap.BackgroundContent = new LocalMapImagery(); GeoMap.WorldRect = new Rect(8.3713675, 46.7982968, 0.0119369, 0.0081759); }
And the information about my original geotiff image:
Driver: GTiff/GeoTIFF Files: LocalMap.tif Size is 3033, 3034 Coordinate System is: GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], AUTHORITY["EPSG","4326"]] Origin = (8.371367454528810,46.798296765380201) Pixel Size = (0.000003935683079,-0.000002694757344) Metadata: AREA_OR_POINT=Area TIFFTAG_DATETIME=2019:01:19 10:44:48 TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch) TIFFTAG_SOFTWARE=Windows Photo Editor 10.0.10011.16384 TIFFTAG_XRESOLUTION=1 TIFFTAG_YRESOLUTION=1 Image Structure Metadata: COMPRESSION=LZW INTERLEAVE=PIXEL Corner Coordinates: Upper Left ( 8.3713675, 46.7982968) ( 8d22'16.92"E, 46d47'53.87"N) Lower Left ( 8.3713675, 46.7901209) ( 8d22'16.92"E, 46d47'24.44"N) Upper Right ( 8.3833044, 46.7982968) ( 8d22'59.90"E, 46d47'53.87"N) Lower Right ( 8.3833044, 46.7901209) ( 8d22'59.90"E, 46d47'24.44"N) Center ( 8.3773359, 46.7942088) ( 8d22'38.41"E, 46d47'39.15"N) Band 1 Block=3033x1 Type=Byte, ColorInterp=Red Band 2 Block=3033x1 Type=Byte, ColorInterp=Green Band 3 Block=3033x1 Type=Byte, ColorInterp=Blue
Follow-up. After doing some debugging, I discovered the following:
The zoom is set to 3, and GetTileLayers() seeks out the tile with Z=3, X=4, and Y=5. This is the only tile it grabs, but I still get a gray screen as the background content.
Hello Doug,
Please provide an isolated sample; I can't recall this behavior occurring in the past.
Should I be seeing this?:
Folders 1-6 should all be in the same folder (where you have 4-6 now). Sorry for the confusion. Here is what it looks like without the world rect set:
and zoomed in very far on the icons:
Ok,
I have it running. When the WorldRect is set you are specifying a coordinate to zoom in and because you see a gray background means the GeoMap is loading the tile correctly, it's just zoomed in on the series.
Does this make sense?
I believe so. If that's the case, how do I configure the coordinates of the farthest zoom in my image? The image itself only reflects a small set of coordinates. If it helps, I converted a single geotiff image to a set of tiles, and I"m just looking to sync the map coordinates to the image coordinates
Hello Doug,GeoMap expects names of tiles to match names of tiles that have full range -180,+180 long and -90,+90 latitude. However, your tile images cover very small part of of these geographic coordinates. So, you either need to rename folders and files in your local imagery tiles (e.g. 10z 537x 361y) or convert these tiles in the GetTileLayers function. I modified your app (see attachment) and I added custom imagery tiles to show in debug console which numbers (X,Y, Z) of tiles the geoMap expects at geo-location of your data points.Alternatively, you could keep your current names of imagery tiles, not set WorldRect property, and transform geo-location of your data points by projecting them to coordinates of tiles images but this will be difficult process. GeoMapSampleUpdated.zip