question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v4.0 migration - LinesString - how to add track to map ?

See original GitHub issue

HI,

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:closed
  • Created 2 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dinonovakcommented, Feb 21, 2022

This issue is caused by same error as #1514 (number format conversion from non US to US) You can close this

0reactions
pauldendulkcommented, Feb 21, 2022

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>

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found