Giter Club home page Giter Club logo

geospatialsimulator's Introduction

geospatialsimulator

A C# IoT geolocation simulator

The simulator will traverse a route, given orgin/dest as two geopoints. In this example, the lambda will be invoked every 5 seconds with current simulation state of the vehicle. You may modify the lambda to send events to whatever you like; console, event hub, service bus, etc. The provided example acts as an IoT device sending events to Azure IoT Central.

v.Speed is in meters/s, the times 3.6 converts it into kilometers/h. The telemetry is then sent on to IoT central using the azure DeviceClient library.

          Task consumer = new Vehicle(drivingRoute).StartTrip(async (IoTState v) =>
            {
                var telemetryDataPoint = new
                {
                    Location = new { lon = v.Longitude, lat = v.Latitude },
                    Speed = v.Speed * 3.6M
                };
                var messageString = JsonConvert.SerializeObject(telemetryDataPoint);
                var msg = new Message(Encoding.UTF8.GetBytes(messageString));
                System.Console.WriteLine(messageString);
                await deviceClient.SendEventAsync(msg);
            }, 5);

The simulator uses Azure Maps as a route source. The Azure Maps route api returns a set of line segments trace real life roads and highways. Normally that data is intended for showing a driver the route superimposed on a road map, however, the simulator takes that same information and "traces" the lines with geo coordinates.

In the above diagram you can see how the real roadway is represented as a set of line-segments. Just as with computer graphics, it can only represent the curvature at some granularity. Given the line-segments the simulator further divides them into meters, so that the simulation can produce geo coordinates with respect to some speed (meters per second).

geospatialsimulator's People

Contributors

tacowan avatar

Stargazers

Alexandre Nédélec avatar Alex Kryvdyk avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.