Skip to content

Utility which outputs .geojson files for coverage area, smallest circle and equidistant point.

Notifications You must be signed in to change notification settings

intheswim/geojson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

/* geojson, Copyright (c) 2013-2020 Yuriy Yakimenko */

This is a utility which outputs .geojson files.

==================================================

Background:

===============

Parts of the code (MapObject, LatLong) were originally developed in 2008-2010 in Java when I was working on components of RailBandit. They were also ported into C++ for the backend, and largely have not been modified since.

In 2013 I developed the area function when Apple's iTunes added functionality to specify geojson file to describe the transit coverage area for a transit application (RailBandit app was one).

Mincircle and Equidistant parts are based on materials from Wikipedia and other open sources.

I am no longer developing RailBandit, this utility has been not used for years, so I am open-sourcing it, perhaps someone finds it useful.

One visualization tool for checking results is here:

Geojson.io

(click Open > File, select output.geojson)


There are three main built-in functions invoked from command line:

  1. Take a collection of coordinates (lat/longs) as input in .csv or .txt file and ouput the "enclosing boundary area" where all bondary points will be at least given distance from input points. As parical example, take all NJ Transit stations locations as input and output area within X km of these stations.

Syntax:

./geojson area input.csv 12 50

Here 50 is distance in kilometers, 12 is number of points around each input coordinate. This number must be greater than 2, and the greater this number is, the more "round" looking will be the boundary.

Sample output

  1. Second function is calculating equidistant point based on three geographic coordinates.

See GeoUtils::getEquidistantPoint

Syntax:

./geojson eqdist input.csv 12

Note: only the first three coordinates in .csv file will be used in this case.

  1. Find "min circle" (minimum bounding circle) based on a collection of input points. This function uses non-recursive randomized Welzl algorithm, applying it to spherical/geodesic case.

See GeoUtils::mincircle

Wikipedia link for Smallest Circle problem

Syntax:

./geojson mincirle input.csv 12

Sample output


Known issues:

=================

I have not included a check in eqdist function to make sure all three locations are different. Obviously the program will fail when input is bad (the same is true with other two functions).

I also have not included any checks for distance being too large, etc.

Ideas:

==========

Add Appolonius problem solution (spherical case) as #4 function into this utility.

About

Utility which outputs .geojson files for coverage area, smallest circle and equidistant point.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published