Select to view content in your preferred language

Adding Raster data to Standalone Mobile Projects.

753
3
02-13-2012 09:19 AM
JoshuaHarding
New Contributor
All I want to do is add one high resolution raster image and one low resolution raster image to my mobile projects in standalone configuration using ArcMobile.  I want these images to be background references for data collection in the field.  We are licensed at the ArcEditor level and do not have a server connection with ESRI.

I know that it is my duty to search the threads to find information related to my query and I have done my best to try and find a solution.  The one thread that is slightly related is over my head and writing style to pour for me to truly understand how to do what I want.

Is there an easy solution?

Josh
0 Kudos
3 Replies
AkhilParujanwala
Regular Contributor
Hi,

I don't know of an easy way to do this, but after my setup, it is very easy for me to add raster maps to my projects.

Here's how it works in theory.
1) Integrate your own DLL into ArcGIS Mobile
2) The code will be simple, look at target directory on the computer, if there are folders in them with a conf file, consider it as a raster image and load it into the application.
3) To create a raster image suitable for ArcGIS Mobile, I have a 12 step manual on how to do this. Also this solution will only work if you have physical access to the computers, because you will need to physically place the raster maps into the directory on each computer.

For example, I have 6 tablet PCs, if all them require a high resolution raster image of the Empire State building and the roads surrounding it, I would follow my 12 step procedure on creating a raster tile cache. Then go to each tablet PC and copy the tile cache in the designated folder. In this case the folder name is "Local Basemaps". When the user launches ArcGIS Mobile, my code will look at the folder, find if a folder within it has a conf file, and assume it is a raster tile cache and load it in.
I only allow basemaps to be add to ArcGIS Mobile when it first launches, I don't allow hot swapping of basemaps.

I am also able to distinguish between Raster and Vector maps added this way, so I can add special vector layers like Fishnets to create a grid like data collection method.

If you are interested in more details please post here.
0 Kudos
WadsonMakari1
Emerging Contributor
I would be interested in any information that you have about making a small number of raster images accesible within ArcMobile as this is exactly what I need to do at the moment.

Many Thanks
0 Kudos
AkhilParujanwala
Regular Contributor
Hi humph,

Here's what I do in terms of raster images.
I am able to make a raster image of the study area using ArcMap and the server.
I can make the tiles as sharp or as coarse as I want based using ArcMap.
Once the tiles are created I take them from the server and transfer them to each laptop/tablet PC and put the tiles into the Local
Incident Map.
I can put multiple images into the folder and my code will display them on the map.

The following code below will add a raster image cache (created from the ArcGIS Server and ArcMAP) to the map.



[PHP]
            try
            {
                if (_isMapAdded == false)
                {
                    ESRI.ArcGIS.Mobile.WPF.Map mmap = MobileApplication.Current.Map;

                    string filePath = "C:\\NEPRD\\Mobile Radiation Applications\\Local Incident Maps";
                    string[] folders = Directory.GetDirectories(filePath);
                    //string[] folderNames = Directory.getdirectoriesn

                    foreach (string d in folders)
                    {
                        string[] layerPaths = Directory.GetFiles(d, "*.xml");

                        if (layerPaths.Count<string>() > 0)
                        {
                            try
                            {
                                TileCacheMapLayer mpLayer = new TileCacheMapLayer(d);
                                mpLayer.Visible = false;
                                mpLayer.Open();                               
                                mmap.MapLayers.Add(mpLayer);                               
                                mpLayer.Name = new DirectoryInfo(d).Name + " Image";
                                mpLayer.MinScale = 4000;
                            }
                            catch (Exception ex)
                            {
                                System.Windows.MessageBox.Show(ex.ToString());
                            }
                        }
                        else
                        {
                            try
                            {
                                MobileCache mc = new MobileCache(d);
                                mc.Open();
                                mmap.MapLayers.AddRange(mc);
                                //mc.Close();
                            }
                            catch (Exception ex)
                            {
                                System.Windows.MessageBox.Show(ex.ToString());
                            }
                        }
                    }
                    _isMapAdded = true;
                }
            }
            catch
            {
            }  
[/PHP]

I hope this helps.
0 Kudos