v4.0 migration - LinesString - how to add track to map ?
See original GitHub issueHI,
looking if v4.0 may solve issue with track I am trying to migrate my code to it. But I am having issue how to do it with line string. currently I am creating line string this way:
List<MPoint> segmentPoints = new List<MPoint>();
foreach (XmlElement xelement in xmlPoints) //fetching points from XML file
{
segmentPoints.Add(SphericalMercator.FromLonLat(Convert.ToDouble(xelement.GetAttribute("lon")), Convert.ToDouble(xelement.GetAttribute("lat"))).ToMPoint());
}
var feature = new GeometryFeature() // creating feature layer
{
Geometry = new LineString(segmentPoints.ToArray()) // this is where I need help, how do I construct linestring from MPoints list ?
};
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Lines on maps in Python
Below we show how to create geographical line plots using either Plotly Express with px.line_geo function or the lower-level go.Scattergeo object.
Read more >Data Layer | Maps JavaScript API
With the Data layer, you can add GeoJSON data to a Google map in just one line of code. ... Map(document.getElementById("map") as HTMLElement,...
Read more >Reconstruct tracks | ArcGIS GeoAnalytics Engine
Reconstruct Tracks connects time-sequential points into tracks and summarizes records within the track. Tracks are identified by one or more track fields.
Read more >Plotting ways (linestrings) over a map in Python
In origin and destination you have the ids of the citylocations, in move how many travelled from origin to destination. longitude and latitude ......
Read more >Displaying Routes On A Map In Power BI - Chris Webb's BI Blog
In this post I'll show you how you can put all this together to do something really useful: display routes on a map...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This issue is caused by same error as #1514 (number format conversion from non US to US) You can close this
One more thing. MPoint is part of Mapsui itself (along with MRect and MQuad), while LineString is part of NTS. If you work with NTS it makes more sense to work with NTSs Point or Coordinate. There are extension methods for converting between them.
And I see we even have an MPoint ToCoordinate extension method. Perhaps we should also add an ToCoordinates that takes an
IEnumerable<MPoint>