Skip to content

Instantly share code, notes, and snippets.

@fernandoc1
fernandoc1 / Makefile
Created December 22, 2016 17:13
Boost JSON property tree example
all:
g++ main.cpp -lboost_system
@fernandoc1
fernandoc1 / .vimrc
Last active December 26, 2016 16:46
This is my ~/.vimrc
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set ignorecase
set smartcase
@fernandoc1
fernandoc1 / CMakeLists.txt
Created January 23, 2017 15:29
GeniCam image grabbing with Pleora SDK on Ubuntu 16.04
cmake_minimum_required(VERSION 2.8.3)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -g3")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3 -fPIC")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC")
find_package(OpenCV 2.4 REQUIRED opencv_core opencv_highgui opencv_imgproc opencv_calib3d opencv_video opencv_features2d opencv_objdetect opencv_ocl)
set(PLEORA_BASE_DIR /opt/pleora/ebus_sdk/Ubuntu-14.04-x86_64/)
set(PLEORA_INCLUDE_DIR ${PLEORA_BASE_DIR}/include/)
@fernandoc1
fernandoc1 / Makefile
Created January 25, 2017 14:00
Example for using serializing and deserializing map with DLIB
all:
g++ main.cpp -ldlib -o Test
@fernandoc1
fernandoc1 / CMakeLists.txt
Last active February 3, 2017 15:40
QtWebKit bridge example for compiling on Ubuntu 16.04 with Qt5
cmake_minimum_required(VERSION 3.0)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
#find_package(Qt5Widgets)
#find_package(Qt5Network)
#find_package(Qt5WebkitWidgets)
#find_package(Qt5Concurrent)
@fernandoc1
fernandoc1 / README
Created July 17, 2017 14:42
This is a simple PHP code for caching Map Mapbox
The Mapbox example was taken from
https://www.mapbox.com/help/demos/openlayers/openlayers3.html
@fernandoc1
fernandoc1 / rotate_example.html
Created July 18, 2017 17:10
OpenLayers rotate polygon example
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>Geopointing</title>
<link rel="stylesheet" href="files/ol.css" type="text/css">
<script src="files/ol4.js"></script>
@fernandoc1
fernandoc1 / kml_linestring_loading.cpp
Created August 4, 2017 21:05
This code loads all linestring from a KML file, using libkml
#include <algorithm>
#include <iostream>
#include <kml/base/file.h>
#include <kml/dom.h>
#include <kml/engine.h>
#include <string>
#include <vector>
typedef std::vector<kmldom::LineStringPtr> LineStringVector;
@fernandoc1
fernandoc1 / openlayers_kml_plot.html
Created August 11, 2017 14:05
This code plots, lines, markers and loads KML files in OpenLayers.
<!DOCTYPE html>
<!-- Code from https://bootswatch.com/slate/ -->
<!-- Using OpenLayers version from https://github.com/mapgears/ol3-google-maps -->
<html ondragstart="return false;" ondrop="return false;" lang="pt" style="-webkit-user-select: none; user-select: none; cursor: default;">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>KML Load test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./css/bootstrap.css" media="screen">
<link rel="stylesheet" href="./css/custom.min.css">
@fernandoc1
fernandoc1 / geo_helper.cpp
Created August 11, 2017 18:10
This code calculates intersection between arcs in the sphere surface and between arcs and a route.
#include "geo_helper.hpp"
#include <cmath>
//It assumes radius as 1.
QVector3D GeoHelper::QGeoCoordinate2QVector3D(QGeoCoordinate coord)
{
double radlat = qDegreesToRadians(coord.latitude());
double radlon = qDegreesToRadians(coord.longitude());