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

New Comment on "Documentation"

$
0
0
gis4sd Today at 2:54 PM delete this comment Thank you very much. Wish dotspatial go up and up. And if it is posible, please update document to fit the recent version. http://muabanpiano.net

New Post: IGeometry?

$
0
0
Hi everyone,
I want to use the DistanceOp function using an Feature (IFeature actually) and a Centroid as argument, but they do no implement the interface IGeometry which is required. How do you cast the feature and the point to IGeometry types?

New Post: IGeometry?

$
0
0
You can use Feature.ToShape().ToGeometry() to get the IGeometry of the feature.
If you mean a Centroid like Feature.Centroid you can do the same with it.
I think you might not have to explicitly use the DistanceOp because IGeometry already uses it in Distance and other functions. You possible can simply do it like this:

Double distance = Feature.ToShape().ToGeometry().Distance(Centroid().ToShape().ToGeometry());

New Post: IGeometry?

$
0
0
Thank you Jany.
Wouldn't it be convenient a Feature.ToGeometry() method, even if it only calls ToShape().ToGeometry() ?

New Post: Best practice to split line feature

$
0
0
Hi everyone!
I have a case where I want to split a line feature into two new features, at a certain point identified on the line.

What I do now is to simply iterate over the vertices (i.e. the coordinate in the feature's coordinate list), and when the point is reached I split the feature into two new features. Is this a sound way to do it or is there an easier or faster way?

New Post: IGeometry?

$
0
0
You should be able to directly cast IFeature.BasicGeometry to IGeometry.

New Post: VS 2013 Template and maps

$
0
0
hello;
i'm new to this kind of concepts, i'm testing and using DotSpatial 1.7 with visual studio 2013 community edition.
first i could not find any template for VS2013.
second, i followed a tutorial on how to use the windows form control but have no idea on how to load a map , have we to provide some kind of file or from online ?

thank you for the good job done here.

New Post: Vertex Equals operator correct?

$
0
0
In a test, I create a Vertex(2.0,2.0), i e with X = 2.0 and Y = 2.0. The GetHashCode returns 0. How can this be?

New Post: IGeometry?

$
0
0
I tried this and it runs:
double d = 1000;
var distop = new DistanceOp(centroid.BasicGeometry as IGeometry, lineFeature.BasicGeometry as IGeometry, d);
But the results are not what I expect:


centroid coordinate: x = 448325.2 (meters), y = 6376370.5
closest point according to DistanceOp: x = 447927.9, y=6376214.2, minDistance = 427.0
closest point when iterating over the line coordinates: x = 448064.7, y = 6376106.9, minDistance = 370.7

The line feature consists of seven points. DistanceOp selects the second point as the closest. Have I misunderstood how DistanceOp works?

New Post: IGeometry?

$
0
0
You need to post the WKT of both centroid and linefeature if you want an answer to that question.
WKT: ((IGeometry)lineFeature.BasicGeometry).ToString();

New Post: Question on Point.ClosestPoint() method

$
0
0
Hi everyone,
Can somebody please explain what the Point.ClosePoint(Coordinate c) is good for? Since it only takes one Coordinate as argument, isn't is the same as Point.Distance(c) ?

New Post: WKT Invalid

$
0
0
I am using a shape file that I want to output the WKT of my shapes. Using QGIS I get a WKT. Using Shape2SQL, I get a similar WKT for the shape, but not exact. Using DotSpatial, I am getting yet a third format. However, with DotSpatial, the STIsValid returns false, while the other packages return true/valid.

Here is the code I am using to get the WKT. Is there just a bug in the WKT routine that it creates invalid text? Or, if it is Invalid, should I do a MakeValid on it? Visually, the shapes come across as identical, but the actual points in the polygons are slightly different. That worries me.

var shape = fs.GetShape(i, true);
                    var geometry = shape.ToGeometry();
                    var wkt = writer.Write((Geometry)geometry);

New Post: Raster data pixel value access as a rectangle

$
0
0
Is there any method to get a raster data cell value as a rectangle?

my code:
  IRaster inputRaster = Raster.Open("From my computer");

 for (int i = 0; i < inputRaster.NumRows;  i=i + 1)
        {
            for (int j = 0; j < inputRaster.NumColumns;  j=j + 1)
            {
               var coordinate = inputRaster.CellToProj(i, j); /// 
               // here i want to get the cell a Restanngle
            }
      }
My another Question : Does inputRaster.CellToProj(i, j) method return top left position of a cell of raster or anything else?

Patch Applied: #16717

$
0
0

jany_ has applied patch #16717.

Comment:
Thanks for this patch. It was applied in changeset #75536. Type safe didn't pick that up because arrays implement IList.

New Post: IFeatureLayer vs IMapFeaturelLayer vs IMapLayer?

$
0
0
Could you elaborate a bit on the difference between IMapLayer and IMapFeatureLayer?

Source code checked in, #75535

Source code checked in, #75536

$
0
0
Made sure that LineString._points won't be a fixed array which could cause an error in LinearRing.ValidateConstruction

New Post: Question.

$
0
0
Hi everybody

I am so sorry for my english bad. I am going to explain clearly about the DotSpatial for my Application

What have in the project
In the layer only have a simple Line that I created using the Coordinate array, then use the LineString.

My goal is:
*The user is selecting the layer using (FuntionMode.Select), it creates a simple Rectangle (Show below the image). Then the Line layer is selected, I want to get all Selected Coordinates in the Line Layer, it is possible to getting the Coordinates?.

//Create a 'square' around the clicked point
        //
        //  pLeftTop  _____  pRightTop
        //                  |       |
        //                  |       |
        //                  |_____|
        //    pLeftBot      pRightBot
Why I am doing it?, Because, first of all, The user is selecting, I can know what is the position initial of the line, and the final position, in order to show information for a final user.


Thanks in advance

New Post: IFeatureLayer vs IMapFeaturelLayer vs IMapLayer?

$
0
0
If you have a look at the interfaces you'll see that IMapFeatureLayer inherits from IMapLayer and IFeatureLayer.
IMapLayer only inherits from ILayer and has one own function (DrawRegions).
IFeatureLayer inherits from 14 Interfaces and has about 30 functions, 10 properties and 3 event handlers.

Commented Unassigned: the LayerSelected Event of map's layers [25878]

$
0
0
layers's LayerSelected event didn't work, when it was applied to the DotSpatial.Plugins.ShapeEditor
Comments: ** Comment from web user: jany_ **

It seems the problem comes up after a project was loaded from dspx. Please have a look whether adding

```
manager.SerializationManager.Deserializing += SerializationManager_Deserializing;
```

into public ButtonHandler(AppManager manager) and

```
void SerializationManager_Deserializing(object sender, SerializingEventArgs e)
{
if (_geoMap != null && _geoMap.Layers != null)
{
_geoMap.Layers.LayerSelected -= Layers_LayerSelected;
_geoMap.MapFrame.LayerSelected -= MapFrame_LayerSelected;
_geoMap.MapFrame.LayerRemoved -= MapFrameOnLayerRemoved;

_geoMap.Layers.LayerSelected += Layers_LayerSelected;
_geoMap.MapFrame.LayerSelected += MapFrame_LayerSelected;
_geoMap.MapFrame.LayerRemoved += MapFrameOnLayerRemoved;
}
}
```
into the ButtonHandler class solves your problem.

Viewing all 3973 articles
Browse latest View live