This project is read-only.

Save Project As

Feb 7, 2011 at 5:54 PM

I have downloaded the latest DotSpatial_f16e63781ed1 set and received error message for Save Project As (Project Files (*.dspx)) when run DemoMap application.
I can not see the old *.map extension anymore. For me are the Save as and Open project options very important! Could you give me an advise about that?

Please see bellow some message information:

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: toPath
   at DotSpatial.Data.FeatureSet.RelativePathTo(String toPath) in C:\DotSpatial_f16e63781ed1\DotSpatial.Data\DotSpatial.Data\FeatureSet.cs:line 1840
   at DotSpatial.Data.FeatureSet.get_FilePath() in C:\DotSpatial_f16e63781ed1\DotSpatial.Data\DotSpatial.Data\FeatureSet.cs:line 1805
   --- End of inner exception stack trace ---
....

Feb 7, 2011 at 5:56 PM

.map.xml is obsolete but we still allow importing this file type (this support may be removed when we move from alpha/beta to production release.

You are probably bumping into a bug. Can you help us reproduce this?

Feb 7, 2011 at 7:42 PM
Edited Feb 7, 2011 at 7:48 PM

I just added layer australia_roads.shp to map with green add symbol and select Save As Project and error happened! 

Your old DotSpatial_a782883ecff6 set works perfect with *.map extension.

 Also *.map file created with this old DotSpatial_a782883ecff6 set  could not be opened with latest DSP version!

 

Feb 7, 2011 at 8:06 PM

Where can I find australia_roads.shp?

I think the issue here is actually related to the location of the shape file and relative location of where you are trying to save the project file.

Feb 7, 2011 at 8:19 PM

 

I have all my shp files in c:\tmp directory and also want to save project file in to this place. All my shp files working OK with older DSP set. Thanks for your cooperation!

Feb 7, 2011 at 10:11 PM

I'm not able to reproduce your issue. Could you write a small sample of code that reproduces this error?

Feb 8, 2011 at 8:56 AM
From: vzavec
No code added to your DemoMap only build DotSpatial_f16e63781ed1 is used. I am sending you zip with australia shp.
Just downloaded the latest build "DotSpatial_bdee8cc4c103" and compiled it for x86 and build failed:
Error 31 The type or namespace name 'Ionic' could not be found (are you missing a using directive or an assembly reference?) C:\DotSpatial_bdee8cc4c103\DotSpatial.Controls\DotSpatial.Controls\Compatibility\LegacyArchiveDeserializer.cs 3 7 DotSpatial.Controls
Feb 8, 2011 at 4:11 PM

I'm not sure where you sent the zip.

The reference issue seems to be related to how the project is looking for the exact path 'C:\dotspatial\SupportFiles\DotNetZipLib-DevKit-v1.9\DotNetZip-v1.9\Release\Ionic.Zip.dll' I'll look into this.

Feb 8, 2011 at 4:46 PM

We have fixed the reference issue. Mecurial excluded the dll by default.

Feb 8, 2011 at 5:17 PM

No luck with latest "DotSpatial_55f7834dec6c" set: Error Message is:

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: toPath
   at DotSpatial.Data.FeatureSet.RelativePathTo(String toPath) in C:\DotSpatial_55f7834dec6c\DotSpatial.Data\DotSpatial.Data\FeatureSet.cs:line 1840
   at DotSpatial.Data.FeatureSet.get_FilePath() in C:\DotSpatial_55f7834dec6c\DotSpatial.Data\DotSpatial.Data\FeatureSet.cs:line 1805
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)

 

But DSP set  "89691e7294c8  by Kurt  Feb 1"   works OK  with Save  Project As and also opens it again.

Feb 8, 2011 at 5:22 PM

I understand you are having some difficulty. I'm not able to help you however unless we can reproduce the issue.

Feb 9, 2011 at 6:45 AM

I'm having the same problem as vzavec.

using the latest DotSpatial_55f7834dec6c set. When I stepped through source code, I noticed that the FeatureSet.Filename property is NULL when the project is being saved. I also noticed that DotSpatial is now using the OgrDataReader and OgrVectorProvider  for opening the shapefile. This is a change from previous versions which were using 'ShapefileDataProvider'. I suggest fixing this bug by assigning fs.Filename in the OgrVectorProvider.Open() method.

Another thing I noticed, if I delete the Ogr folder from DotSpatial\Debug\x86\Data Extensions, then the Save Project As works correctly. This proves that the bug is in OgrVectorProvider.

Feb 9, 2011 at 4:09 PM

Let’s move this to a bug report.

Feb 9, 2011 at 6:08 PM

I created the bug report:

http://dotspatial.codeplex.com/workitem/248

Feb 11, 2011 at 8:41 PM

vzavec, this bug has been fixed. Please check your results and let us know if you have any trouble.

Feb 12, 2011 at 1:12 PM
Edited Feb 13, 2011 at 11:45 AM

Now "Save project As" works with no error message, but "Open project" fails. Here is the message information about that:


************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at DotSpatial.Serialization.XmlDeserializer.ConstructObject(Type type, XElement element) in C:\DotSpatial_87d70605ff9d\DotSpatial.Serialization\DotSpatial.Serialization\XmlDeserializer.cs:line 357
   at DotSpatial.Serialization.XmlDeserializer.ReadObject(XElement element, Object parent) in C:\DotSpatial_87d70605ff9d\DotSpatial.Serialization\DotSpatial.Serialization\XmlDeserializer.cs:line 203
   at DotSpatial.Serialization.XmlDeserializer.GetConstructorArgs(XElement element) in C:\DotSpatial_87d70605ff9d\DotSpatial.Serialization\DotSpatial.Serialization\XmlDeserializer.cs:line 382
   at DotSpatial.Serialization.XmlDeserializer.ConstructObject(Type type, XElement element) in C:\DotSpatial_87d70605ff9d\DotSpatial.Serialization\DotSpatial.Serialization\XmlDeserializer.cs:line 353
   at DotSpatial.Serialization.XmlDeserializer.ReadObject(XElement element,  ....

Feb 14, 2011 at 7:26 AM

Hi vzavec,

Thanks for your testing. I'm having the same issue with latest build. It's a high priority issue for me too. This issue is related to the OgrDataExtension. The old version of DotSpatial used "PolygonShapefile" as the DataSet property, the new version uses "FeatureSet". Unlike "PolygonShapefile", the FeatureSet class doesn't have any constructor which causes the exception.

  If you need a quick temporary workaround, remove "Ogr" from your Debug\x86\Data Extensions folder and "Save Project As" / "Open Project" will work.

Jiri

 

Feb 16, 2011 at 1:05 AM

I have fixed the issue in "open project" : http://dotspatial.codeplex.com/workitem/251. Open Project now works without exceptions in DemoMap.exe using latest DotSpatial source code. Please test.

Feb 18, 2011 at 5:03 PM

No luck with "Open Project" after "Save project As" with latest build form DSP. Program stop on this line "return ctor.Invoke(constructorArgs.ToArray());"  in XmlDeserializer.cs.

Also with older build from DSP ("DotSpatial_44ca867c32eb") I have noticed (Org folder is deleted as you proposed) after "Open Project"
there is no way to Set Dynamic Visibilty for layer and also when change the lines color or width the Apply button on line Symbol form did not
refresh the legend and the map.

I create one New Group and move one lines layer to this group for my tests.

Feb 18, 2011 at 8:18 PM

I tried with latest DotSpatial build DotSpatial_2b3a95760a76 and I can save and open a project with several shapefiles, categories and labels.

Can you please send a sample .zip file with the shapefiles and the .dspx project file? This would help to track this issue.

The only change made in DotSpatial_2b3a95760a76 with regards to save project as / open project is saving the 'ProjectionEsriString' property of the map.

I'm also getting unhandled exception when setting the dynamic visibility of a line in a group or setting the line color. it throws NullReferenceException in DynamicVisibilityWidth = MapFrame.ViewExtents.Width (layer.MapFrame is NULL). The issue occurs with following steps:

  1. Add shapefiles to the map
  2. Create new group
  3. Move a layer to the group
  4. Save Project As
  5. Close DemoMap and Open Project
  6. Right-click on the line layer in the group and try "set dynamic visibility"
  7. I get the exception

I've submitted this as a new DotSpatial issue.

Jiri

Feb 19, 2011 at 8:19 AM
Here I am sending you my tmp.zip with lines shape and tmp.dspx as you suggested.
Regards, Vojko
Feb 21, 2011 at 8:43 PM

Hi Vojko,

I can't see the attached tmp.zip file can you please attach it here or attach it to the 'DotSpatial Issue 254?

http://dotspatial.codeplex.com/workitem/254

Regards,

Jiri

Feb 23, 2011 at 6:28 PM

Try the latest 65eacceecd6b DotSpatial source code changeset. OpenProject works correctly for the attached file and also for other files with groups.

There might still be some issues with OgrVectorProvider, so my recommendation is not to use OgrVectorProvider in the dotspatial based application if you need to save and open projects with a complex group and layer organization.

You can temporarily disable the building of OgrVectorProvider by unchecking it in the build -- configuration manager menu of the solution.

Regards,

Jiri

Feb 28, 2011 at 7:38 PM
Edited Mar 3, 2011 at 4:56 PM

Hi Jiri!

OK now the problem with Open Project is solved (also Set Dynamic Visibility works OK) but when choosing the layer in the group and try to hit Selection/Select By Attribute from menu I get the exception.

Error message: No feature layers were selected in the legend.....

Kind regards, Vojko

Mar 3, 2011 at 5:00 PM
Edited Mar 4, 2011 at 8:43 AM

Hi Jiri!

I wonder if the error with "Selection/Select By Attribute" for the layer in the group is somehow the same as the problem with the Set Dynamic Visibility?

Right now see your Work Item #260 ... not only layers in group also other layers could not be "Selected By Attribute".

Kind regards, Vojko

Mar 4, 2011 at 6:05 PM

Hi Vojko,

It looks like there are several issues with opening 'group' from the dspx file. Using your sample data, I discovered that:

1) If I select the CEV_DOT layer in the legend, and try to select some features using the 'select' tool, I also get the 'No feature layers were selected in the legend..' message.

2) If I click on the 'attribute table' tool in the main toolbar, nothing is shown.

I'm trying to examine this issue (The code for handling 'Groups' in DotSpatial seems to be quite complicated ...)

Jiri

Mar 4, 2011 at 7:59 PM

Jiri, I am very interested in that these problems will be solve.
Regards, Vojko
----- Original Message -----
From: [email removed]
To: [email removed]
Sent: Friday, March 04, 2011 7:05 PM
Subject: Re: Save Project As [DotSpatial:245006]

From: jirikadlec2

Hi Vojko,

It looks like there are several issues with opening 'group' from the dspx file. Using your sample data, I discovered that:

1) If I select the CEV_DOT layer in the legend, and try to select some features using the 'select' tool, I also get the 'No feature layers were selected in the legend..' message.

2) If I click on the 'attribute table' tool in the main toolbar, nothing is shown.

I'm trying to examine this issue (The code for handling 'Groups' in DotSpatial seems to be quite complicated ...)

Jiri

Mar 15, 2011 at 7:21 PM

Hi Vojko,

If you try DotSpatial source code # 4f7000fd0826, the problems with 'select by attribute' are fixed. Some other problems such as 'Save PictureSymbol in ProjectFile' and 'Open Project when shapefile does not exist' are also fixed.

(when testing, make sure that you don't use the OgrExtension which still has numerous problems with OpenProject.

Jiri