New Post: HOW TO put a selection in a dataset?
New Post: HOW TO put a selection in a dataset?
New Post: Display Preview Images In Map Extends
Thanks!
New Post: Selecting both point and line features from two feature layer at the same time
I replaced my DotSpatial dlls with the most recent built 75229 and the issue is solved indeed.
New Post: Saving ProjectFile with SerializationManager
I am trying to save my shapefile layers (one data frame) as a project file.
I have close to 10 layers, three of them are point layer and the rest are lines. I have built the shapefiles with coding and used the following line to save the project file:
frmmap.AppMan.SerializationManager.SaveProject(@"D:\test.dspx");
So far this works fine and I get the dspc xml file.But problem is that when I try to open it with the
frmmap.AppMan.SerializationManager.OpenProject(@"D:\test.dspx");
It only loads my point shapefiles name in the legend. and there is no sign of the line layers.Also the point shapefiles seem to be empty. There is no data stored in them. attribute table is empty as well and the map does not show anything.
The dspx file seems to include the name and the specifications of all of the layers.
I tried to open the dspx file with DemoMap.exe but the same thing happens.
Any thought would be appreciated.
Regards
New Post: Saving ProjectFile with SerializationManager
You have to save the layers first by calling FeatureLayer.Dataset.Save or FeatureLayer.Dataset.SaveAs if the layer was never saved before. FeatureLayer would be the layer you want to save converted to FeatureLayer.
Afterwards calling OpenProject should load your layers. Be aware that they'll most probably be in IndexMode and the AttributeTable won't be filled.
New Post: Saving ProjectFile with SerializationManager
I have already saved the shapefile layers before saving the project file.
I can open the saved shapefiles in DemoMap or my own program one by one without any issue and attribute table has no problem. The only issue in this way is that I lose all of the formatting stuff which I am hoping to keep by saving the ProjectFile.
I would have attached the files but I could not figure out how to do it on codeplex.
Source code checked in, #75317
New Post: Saving ProjectFile with SerializationManager
Please download changeset 75317 and check if your problem is solved.
New Post: Saving ProjectFile with SerializationManager
I applied the changeset and recompiled the the dlls but no luck.
The same problem is still there.
This being said, I can see that shape file paths have been added into the dspx file.
I am not sure what do you mean by saving the layers.
I have used the following line to save my FeatureSet before adding it to the map control.
fs.SaveAs(dm.InpFilePath + "GISShapeFiles\" + Type + ".shp", true);
and this happens before calling ProjectSave.
Let me know if this make sense.
New Post: Saving ProjectFile with SerializationManager
Please take demomap and add the layers with the help of the add button and save the project in file menu. Do they show up if you reopen demomap and load the saved dspx?
New Post: Saving ProjectFile with SerializationManager
This is why I am confused too.
New Post: Saving ProjectFile with SerializationManager
New Post: Saving ProjectFile with SerializationManager
Thanks
Commented Unassigned: Long time to create thiessen polygon feature on real time data [24661]
Code///
IFeatureSet fs1 = new DotSpatial.Data.FeatureSet();
fs1 = (IFeatureSet)FeatureSet.Open(path1);
IFeatureSet _Result = new FeatureSet(FeatureType.Polygon);
MapPolygonLayer lineLayer;
lineLayer = (MapPolygonLayer)map1.Layers.Add(_Result);
//Create Voronoi Polygons
DotSpatial.Analysis.Voronoi.VoronoiPolygons(fs1, _Result, cropToExtent: true);
Comments: ** Comment from web user: pan054 **
Does anyone have some code to turn a GeoAPI.Geometries.IGeometryCollection into a shape file (either using DotSpatial or NetTopologySuite)?
Commented Unassigned: Long time to create thiessen polygon feature on real time data [24661]
Code///
IFeatureSet fs1 = new DotSpatial.Data.FeatureSet();
fs1 = (IFeatureSet)FeatureSet.Open(path1);
IFeatureSet _Result = new FeatureSet(FeatureType.Polygon);
MapPolygonLayer lineLayer;
lineLayer = (MapPolygonLayer)map1.Layers.Add(_Result);
//Create Voronoi Polygons
DotSpatial.Analysis.Voronoi.VoronoiPolygons(fs1, _Result, cropToExtent: true);
Comments: ** Comment from web user: Oscarafone77 **
you might take advantage of the sample codes at this [link](http://dotspatial.codeplex.com/wikipage?title=Desktop_SampleCode).
you might get the coordinates of each geometry you have in "result" and create polygons as in the sample codes
Oscar
New Post: When are the next version planned for release?
I have recently started using Dotspatial and I love it!
I have ran into some issues with projection from WGS84 to Sweref99 and RT90 (known issues that has been logged by others), and I wonder if anyone knows if there is any plans for release of a new version of Dotspatial that might fix these issues?
Thx
New Post: Saving ProjectFile with SerializationManager
Somewhere in my code where I was building the shapefiles i had the following line
IMapFeatureLayer layer = appManager1.Map.Layers.Add(fs);
fs is the FeatureSet object that I used to add the point or lines and it was also saved to the drive.Apparently we loose the feature type in the line layer when we are doing it in this way.
So Jany suggested to replace the code with
IMapFeatureLayer layer = appManager1.Map.Layers.Add(shapefilePath) as IMapFeatureLayer;
which adds the saved shapefile by loading it from the drive.This indeed solved the problem, although it comes with a price of loading files from drive instead of memory.
Commented Unassigned: Long time to create thiessen polygon feature on real time data [24661]
Code///
IFeatureSet fs1 = new DotSpatial.Data.FeatureSet();
fs1 = (IFeatureSet)FeatureSet.Open(path1);
IFeatureSet _Result = new FeatureSet(FeatureType.Polygon);
MapPolygonLayer lineLayer;
lineLayer = (MapPolygonLayer)map1.Layers.Add(_Result);
//Create Voronoi Polygons
DotSpatial.Analysis.Voronoi.VoronoiPolygons(fs1, _Result, cropToExtent: true);
Comments: ** Comment from web user: pan054 **
Thanks for your reply Oscar, I already had looked at those code examples so I know how to create a new polygon shape within the DotSpatial environment.
The result from the GetVoronoiDiagram call is a GeoAPI.Geometries.IGeometryCollection and I have not been able to find a simple way (apart from an atomic bucketing the info from one to the other) to convert that to a DotSpatial.Data.FeatureSet that I then can save.
Alternatively, I could try using GeoAPI/NetTopologySuite functions to save the GeoAPI.Geometries.IGeometryCollection to a shape file but I can't really find much examples or documentation for the GeoAPI/NetTopologySuite software (apart from some cryptic Java doco).
Cheers
Created Unassigned: TopologyPreservingSimplifier is not thread safe [25866]
I noticed that TopologyPreservingSimplifier doesn't appear to be thread-safe. This is a bit of a bottleneck for my application. Since `Simplify` is a static method of this class, is there any way to make it more thread safe? Right now I am locking it manually as follows, but I don't know that this is the most performant or safest way for other people who may run into this issue.
```
private static readonly object _SimplifyLocker = new object();
//...
lock (_SimplifyLocker)
{
return TopologyPreservingSimplifier.Simplify(input, tolerance);
}
//...
```