Skip to content

Instantly share code, notes, and snippets.

View thampiman's full-sized avatar

Ajay Thampi thampiman

View GitHub Profile
# Install library using: pip install reverse_geocoder
import reverse_geocoder as rg
coordinates = (51.5214588,-0.1729636), (9.936033, 76.259952), (37.38605,-122.08385)
result = rg.search(coordinates)
"""
Output will be a list of dicts:
[{'name': 'Bayswater',
'cc': 'GB',
'lat': '51.51116',
import json
from shapely.geometry import shape, Point
def load_geojson(filename):
"""Function to load GeoJSON"""
with open(filename) as f:
js = json.loads(f)
return js
def reverse_geocode(point, js):
import geopandas as gpd
df = gpd.read_file('<geojson_filename.geojson>')
df.plot()
import spray.json._
import com.esri.core.geometry.Point
import com.esri.core.geometry.OperatorContains
import com.esri.core.geometry.Geometry.GeometryAccelerationDegree
import com.esri.core.geometry.SpatialReference
import com.cloudera.science.geojson._
import com.cloudera.science.geojson.GeoJsonProtocol._
class ReverseGeocoder() extends java.io.Serializable {
// First load the GeoJSON data as a String
@Override
public void onLocationChanged(Location location) {
double lat = location.getLatitude();
double lon = location.getLongitude();
float accuracy = location.getAccuracy();
// Perform operations on latitude, longitude and accuracy
...
}
@thampiman
thampiman / AM3_25.m
Created November 17, 2010 10:05
Matlab script that simulates the modulation and demodulation of an AM wave
%% Author: Ajay Thampi
%% Problem: 3.25
% Modulation Process
Fc = 20; % carrier frequency of 20 kHz
Fs = 160; % sampling rate of 160 samples per ms
Fm = 0.4; % modulating frequency of 0.4 kHz
t = 0:1/Fs:10; % t of 10 seconds
c = cos(2*pi*Fc*t); % carrier signal
m = cos(2*pi*Fm*t); % modulating signal
@thampiman
thampiman / AM3_25.m
Created November 17, 2010 10:04
Matlab script simulating the modulating and demodulation of an AM wave
%% Author: Ajay Thampi
%% Problem: 3.25
% Modulation Process
Fc = 20; % carrier frequency of 20 kHz
Fs = 160; % sampling rate of 160 samples per ms
Fm = 0.4; % modulating frequency of 0.4 kHz
t = 0:1/Fs:10; % t of 10 seconds
c = cos(2*pi*Fc*t); % carrier signal
m = cos(2*pi*Fm*t); % modulating signal