This project is read-only.

How to Add FeatureSet of Lat/Long Coordinates to Map

Aug 17, 2012 at 5:13 PM

Hello all, I have a list of coordinates that are in Lat/Long form that I am trying to add to a map using this sample code as a reference http://dotspatial.codeplex.com/wikipage?title=RandomPoints&referringTitle=Desktop_SampleCode. However even though they are located in North America they are nearly always located slightly off the center of the world on the map, which I figure is due to the map as apparently the map's extents are huge. How can I transform my Lat/Long WGS1984 coordinates to something that the map can understand?

 

-Thanks a lot

Aug 19, 2012 at 3:04 PM

Hi,

I do it this way.

First create a new layer

_myPoints = New FeatureSet(FeatureType.Point)

Then define the projection

_myPoints.Projection = KnownCoordinateSystems.Geographic.World.WGS1984

after this

Dim c As New Coordinate(-47, -15)

Dim p As New DotSpatial.Topology.Point(c)

Dim currentFeature As IFeature = _myPoints.AddFeature(p)

Aug 20, 2012 at 2:35 PM

Thanks a lot for your reply, I ended up finding out that it was a projection error due to Brutile using the Web-Mercator system. I found a solution to this problem in this thread http://dotspatial.codeplex.com/discussions/238631/ .