Symbology created in MapWindow not loading in DotSpatial

Jan 14, 2013 at 11:45 AM

Hi everybody,

I have a problem loading a symbology with DotSpatial library (version 1.4). This symbology has been previously created with MapWindow. Maybe I am not doing it well. I hope somebody could help me.


First, I edit the layer on MapWindow (version 6.4.8 64 bits)

De Buzón

Then, I put it in the same shape directory (in fact, there is no need to do so, because the symbology file is automatically created there)

De Buzón

Finally, when it loads the shapefile, it just seems to ignore the symbology file. No styles are loaded (in this case, I am making a very simple test: change line color to red. Notice I load the shape file with Map.AddLayer method.

   public IMapFeatureLayer f_addBaseLayerToMap(ref Map mapa, String capa,  String codigoExplotacion, out Boolean layerLoadSuccess)
            layerLoadSuccess = true;
            IMapFeatureLayer newLayer = null;

                 newLayer = (IMapFeatureLayer)mapa.AddLayer(m_paths.f_getPath(Cartography_Type.Cartografia_Base, codigoExplotacion, capa));

                //Base chartography must not be selected by Selection control
                newLayer.SelectionEnabled = false;
            catch (Exception e)
                /* Si alguna de las capas no se ha podido cargar, informar a Galia Web*/
                DeviceMessage.f_newMessage("[Excepci�n]: La capa " + capa + "de la explotaci�n " + codigoExplotacion + " no se ha podido cargar. Error: " + e.Message + "Traza: " + e.StackTrace, MESSANGES_TYPES.MESSAGE_ERROR);

                /* No hemos podido cargar la capa. Se le informar� al usaurio*/
                layerLoadSuccess = newLayer != null;

            return newLayer;


As you can see in the next screen capture, layer's line's color has not changed to red.

De Buzón

I'll appreciate any help. Thank you very much in advance.

Jan 14, 2013 at 4:40 PM

There is some code in DotSpatial that reads the symbology information from MapWindow .mwsr and .mwleg files, but that was before the latest changes in MapWindow. I do not think anyone has worked on reading the new non-backward-compatible .mwsymb files.

Jan 15, 2013 at 10:28 AM

Thank you vatavian. 

I'll have at look at the MapWindowProjctFileCompatibility plugin.