This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import geopandas as gpd | |
df = gpd.read_file('<geojson_filename.geojson>') | |
df.plot() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% 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 |