Friday, September 22, 2023

Geoapify: GIS APIs, with OpenStreetMap data

A very good Geo / GIS API: Geoapify.com 
Powered by Open Street Map (OSM) data.
22x better price than Google API!
3K free calls / day


Geocoding API overview  |  Google for Developers

Platform Pricing & API Costs - Google Maps Platform

$200/month "free" = 40K geocoding api calls
300K/month = $1300

Geocoding API overview  |  Google for Developers


Geoapify.com Maps, APIs and components | Geoapify Location Platform
Develop location-aware apps for your business with our user friendly APIs and location services

Pricing | Geoapify Location Platform

3K calls/day free = 90K/month
10K/day = 300K/month = $59 = 22 times less than Google!

Geocoding API Playground by Geoapify


py4e-data.dr-chuck.net Data Sources

py4e-data.dr-chuck.net/opengeo
Python For Everybody Open StreetMap / GeoAPIfy Proxy Server

Powered by Geoapify at the free level. 


free access to OSM data on AWS

registry.opendata.aws/osm/

AWS TLD! 

AWS Marketplace: OpenStreetMap on AWS


Maps - Amazon Location Service



valhalla/valhalla: Open Source Routing Engine for OpenStreetMap @GitHub

Valhalla is an open source routing engine and accompanying libraries for use with OpenStreetMap data. Valhalla also includes tools like time+distance matrix computation, isochrones, elevation sampling, map matching and tour optimization (Travelling Salesman). C++, MIT

Traditional global OSM services require substantial hardware, but Valhalla is a major exception designed specifically to run on low-memory footprints.
Whether you need a massive instance depends entirely on the type of service you are hosting.
Traditional OSM Services (High Memory)
If you are hosting a standard global Rendering Tile Server (using PostgreSQL/PostGIS) or a Geocoding Server (like Nominatim), you generally need a large instance.
  • RAM: 64 GB to 128 GB+ (to cache massive database indexes).
  • Storage: 1 TB+ of fast NVMe SSD storage.
  • Why: These services must constantly query a massive, monolithic database of global geometries.

How Valhalla Handles Memory (Highly Efficient)
Valhalla completely rethinks this limitation. Unlike other routing engines (like OSRM) that load the entire global routing graph directly into RAM, Valhalla utilizes a tiled, hierarchical data structure.
  • Disk Over RAM: Valhalla breaks the world map down into small, manageable geographic tiles stored on your disk. When a route is requested, it dynamically loads only the required tiles into memory on demand.
  • Low Hardware Requirements: Because it doesn't load the whole planet into RAM, you can easily host a global routing engine on an instance with as little as 4 GB to 8 GB of RAM, provided you have fast SSD storage for tile lookups.
  • Edge & Mobile Ready: Valhalla is so memory-efficient that its C++ core is frequently compiled to run completely offline on mobile devices (like iOS and Android) or embedded systems. [1]
The Catch: While running the Valhalla service requires very little memory, building the tiles from a raw planet OSM file (.osm.pbf) is a heavy, one-time process that will require a larger machine (typically 32 GB to 64 GB of RAM) or a well-configured swap space.

node.js: get EXIF info from img files

Exif - Wikipedia

Exchangeable image file format (officially Exif, according to JEIDA/JEITA/CIPA specifications)[5] is a standard that specifies formats for images, sound, and ancillary tags used by digital cameras (including smartphones), scanners and other systems handling image and sound files recorded by digital cameras.


JPEG and EXIF Data Manipulation in Javascript | Getaround Tech

EXIF Tags


Getting image metadata (EXIF) using Node.js

exif - npm search


exif-parser - npm Weekly Downloads: 830,159

exif-parser is a parser for image metadata in the exif format, the most popular metadata format for jpeg and tiff images. It is written in pure javascript and has no external dependencies. It can also get the size of jpeg images and the size of the jpeg thumbnail embedded in the exif data. It can also extract the embedded thumbnail image.


exif - npm (MIT license)

gomfunkel/node-exif: A node.js library to extract Exif metadata from images.

convert to js promise to be able to use with async/await

import exif from 'exif'
export async function getExifAsync(imgPath) {
    return new Promise(function(resolve, reject) {
        new exif.ExifImage({ image : imgPath }, function (error, exifData) {
            if (error) {
                reject(error)
            } else {
                resolve(exifData)
            }
        });
    }) }
const exifData = await getExifAsync(imgPath)
console.log(exifData)


here is another library that also provides assess to "thumbnail" image that is embedded into the EXIF


ExifReader is a JavaScript library that parses image files and extracts the metadata. It can also extract an embedded thumbnail. It can be used either in a browser or from Node. Supports JPEG, TIFF, PNG, HEIC, and WebP files with Exif, IPTC, XMP, ICC, and MPF metadata (depending on file type).


the "popularity winner", but not useful for reading EXIF


Weekly Downloads: 3,308,475Turns out the exif, iptc, and xmp fields contain the raw data, rather than parsed data. Hurm. It's an opaque object from which we cannot access the fields. This is not the hoped-for result, nor does it fit with other features in Sharp.