Skip to content

Instantly share code, notes, and snippets.

import matplotlib.pyplot as plt
import contextily as ctx
fig = plt.figure(figsize=(20,20))
ax = plt.axes()
gdf[gdf.gps_qual > 0].plot(ax=ax, alpha=.2, edgecolor="#ffff", color='red')
ctx.add_basemap(ax, source=ctx.providers.Stamen.TonerLite, crs="EPSG:4326", alpha=.3)
import pandas as pd
import geopandas as gpd
df = pd.DataFrame(coordinates_data)
gdf = gpd.GeoDataFrame(df, geometry=gpd.points_from_xy(df.longitude, df.latitude, crs="EPSG:4326"))
gdf
import pynmea2
nmea_data = open("data/gps_data_20220215-070028.nmea", "rb")
coordinates_data = []
for message_bytes in nmea_data.readlines():
try:
message = message_bytes.decode("utf-8").replace("\n", "").replace("\r", "")
parsed_message = pynmea2.parse(message)
import pynmea2
nmea_data = open("data/gps_data_20220215-070028.nmea", "rb")
for message_bytes in nmea_data.readlines()[:10]: # read first 10 messages from file
try:
message = message_bytes.decode("utf-8").replace("\n", "").replace("\r", "")
parsed_message = pynmea2.parse(message)
except:
# skip invalid messages
continue
import serial
import datetime
ser = serial.Serial("/dev/cu.usbserial-0001", baudrate=9600)
ser.flushInput()
ser.flushOutput()
idx = 0
nmea_data = b""
@maxim75
maxim75 / a
Last active October 27, 2015 22:50
bbb
import datetime
import exifread
import glob
import sys
import os
import shutil
import fractions
import pyexiv2
from geopy.distance import vincenty
@maxim75
maxim75 / README.md
Created August 6, 2015 01:58
HTML5 start template

Readme

@maxim75
maxim75 / gist:2785815
Created May 25, 2012 04:45
OpenLayers.mobile.js
/*
OpenLayers.js -- OpenLayers Map Viewer Library
Copyright (c) 2006-2012 by OpenLayers Contributors
Published under the 2-clause BSD license.
See http://openlayers.org/dev/license.txt for the full text of the license, and http://openlayers.org/dev/authors.txt for full list of contributors.
Includes compressed code under the following licenses:
test