Giter Club home page Giter Club logo

pwshplaces's Introduction

pwshPlaces

Minimum Supported PowerShell Version PowerShell Gallery Cross Platform License

Branch Windows - PowerShell Windows - pwsh Linux MacOS
main Build Status Windows PowerShell main Build Status Windows pwsh main Build Status Linux main Build Status MacOS main
dev Build Status Windows PowerShell dev Build Status Windows pwsh dev Build Status Linux dev Build Status MacOS dev

Synopsis

pwshPlaces is a PowerShell module that can help you discover places and search for points of interest around the globe.

Description

pwshPlaces enables you to leverage the Google Maps and/or Bing Maps API(s) to perform a variety of maps related tasks using PowerShell:

  • Search for places, entities, addresses, and other points of interest
  • Discover locations near your or near a specified place
  • Easily perform Geocoding and reverse Geocoding actions
  • Get detailed place information including opening hours, website information, and contact information

pwshPlaces provides the following functions:

Why

The Google Maps and Bing Maps API require very specific formatting and criteria for API map interaction. The goal of this project is to abstract that complexity away in favor of simple and direct PowerShell commands.

Installation

Prerequisites

To use pwshPlaces you will require a Google Maps or Bing Maps API key. To use all of the functions you will require both.

๐Ÿ™„ Not another module that requires an API Key!

Both of these Map API keys are easy to create and have no cost pricing tiers which should meet your needs. I have provided detailed guides on how to get your API keys:

Install pwshPlaces

# Install pwshPlaces from the PowerShell Gallery
Install-Module -Name pwshPlaces -Repository PSGallery -Scope CurrentUser

Quick start

######################################################################################
# Google Maps
$googleAPIKey = 'yourGoogleAPIKey'
######################################################################################
# I want to find a specific place
Find-GMapPlace -Query "Krause's cafe" -GoogleAPIKey $googleAPIKey
Find-GMapPlace -Query '+18306252807' -GoogleAPIKey $googleAPIKey
Find-GMapPlace -Query 'cafe' -PointLatitude '29.7049806' -PointLongitude '-98.068343' -GoogleAPIKey $googleAPIKey
#-------------------------------------------------------------------------------------
# I want to search for a type of place
Search-GMapText -Query "Cupcakes" -Type bakery -AllSearchResults -GoogleAPIKey $googleAPIKey
Search-GMapText -Query "italian restaurants in New York" -MinPrice 4 -GoogleAPIKey $googleAPIKey
#-------------------------------------------------------------------------------------
# I want to search for nearby places
Search-GMapNearbyPlace -Latitude '29.7049806' -Longitude '-98.068343' -Radius 5000 -GoogleAPIKey $googleAPIKey
Search-GMapNearbyPlace -Latitude '29.7049806' -Longitude '-98.068343' -Radius 10000 -RankByProminence -Keyword 'butcher' -Type store -GoogleAPIKey $googleAPIKey
#-------------------------------------------------------------------------------------
# I want to get very detailed information about a place - place ID retrieved from other commands
Get-GMapPlaceDetail -PlaceID 'ChIJf9Yxhme9XIYRkXo-Bl62Q10' -Contact -Atmosphere -GoogleAPIKey $googleAPIKey
#-------------------------------------------------------------------------------------
# I want to GeoCode an address
Invoke-GMapGeoCode -Address '148 S Castell Ave, New Braunfels, TX 78130, United States' -GoogleAPIKey $googleAPIKey
#-------------------------------------------------------------------------------------
# I want to reverse GeoCode a location
Invoke-GMapGeoCode -Latitude '29.7012853' -Longitude '-98.1250235' -GoogleAPIKey $googleAPIKey
######################################################################################
# Bing Maps
$bingAPIKey = 'yourBingAPIKey'
######################################################################################
# I want to find a specific place
Find-BingPlace -Query "Krause's cafe" -BingMapsAPIKey $bingAPIKey
Find-BingPlace -Query 'cafe' -PointLatitude '29.7049806' -PointLongitude '-98.068343' -BingMapsAPIKey $bingAPIKey
#-------------------------------------------------------------------------------------
# I want to search for nearby places
Search-BingNearbyPlace -Type Attractions -BingMapsAPIKey $bingAPIKey
Search-BingNearbyPlace -Type CafeRestaurants -PointLatitude '29.7049806' -PointLongitude '-98.068343' -BingMapsAPIKey $bingAPIKey
#-------------------------------------------------------------------------------------
# I want to GeoCode an address
Invoke-BingGeoCode -AddressLine '148 S Castell Ave' -City 'New Braunfels' -State TX -PostalCode 78130 -BingMapsAPIKey $bingAPIKey
#-------------------------------------------------------------------------------------
# I want to reverse GeoCode a location
Invoke-BingGeoCode -Latitude '29.7030' -Longitude '-98.1245' -BingMapsAPIKey $bingAPIKey
#-------------------------------------------------------------------------------------
# I want to determine the Time Zone of a specific place
Find-BingTimeZone -Query 'New Braunfels, TX' -BingMapsAPIKey $bingAPIKey
Find-BingTimeZone -PointLatitude 29.70 -PointLongitude -98.11 -BingMapsAPIKey $bingAPIKey
#-------------------------------------------------------------------------------------

FAQ

pwshPlaces - FAQ

Author

Jake Morrison - https://www.techthoughts.info/

Notes

Read more about:

This PowerShell project was created with Catesta.

Changelog

Reference the Changelog

pwshplaces's People

Contributors

techthoughts2 avatar

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.