Quantcast
Channel: DotSpatial
Viewing all 3973 articles
Browse latest View live

New Post: HOW TO put a selection in a dataset?

$
0
0
I understand thanx and already programmed that solution but was hoping for a more automatic elegant way :)

New Post: HOW TO put a selection in a dataset?

$
0
0
I know only one way where you wouldn't have to copy data. You would have take the whole GebouwenLayer.dataset.datatable and use the normal datatable-select function to filter the rows shown to the user. But that means you could only select by attribute or have to get the FIDs of the selected features and filter the datatable by these FIDs.

New Post: Display Preview Images In Map Extends

New Post: Selecting both point and line features from two feature layer at the same time

$
0
0
Thanks Jany for your responses, much appreciated.

I replaced my DotSpatial dlls with the most recent built 75229 and the issue is solved indeed.

New Post: Saving ProjectFile with SerializationManager

$
0
0
Hello Everyone,

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

$
0
0
Currently the shapefiles aren't saved when you save the project.

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

$
0
0
Thanks Jany for your prompt response.

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

$
0
0
Remember FeatureSets Filename on SaveAs

New Post: Saving ProjectFile with SerializationManager

$
0
0
It's what I thought. The filenames of the datasets that belong to your layers are missing in the dspx. That's what would happen if you hadn't saved your layers. But I found another cause for this too. Something that I fixed in my own code but not in DotSpatial.

Please download changeset 75317 and check if your problem is solved.

New Post: Saving ProjectFile with SerializationManager

$
0
0
Thanks for your response.

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

$
0
0
So far it seems as if you're doing everything right. So I don't understand why your layers aren't shown after you load the dspx.

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

$
0
0
Yes, they do show up in the DemoMap when I use DemoMap to save the project file.
This is why I am confused too.

New Post: Saving ProjectFile with SerializationManager

$
0
0
Alright so there seems to be something wrong with the way you use the code. Can you give me the code that makes trouble? If not try to write a small example that causes this error.

New Post: Saving ProjectFile with SerializationManager

Commented Unassigned: Long time to create thiessen polygon feature on real time data [24661]

$
0
0
I'm developing a customized application using Dotspatial and as a part of it I used Voronoi tool from Dotspatial.Analysis.Voronoi. When I use sample 4-5 points then test was successful for creating Voronoi feature. But When I use a real time data for creating Voronoi, application goes into indefinite loop. I wait till 30 minute to complete the action but didn't succeed. I use following code for generating Voronoi.

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]

$
0
0
I'm developing a customized application using Dotspatial and as a part of it I used Voronoi tool from Dotspatial.Analysis.Voronoi. When I use sample 4-5 points then test was successful for creating Voronoi feature. But When I use a real time data for creating Voronoi, application goes into indefinite loop. I wait till 30 minute to complete the action but didn't succeed. I use following code for generating Voronoi.

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?

$
0
0
Hi,

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

$
0
0
Here is the solution to the issue that is suggest by Jany. So thank you Jany.


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]

$
0
0
I'm developing a customized application using Dotspatial and as a part of it I used Voronoi tool from Dotspatial.Analysis.Voronoi. When I use sample 4-5 points then test was successful for creating Voronoi feature. But When I use a real time data for creating Voronoi, application goes into indefinite loop. I wait till 30 minute to complete the action but didn't succeed. I use following code for generating Voronoi.

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]

$
0
0
Hello,

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);
}

//...
```
Viewing all 3973 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>