ThinkGeo.com    |     Documentation    |     Premium Support

Nautical Chart Not Serializable

Hi,

I get the following when trying to serialize a nautical chart layer.

Message=vBc=.b04= is not marked as serializable

Regards,
Damian

Thanks Damian,
Beside this member variable there are few more member variables need mark as serializable. I have done the changes. Could you please try to update the mapsuite V10 package to the latest Beta ones.

Thanks

Frank

Hi Frank,

I got beta-21, but still an error. It’s changed to…

System.IO.BinaryReader is not marked as serializable.

Thanks,
Damian

Thanks Damian,
I did some test. It works if you don’t open the layer before serialize it. Because Open it will create a BinaryReader object. This one is not able to serialize.

Here is the full code you can try.

NauticalChartsFeatureLayer nauticalChartsFeatureLayer = new NauticalChartsFeatureLayer(@"C:\Users\FrankFu\Downloads\US3GC01M (1)\US3GC01M\US3GC01M.000");
            nauticalChartsFeatureLayer.FeatureSource.Projection = new Proj4Projection(4326, 3857);
            nauticalChartsFeatureLayer.SymbolDisplayMode = NauticalChartsSymbolDisplayMode.PaperChart;

            // nauticalChartsFeatureLayer.Open(); Do not open it
            GeoSerializer oSerializer = new GeoSerializer();
            oSerializer.Serialize(nauticalChartsFeatureLayer, "D:\\tesd.xml");

Thanks

Frank

That’s great Frank. It’s working now.

Thanks,
Damian

Thanks Damian,
Good to know it works. Go ahead let us know if you have any questions.

Thanks

Frank