Skip to content

Danielovich/maptools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This code is a subset of a logistics planning tool, so don't take to much notice of the naming of things.

Given a map polygon based on DD formatted latitudes and longitudes:

New York:

-74.1522217, 40.9249273 -74.1563416, 40.9228521 -74.3554688, 40.5117111 -73.5905457, 40.5524176 -73.6193848, 40.9612339 -74.1522217, 40.9249273

We can then calculates valid points inside that polygon using raycasting.

We do this by first creating a box around the polygon, which is based on the upper and lower highest value in the polygon, and from there asking the raycasting algorithm.

And the raycast

New York

You adjust the distance between the points from the constructor on BoundaryPolygon(0.05).

The lower the distance, the more points you get. Higher, fewer points.

You can find the tests for these cases in GeoPointExtensionsTests.cs.

Besides those methods there is a method for determining distance between 2 points on a map, using the Haversine formula.

Those tests are found in DistanceCalculatorTests.cs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages