├── .gitignore ├── 12 - 58 - 35.png ├── 13 - 2 - 19.png ├── 13 - 45 - 56.png ├── Box.pde ├── Functions.pde ├── Processing_GPXMapMosaic.pde ├── README.md ├── Route.pde └── data └── 20161021-091658-Run.gpx /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | applet 3 | application.linux32 4 | application.linux64 5 | application.windows32 6 | application.windows64 7 | application.macosx 8 | -------------------------------------------------------------------------------- /12 - 58 - 35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feltron/Processing_GPXMapMosaic/7c8692649b0345bc7da98cc55d7ed903d880b059/12 - 58 - 35.png -------------------------------------------------------------------------------- /13 - 2 - 19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feltron/Processing_GPXMapMosaic/7c8692649b0345bc7da98cc55d7ed903d880b059/13 - 2 - 19.png -------------------------------------------------------------------------------- /13 - 45 - 56.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feltron/Processing_GPXMapMosaic/7c8692649b0345bc7da98cc55d7ed903d880b059/13 - 45 - 56.png -------------------------------------------------------------------------------- /Box.pde: -------------------------------------------------------------------------------- 1 | 2 | // - - - - - - - - - - - - - - - - - - - - - - - 3 | // BOX 4 | // - - - - - - - - - - - - - - - - - - - - - - - 5 | 6 | class Box { 7 | color c = color(random(70, 100), random(80, 100), random(70, 90)); 8 | int index, count; 9 | String latlon; 10 | float posX, posY; 11 | 12 | Box(int index_, String latlon_, int count_) { 13 | index = index_; 14 | latlon = latlon_; 15 | count = count_; 16 | } 17 | 18 | void display() { 19 | noStroke(); 20 | fill(c); 21 | posX = index%mosaicCount*boxSize; 22 | posY = index/mosaicCount*boxSize; 23 | rect(posX, posY, boxSize, boxSize); 24 | //println("Box: " + index + " / " + index%mosaicCount + " / " + index/mosaicCount); 25 | fill(100); 26 | textAlign(LEFT); 27 | //float[] latlonTrim = float(latlon.split(",")); 28 | //String boxLocation = int(latlonTrim[0]*100)/100.0 + ", " + int(latlonTrim[1]*100)/100.0; 29 | text(locationIndexNames[index], posX+boxMargin, posY+boxSize-boxMargin); 30 | textAlign(RIGHT); 31 | if (count == 1) { 32 | text(count + " Run", posX+boxSize-boxMargin, posY+boxSize-boxMargin); 33 | } else { 34 | text(count + " Runs", posX+boxSize-boxMargin, posY+boxSize-boxMargin); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Functions.pde: -------------------------------------------------------------------------------- 1 | 2 | // - - - - - - - - - - - - - - - - - - - - - - - 3 | // FUNCTIONS 4 | // - - - - - - - - - - - - - - - - - - - - - - - 5 | 6 | void importData() { // import all files from directory 7 | java.io.File folder = new java.io.File(dataPath("")); 8 | String[] allFilenames = folder.list(); 9 | println(allFilenames); 10 | // Remove .DS_Store 11 | if (allFilenames[0].equals(".DS_Store")) { 12 | println("removing"); 13 | filenames = new String[allFilenames.length-1]; 14 | for (int i=1; ij && lat[0]j && lon[0](); 143 | locationKeys = locations.keyArray(); 144 | locationAmounts = locations.valueArray(); 145 | for (int i=0; i(); 154 | for (int i=0; i BoxList; 37 | ArrayList RouteList; 38 | String[] locationKeys; 39 | int[] locationAmounts; 40 | 41 | // Draw 42 | float locationGranularity = 0.15; 43 | int boxMargin = 10; 44 | int mosaicCount; 45 | float boxSize; 46 | 47 | // GeoCoding 48 | XML geoXML; 49 | int millisecondDelay = 500; // BE POLITE. 50 | 51 | 52 | // - - - - - - - - - - - - - - - - - - - - - - - 53 | // SETUP 54 | // - - - - - - - - - - - - - - - - - - - - - - - 55 | void setup() { 56 | size(1000, 1000); 57 | colorMode(HSB, 100); 58 | background(30); 59 | importData(); 60 | buildLocationIndex(); 61 | geocodeLocationIndex(); 62 | buildBoxes(); 63 | buildRoutes(); 64 | } 65 | 66 | 67 | // - - - - - - - - - - - - - - - - - - - - - - - 68 | // DRAW 69 | // - - - - - - - - - - - - - - - - - - - - - - - 70 | void draw() { 71 | surface.setTitle(int(frameRate) + " fps / " + frameCount + " frames"); 72 | // Draw Mosaic 73 | for (int i=0; i"); 43 | elevation[i] = float(s4[1]); 44 | //println(i + " / " + track.length); 45 | //println("lat: " + lat[i] + " / lon: " + lon[i] + " / elevation: " + elevation[i]); 46 | } 47 | } 48 | 49 | // - - - - - - - - - - - - - - - - - - - - - - - 50 | 51 | void mapPoints() { 52 | // Find Mosaic Index 53 | for (int i=0; i