Skip to content

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

License

Notifications You must be signed in to change notification settings

techthoughts2/pwshPlaces

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pwshPlaces

Minimum Supported PowerShell Version PowerShell Gallery Cross Platform License Documentation Status

pwshPlaces Logo

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
Enhancements Build Status Windows PowerShell Enhancements Build Status Windows pwsh Enhancements Build Status Linux Enhancements Build Status MacOS Enhancements

Synopsis

pwshPlaces is a PowerShell module that integrates with leading mapping services like Google Maps and Bing Maps. Offering a suite of commands for interacting with maps, it enables you to perform searches, read reviews, and retrieve detailed information about locations worldwide. From discovering nearby restaurants to geocoding addresses, pwshPlaces equips you with a wealth of geographical data, accessible through simple and intuitive PowerShell commands.

Description

pwshPlaces enables you to leverage the Google Maps and/or Bing Maps APIs to perform a variety of map-related tasks using PowerShell. This module simplifies accessing and analyzing geographical data with user-friendly commands, empowering users to search for locations, read reviews, and perform geocoding effortlessly. Ideal for discovery, travel planning, or enhancing automation scripts, pwshPlaces transforms complex mapping data into actionable insights using PowerShell.

Features

  • Support for both Bing Maps and Google Maps
  • Find Places with Ease: Use commands to locate any place, from restaurants to landmarks, using simple queries.
  • Open-Text Search Capabilities: Harness the power of flexible, text-based searches. Whether it’s "coffee shops in Amsterdam" or "art galleries in New York", get targeted results swiftly.
  • Discover Nearby Points of Interest: Explore what's around you, be it parks, eateries, or museums, based on your current or specified location.
  • Efficient Geocoding and Reverse Geocoding: Convert addresses to coordinates and vice versa, integrating geographical context into your data.
  • In-depth Place Details: Dive deeper into specific locations to access comprehensive information like contact details, ratings, reviews, and more.
  • Time Zone Information: Stay informed about the time zones of different places, making scheduling and planning across time zones simpler.
  • Rapid Comparison and Decision Making: Compare ratings, prices, and other key information quickly and make informed decisions without wading through dense web pages.
  • Customizable Search Parameters: Tailor your searches with various parameters like radius, price level, and types to get precisely what you're looking for.

Getting Started

Documentation

Documentation for pwshPlaces is available at: https://pwshPlaces.readthedocs.io

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:

Installation

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
#-------------------------------------------------------------------------------------

Notes

This PowerShell project was created with Catesta.

Contributing

If you'd like to contribute to pwshPlaces, please see the contribution guidelines.

License

This project is licensed under the MIT License.