Skip to content

Instantly share code, notes, and snippets.

View srividyacb's full-sized avatar
:octocat:
💯 :atom:

Srividya Bharadwaj srividyacb

:octocat:
💯 :atom:
View GitHub Profile
@thetrevorharmon
thetrevorharmon / example-query.js
Last active December 13, 2023 23:43
Query JSON with S3 Select in Node.js
// See tth.im/s3json for a full explanation of this code
const AWS = require('aws-sdk');
const S3 = new AWS.S3();
exports.handler = async (_, context) => {
try {
const query = 'SELECT * FROM s3object[*].results[*] r;';
// test query is against data from https://swapi.co/api/planets/?page=2

Fixing India on mapbox-streets style

  • Add Indian disputed boundaries source: planemad.bb1ba8b5 to you style project from the layers panel
  • If the source is locked, open the project.yml file and append it manually to the source field. You would also need to manually add the layers boundaries-claimed and boundaries-disputed after the admin layer similiar to this:
source: "mapbox:///mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v6,planemad.bb1ba8b5"
layers:
 - landcover
@argelius
argelius / frechet.js
Last active August 25, 2022 18:40
Discrete Frechet Distance
/* Discrete Fréchet Distance
* By Andreas Argelius http://argeli.us/
*
* Implementation of Discrete Frechet Distance in Javascript.
*
* The paths are defined as [[x0, y0], [x1, y1], ...]
*
*/
(function() {
@benbalter
benbalter / geojson-conversion.sh
Last active April 23, 2024 13:16
Bulk convert shapefiles to geojson using ogr2ogr
# Bulk convert shapefiles to geojson using ogr2ogr
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/
# Note: Assumes you're in a folder with one or more zip files containing shape files
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere)
#geojson conversion
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
}