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

New Post: Unable to add AngleControl to Form

$
0
0
On Adding Angle Control to the Project Form (Version 4.0.0.0) I get an immediate error.
TEXT

Any help or direction would be great

New Post: Error in BluetoothDevice.Refresh using a new Windows 10 install

$
0
0
I am getting an 'Input Parameter is incorrect' when DotSpatial is looking for a Bluetooth device that is providing GPS data - it only seems to happen on a new Windows 10 install, not on an upgrade from Windows 7 (those are the two cases we have).
// Make an API call to retrieve information for the device
NativeMethods2.BluetoothDeviceInfo info = new NativeMethods2.BluetoothDeviceInfo(_address.ToInt64());

int errorCode = NativeMethods2.BluetoothGetDeviceInfo(BluetoothRadio.Current.Handle, ref info);

According to Microsoft documentation, the error is indicating that the second parameter that is being passed in is null.

Hoping someone can provide some insight here =)

New Post: Generate contour lines form list of XYZ points

$
0
0
Hi,

I have created a GIS project call www.djupkarta.se where the goal is to create marine maps over Swedish lakes. Today I am using an GUI based application to generate the maps from X,Y,Z points but the project is getting quite large an the amount of data is growing rapidly (When writing about 350miljon XYZ points) so I am about to start to check on how I can automate the procedure.

I got a tool for generating the maps and it takes shape files as input. I wonder if DOT Spatial can convert a list of XYZ points to contour lines?

Br
Bjorn Kallin

New Post: Generate contour lines form list of XYZ points

$
0
0
Not sure what contour lines are exactly but having a look at DotSpatial.Plugins.Contourer it seems it creates a simple line or polygon shapefile so if that is what you want DotSpatial is able to do it.

New Post: Generate contour lines form list of XYZ points

New Post: Exception UpdateEnvelope in type NetTopologySuite.Geometries.LineString does not have implementation

$
0
0
DotSpatial.NetTopologySuite version 1.14.4.0

InnerException
"Method 'UpdateEnvelope' in type 'NetTopologySuite.Geometries.LineString'
from assembly 'DotSpatial.NetTopologySuite, Version=1.14.4.0, Culture=neutral, PublicKeyToken=f580a05016ebada1'
does not have an implementation.":
"NetTopologySuite.Geometries.LineString"} System.Exception {System.TypeLoadException}
There are only to elements load at the start of the application:
private DotSpatial.Positioning.Forms.Compass Compass;
private DotSpatial.Symbology.Forms.AngleControl acHeading;
I could really use some help understanding this.

New Post: Exception UpdateEnvelope in type NetTopologySuite.Geometries.LineString does not have implementation

$
0
0
UpdateEnvelope was removed from GeoAPI in Version 1.7.4.3. So this sounds as if your using an old version of GeoAPI against the newest version of NetTopologySuite.

Use the dlls from the lastest available master build to make sure all your dlls fit together.

New Post: Working with in memory FeatureSet and Feature DotSpatial

$
0
0
Hello All
I'm a beginner with DotSpatial and I'm stuck with a problem. I try to work with in memory feature (to keep them only in Map) until the user hit save button. The basic idea is that the user imports some dxf files and creates featureset based on layer name if the FeatureSet doesn't all ready exist, and for each polyline from dxf creates feature which will be added into a featureset.

public IFeature AddPoligons(EntityObject polyline, List<Text> textInDxf)
{
IFeatureSet featureSet = null;
//Getting the right featureset from map
foreach (var x in appManager.Map.GetPolygonLayers())
{
    if (!string.Equals(x.DataSet.Name, layerName)) continue;

    featureSet = x.DataSet as FeatureSet;
    break;
}
var polygon = CreatePolygon(polyline);

//Creating feature and adding to FeatureSet
var feature = featureSet.AddFeature(polygon);

//Populating DataRow with information
AddinfoIntoDataTable(feature, polygon, textInDxf);
return feature;
}
Everything thing looks fine, the map is updated with new polygons, can select them, view information from datatable BUT, when I try to delete a selected feature (polygon) it throws an IndexOutOfRange exception.

What I'm doing wrong there?

Please help! Thank you and sorry for my poor English.

P.S. When I created the featureSet first I saved it on the disk and then loaded into map with Map.AddLayer() method.

New Post: Working with in memory FeatureSet and Feature DotSpatial

$
0
0
Hello

Meanwhile I found the solution somewhere on this forum, and was posted by Jany
The idea is to call this pice of code after each action against a FeatureSet (add, remove, move)
                featureLayer.DataSet.UpdateExtent();
                featureLayer.DataSet.InitializeVertices();
                featureLayer.LabelLayer?.CreateLabels();
                if(save)
                {
                featureLayer.DataSet.Save();
                featureLayer.DataSet.Close();
                }
                featureLayer.AssignFastDrawnStates();
                AppManager.Map.Refresh();
                AppManager.Map.ResetBuffer();
where featureLayer is IFeatureLayer.

There is one problem:

If we save the project with AppManager.Serialization.SaveProject() and then open the project AppManager.Serialization.OpenProject() the issue appear again.
As a solution for this I call my Save method after open the project and on short is look like this:
public void Save()
{
     foreach(var featureLayer in AppManager.Map.GetPolygonLayers())
     {
         featureLayer.DataSet.Save();
    }
}
Hope that helps someone.

New Post: Spatialiteprovider

$
0
0
Hello, I'm new with DotSpatial, but I think it's a wonderful solution.

I would like to know hoy to use spatialiteprovider to connect spatialite database to load layers programatically.
What references have I got to load, or projects do I have to copy in my pown project.

Thanks in advance!

New Post: Define polygon cross 180 meridian

$
0
0
Hello All,

I am new to DotSpatial and I try to define a polygon cross 180 meridian by following:
        FeatureSet fs = new FeatureSet(FeatureType.Polygon);
        Coordinate[] coord = new Coordinate[5];
        coord[0] = new Coordinate(30, 48);
        coord[1] = new Coordinate(120, 45);
        coord[2] = new Coordinate(-170, 64);
        coord[3] = new Coordinate(30, 70);
        coord[4] = new Coordinate(30, 48);
        Polygon pg = new Polygon(coord);
        pg.Normalize();
        fs.Features.Add(pg);
        fs.Projection = DotSpatial.Projections.KnownCoordinateSystems.Geographic.World.WGS1984;
        fs.SaveAs(HttpContext.Current.Server.MapPath("~/shp/test2.shp"), true);
However, when I check the shape file, the polygon comes out to be

Image

If I draw the same polygon in SQL Server with

DECLARE @Poly geography =
geography::STPolyFromText('POLYGON((30 48, 120 45, -170 64, 30 70, 30 48))', 4326)
SELECT @Poly

I can see the polygon shown as

Image

Can anyone help me how to solve this issue in DotSpatial.

Thank you very much!

New Post: Spatialiteprovider

$
0
0
Hello again.
I've been trying with the modules, but I've problems with the assembly versions. neither DotSpatial.Data.Database is known in namespace.
Could anybody give the instructions and modules to load (dlls, packages, etc) to get the connection to spatialite database?

Any help will be gratefull.

Thanks in advance!!

New Post: Define polygon cross 180 meridian

$
0
0
Please use DotSpatial.Controls.DatelineCrossingMap instead of DotSpatial.Controls.Map.

Map is not able to show date line crossing polygons correctly.

New Post: Spatialiteprovider

$
0
0
Download the latest available build from master branch.

Add the DotSpatial.Plugins.SpatiaLite plugin to your plugin folder. Take all the other dlls you need from this zip file, too.

For everything to work as it should make sure your folder structure equals the structure inside the zip file. Your program should be placed where DemoMap.exe is in the zip file.

New Post: Define polygon cross 180 meridian

$
0
0
Hi jany,

This really helps. Thank you very much!

New Post: Spatialiteprovider

$
0
0
Thanks for your reply. I followed your instruction but I dont get that the project understand spatialiteprovider.
I habve problems with that module 'DotSpatial.Data.Database', It is not known, but I have copied the plugin.
I suppose any dll missing, but for the moment it resists
Thanks for you explanation.
Cheers

New Post: Generates Heat Map in DotSpatial

$
0
0
Hi All,

I am learning DotSpatial and wants to generate a heat map (such as region populations) from available vector data. Can anybody kindly gives me some clue that how I can do it? I am guessing I may need to use DotSpatial.Analysis but not sure.

Thank you!

New Post: webmap plugin

$
0
0
Hello,

How can I set the webmap plugin to default to other than 'NONE' when my applications loads.
I'm loading the webmap plugin.

Thanks for the help.

Glenn

New Post: webmap plugin

$
0
0
There is no way to set the selected provider directly.

But you could do the following thing.
  • Select the correct provider from the drop down.
  • Save your project via
     AppManager.SerializationManager.SaveProject(fileName)
  • Whenever you load your application call
  AppManager.SerializationManager.OpenProject(fileName)
after you've called
 AppManager.LoadExtensions()    
The WebMap plugin listens to the App.SerializationManager.Serializing and App.SerializationManager.Deserializing events, writing its settings to the dspx and reading them from there again.

New Post: webmap plugin

$
0
0
jany, thanks. will try your suggestions. Does the serialization only saves map settings? The other data of the application is not saved?
Viewing all 3973 articles
Browse latest View live


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