Coder Social home page Coder Social logo

chompar4 / vicmap Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 35.54 MB

tools for working with map projections and geographic data in victoria

Python 100.00%
lambert-conformal-conic reverse-projections datums geodetic-computations victoria utm grid mga mapgridofaustralia magnetism

vicmap's Introduction

Vicmap

Build status

Python tools for working with common victorian (+ nsw) map projections

Installation

poetry install

Specifying Points

Points on ellipsoidal surfaces are represented by GeoPoint instances and points in the 2d x-y plane are represented by the PlanePoint instances. Each type of point requires a set of coordinates, and a datum or grid respectively. GeoPoint and PlanePoint objects are defined on topologically distinct surfaces and so require a forward or inverse point projection to transform one to the other.

Class Coordinates Description
GeoPoint() (φ, λ) decimal geographic latitude and longitude on geoid
MGAPoint() (z, E, N) z: grid zone designator, easting and northing meters in a Map Grid of Australia plane
VICPoint() (E, N) easting and northing in meters in a VICGRID plane
MGRSPoint() (z, usi, x, y) z: grid zone designator, usi: the 100,000-meter square identifier, easting and northing in meters

To define a point, specify the coordinates and the datum/grid.

geo_pt = GeoPoint(φ=-37, λ=145, datum=GDA20)
mga_pt = MGAPoint(zone=54, lat_band='H', E=250,000, N=5,600,000, grid=MGA94)

or use some of the provided utils to specify points from common reference systems. (e.g a 6 figure GR)

pt = MGRSPoint.from_6FIG(55, "H", "fu", "275882")
pt.transform_to(WGS84)

Geodesic Distance

Use the distance_to method on GeoPoint instances to compute geodesic distance across the surface of the reference ellipsoid. This method handles different datums by projecting to a common ellipsoid.

p1 = GeoPoint(dLat=-37.95103342, dLng=144.4248679, datum=GDA20)
p2 = GeoPoint(dLat=-37.65282114, dLng=143.9264955, datum=GDA94)
p1.distance_to(p2) 
>>> 54972.274

Grid Distance

Use the distance_to method on a PlanePoint to compute grid distances.

Declination / Grid Magnetic Angles

Every instance of a point class can evaluate the grid convergence, magnetic declination and grid magnetic angle of it's position.

Install the latest release of isogonic-api from source at the following link if you need to run geomagnetic calculations. This is not required to use the rest of the functionality.

https://github.com/chompar4/isogonic-api
sf = 10,000
pt = MGAPoint(zone=54, lat_band='H', E=24 * sf, N= 250 * sf, grid=MGA20)
print(pt.declination, pt.grid_convergence, pt.grid_magnetic_angle)

NSW Topo Maps

The relevant data for these maps can be grabbed by running

https://portal.spatial.nsw.gov.au/server/rest/services/Hosted/Topo_Map_Index/FeatureServer/0/query?text=&geometry&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&objectIds=&where=objectid%3E-1&time=&returnCountOnly=false&returnIdsOnly=false&returnGeometry=false&maxAllowableOffset=&outSR=&outFields=mapnumber%2Cmapname%2Cmapseries%2Cadjmapindexx%2Clabel%2Cadjmapindexy&f=pjson

Brennan Coordinates

MGA Points can handle creation using the Brennan system of describing coordinates (see https://ozultimate.com/canyoning/track_notes/du_faur_creek.htm). These consist of a 6 Figure MGA Grid Reference and a Map Sheet Number (e.g '8930-1N' or 'Mount Wilson'). Only MGA coordinates are currently supported in this method. The following example gives the decimal coordinates of the start of Pipeline Canyon.

pt = MGAPoint.from_brennan('452278', '8931-1S')
dLat, dLng = pt.transform_to(pt.grid.datum)

CI

Run buildkite agent using buildkite-agent start

vicmap's People

Contributors

chompar4 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

vicmap's Issues

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.