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

osm_tile_grabber

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

osm_tile_grabber

  • 1.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

OSM Tile Grabber

A simple gem for getting an image of a desired location using OSM tiles. This is fairly beta software and will likely change soon to make it nicer to use.

Usage

Note: You need to have rmagick installed for this gem to work. I will work on making this easier but for now just follow the instructions on the readme https://github.com/rmagick/rmagick

Usage warning:

Downloading large amounts of data from the openstreetmap.org tileserver is strictly forbidden. This gem is NOT to be used for downloading large maps from OSM for offline use. If you need local copies of large amounts of OSM tiles you must set up your own tile server or find a new tileserver where this is permitted. More info can be found at: https://operations.osmfoundation.org/policies/tiles/


Create an instance of OSMTileGrabber

OSMTileGrabber.new(lat1, lon1, lat2, lon2, zoom)

lat1 and lon1 are the coordinates of the top left corner of the map you wish to download. lat2 and lon2 is the bottom right coordinate. Zoom is the zoom level you wish to download the map at (1-19) a higher zoom will create a bigger image with more detail.

to download the image run create_image("<output_path>") on the object instance. This will save the final image at the path provided.

Example

require 'osm_tile_grabber'
osm = OSMTileGrabber.new(-34.9220585,138.5879188,-34.9397,138.6239,15)
osm.create_image("/tmp/output.png")

example output map

FAQs

Package last updated on 30 Apr 2018

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