Giter VIP home page Giter VIP logo

quickgrid's Introduction

quickgrid

When using a gridded printed map on the field, this quick app tells you the grid square or the location in kilometers on a parcours where you are currently standing.

Demo :

Screenshot

where

  • D7b is the grid square of the map where you are currently standing
  • 1.5 km is the kilometric index where you are currently standing

Usage :

  • to create the grid / parcours :

    • go to [url]
    • use 'Créer grille : créer', 'Créer parcours' ou 'Importer parcours'
    • draw the grid or the parcours
    • click on 'Partager' to show the url & QR-code
  • to know your current location :

    • enable geolocation
    • open the url, eg. [url]?scr,0,bea,del,LAT,LNG,Nx,Ny,invxy,revy

Where

  • scr is the reference coordinate system (available options : 31370 : Lambert 72), or 0 for local TMercator
  • 0 is currently not used
  • del is the grid square length in meters
  • bea is the map azimuth in degrees
  • LAT,LNG are the WGS84 coordinates of the origin of the local TMercator coordinates system
  • Nx is the number of squares in X direction (horizontal)
  • Ny is the number of squares in Y direction (vertical)
  • invxy : if 0, use letters in x and figures in y. if 1, use figures in x and letters in y
  • revy : if 0, y coordinates is from top to bottom, if 0 from bottom to top
  • bm : the basemap to use (among the available basemaps)

The graphical user interface only allow to produces a grid in TMercator, with letters in x and figures in y (from top to bottom). But you may tweak the link afterwards.

Full example : https://grid.my-poppy.eu/?31370,0,100,0,50.45019,5.95576,18,27,0,0

To use it operationnally

  • the x0, y0,delta,bearing should correspond to your printed map

  • x0,y0,delta,bearing,X0,Y0,Nx,Ny are generated by drawing a rectangle using [url]

  • you could send the link to your personnel by SMS/Whatsapp/...

  • or display it as a QR code

  • ideally, they can store the link on their smartphone home screen to use it when they need it

Enjoy !

Credits :

  • font-awesome-4.7.0
  • Leaflet.EasyButton-1.1.1
  • leaflet-1.3.1 (fork from va2ron1 2018-04-06)
  • Leaflet.Omnivore-0.3.3
  • Proj4Leaflet-0.7.0
  • hammer-2.0.8.js
  • jquery-2.1.1
  • tokml.js
  • download2.js

Contact: [email protected]

Presented @ FOSS4G-FR 15-17/5/2018 @ ENSG Paris

in Leaflet, modification of the toGeoJSON function, to also export the names of the elements :

LH.toGeoJSON = function (precision) {
    ...
    this.eachLayer(function (layer) {
        if (layer.toGeoJSON) {
            var json = layer.toGeoJSON(precision);        
            /*THIS SHOULD BE ADDED ->*/ if (layer.options.name != null) if (layer.options.name != '')  json.properties.name =  layer.options.name
             ...

to patch the minified code :

var o=i.toGeoJSON(t);

should be replaced by

var o=i.toGeoJSON(t); if(i.options.name!=null) if(i.options.name!='') o.properties.name=i.options.name;

quickgrid's People

Contributors

ccloquet avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

quickgrid's Issues

dessin de la grille plus facile/intuitif

actuellement, il faut indiquer la taille d'un carré
-> garder cette possibilité, mais aussi rpévoir qqch de plus visuel (ex : dessiner le carré, indiquer la taille [par paliers] et un curseur pour ajuster le nombre ?)

Parcours

make the same with a parcours -> dessiner le parcours avec des pts, indiquer l'unité, déviation : +/- 100 m de chaque côté du parcours -> indique où je suis en km

Pouvoir afficher l'adresse

-> Avec Nominatim
-> Pas en continu, car sinon trop de requêtes au serveur OSM (ou alors pourrait être en local sur mon serveur)

transmit geoloc on demand / in real time

This requires a more complicated infrastructure / code

Possibility 1 : P2P GEOLOC TRANSMISSION

       <script src="https://cdnjs.cloudflare.com/ajax/libs/peerjs/0.3.9/peer.min.js"></script>

	// p2p broker should be hosted by poppy
	// distinguish between boss & slave in the url (like for doodle)
	// therefore, the url contains : a maphasp (+ a mapcode if boss)
	// verify if boss : hash(code) = maphash
	// code not guessable by slave
	//
	// problem : using maphash as peerid, a slave can impersonate the master
        // issue bcz it would prevent the real master to access the data
        // otherwize data might be shared, but with p2p, this would require a network with O(N²) links...
        // -> problem : not scalable
	var maphash   		= null
	var mapcode   		= null

	var peerjs_apikey 	= 'kjhlkjhlkjh'

	// if i am a boss :
	var peer        	= new Peer(maphash, {key: peerjs_apikey});
 
	peer.on('connection', function(conn) 
	{ 
		conn.on('open', function() 
		{
			conn.on('data', function(data) 
			{
				console.log('Received', data);
				// put data on map (with indication of date/time)
				// make it disappear after a while
			});
		}); 
	});

	// if i am a slave & I push on a button
	function send_position()
	{
		var rand = Date.now() +''+ Math.random()
		var peer = new Peer(maphash + rand, {key: peerjs_apikey});
		var conn = peer.connect(maphash)

		conn.on('open', function() 
		{
			conn.send(JSON.stringify(current_coords));
			peer.destroy()
		});
	}
	$('#btn-send-position').on('click', send_position)

Possibility 2:

  • send data to server, using ajax
  • then the server reflects the data through SSE (the js would subscribe to the SSE events)

-> this needs :

  • a server with a listening script

  • a memcache to share the received data

  • a SSE script

  • server records in sqlite (low traffic, simple)

-> the customers are isolated through their mapid

Possibility 3:

Use Twilio Sync, PubNub, ... to synchronize state through all the members of a
-> requires payment / apikey -> administration ...

Possibility 4:

Using a decentralized internet solution
-> to explore

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.