New Comment on "Documentation"
New Post: IGeometry?
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?
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?
Wouldn't it be convenient a Feature.ToGeometry() method, even if it only calls ToShape().ToGeometry() ?
New Post: Best practice to split line feature
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?
New Post: VS 2013 Template and maps
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?
New Post: IGeometry?
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?
WKT:
((IGeometry)lineFeature.BasicGeometry).ToString();
New Post: Question on Point.ClosestPoint() method
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
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
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
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?
Source code checked in, #75535
Source code checked in, #75536
New Post: Question.
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?
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]
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.