20 Nov

Hey,

Today a bit of trSIGonometry with this function to compute the angle/orientation/direction between 2 points of a GPX file.

```############################ #Function ############################   angle <- function(pt1, pt2) { conv = 180 / pi # conversion radians / degrees diff <- pt2 - pt1 diff.abs <- abs(diff) if (diff[1]>=0 & diff[2]>=0){angle <- pi/2 - atan(diff.abs[2] / diff.abs[1])} if (diff[1]>=0 & diff[2]<=0){angle <- pi/2 + atan(diff.abs[2] / diff.abs[1])} if (diff[1]<=0 & diff[2]>=0){angle <- 3*pi/2 + atan(diff.abs[2] / diff.abs[1])} if (diff[1]<=0 & diff[2]<=0){angle <- pi + (pi/2- atan(diff.abs[2] / diff.abs[1]))} return(angle * conv) }   ############################ #Script ############################   library(rgdal) library(raster) library(data.table)   #Set folder setwd("/home/GuruBlard/gpx/")   # Load file names filenames <- list.files(pattern=".gpx\$")   # Iteration through all gpx files for (filename in filenames){ # Load the GPX   #ogrListLayers("export.gpx") gpx.trackpoints <- readOGR(dsn = filename, layer= "track_points", stringsAsFactors = F)   # Extract the coordinates as a matrix: gpx.tp <- coordinates(gpx.trackpoints)   # #Loop through and add angle - the difference between the of the current point and the following one: for (tp in 1:(nrow(gpx.tp)-1)) { gpx.trackpoints\$angle[tp] <- angle(gpx.tp[tp,], gpx.tp[tp+1,]) }   gpx.trackpoints@data\$Date <- substr(as.character(gpx.trackpoints@data\$time), 1,10) gpx.trackpoints@data\$Hour <- substr(as.character(gpx.trackpoints@data\$time),12,19) gpx.trackpoints@data\$filename <- filename writeOGR(gpx.trackpoints, paste0(tools::file_path_sans_ext(filename), ".shp"), layer=tools::file_path_sans_ext(filename), driver="ESRI Shapefile") }```

18 Nov

Hi there,

MultiEdit lets you to easily edit any existing field in the attribute table of a shapefile for the selected features.

22 Oct

With QGIS, you can now conncet to an ESRI GDB through the ‘Add vector layer’ tool.
Just select the properties as specified on the figure below.

13 Oct

Two useful pluginsĀ in Qgis for data visualization with Google Earth/Maps (amongst others):

OpenLayers Plugin

OpenLayers Plugin allows to add OpenStreetMap, Google Maps, Bing Maps, MapQuest layers and more as a basemap.

GEarthView

GEarthView plugin displays QGis view and features with attributes (taken from the selected layer) into Google Earth – tested on Windows, MacOSX and some Ubuntu Linux… (of course, GoogleEarth need to be installed).