Skip to content

Instantly share code, notes, and snippets.

@rudmark
Created October 12, 2012 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rudmark/3881223 to your computer and use it in GitHub Desktop.
Save rudmark/3881223 to your computer and use it in GitHub Desktop.
//This example uses functions in the MightyLittleGeodesy library by Björn Sållarp (C), licensed under the MIT License.
using MightyLittleGeodesy.Positions;
[...]
//Assign WGS84 values
WGS84Position wgs84_lat_lon_start = new WGS84Position(59.30,15.30);
WGS84Position wgs84_lat_lon_end = new WGS84Position(59.80,16.90);
//Convert WGS84 values to SWEREF99
SWEREF99Position sweref99_lat_lon_start = new SWEREF99Position(wgs84_lat_lon_start, SWEREF99Position.SWEREFProjection.sweref_99_tm);
SWEREF99Position sweref99_lat_lon_end = new SWEREF99Position(wgs84_lat_lon_end, SWEREF99Position.SWEREFProjection.sweref_99_tm);
//Extract lat_start, lat_end, lon_start and _lat_end for SWEREF99 search
double sweref99_lat_start = sweref99_lat_lon_start.Latitude;
double sweref99_lat_end = sweref99_lat_lon_end.Latitude;
double sweref99_lon_start = sweref99_lat_lon_start.Longitude;
double sweref99_lon_end = sweref99_lat_lon_end.Longitude;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment