Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

georgio

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

georgio

Fast Geo Rust functions for Python

  • 2024.247.861
  • PyPI
  • Socket score

Maintainers
1

georgio

Fast geo Rust helper functions for Python.

Great Circle

To get the great circle distance between two points in meters, this function will use the IUGG mean Earth radius.

distance_in_meters = georgio.great_circle_distance(lon1, lat1, lon2, lat2)

If you want to provide your own radius in meters, you can use this function instead.

distance_in_meters = georgio.great_circle_distance_with_radius(lon1, lat1, lon2, lat2, radius_in_meters)

Line Of Bearing (LOB)

Returns the destination coordinates based on a starting position, bearing, and distance in meters. Bearing is in degrees, clockwise from north. It uses the IUGG mean Earth radius.

dest_lon, dest_lat = georgio.line_of_bearing(start_lon, start_lat, bearing_in_degrees, distance_in_meters)

If you want to provide your own radius in meters, you can use this function instead.

dest_lon, dest_lat = georgio.line_of_bearing_with_radius(start_lon, start_lat, bearing_in_degrees, distance_in_meters, radius_in_meters)

Bounding Box

This function will return a bounding box that encompasses the specified distance around a center point. Note that the bounding box will never extend across the antimeridian (longitude +/-180), below latitude -90, or above latitude 90.

west, south, east, north = georgio.bounding_box_for_point(lon, lat, distance_in_meters)

Web Mercator

To get the longitude/latitude bounds of a Web Mercator tile, use the following function, which will return the values in west, south, east, north order.

west, south, east, north = georgio.wm_bounds(x, y, z)

To get the upper left corner of a tile in longitude, latitude order, use the following function.

longitude, latitude = georgio.wm_upper_left(x, y, z)

To get a bounding box that surrounds a tile at a certain distance, use the following function. This can be useful when searching for centerpoints of objects that might be outside of the tile, where the object might extend into the tile. Note that the bounding box size is calculated in the WGS-84 projection based on the tile's longitude/latitude bounds, since Web Mercator is notoriously bad for calculating sizes/distances. Also note that the bounding box will never extend across the antimeridian (longitude +/-180), below latitude -90, or above latitude 90.

west, south, east, north = georgio.wm_tile_expanded_bbox(x, y, z, search_distance_in_meters)

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc