<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ca">
	<id>http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=Projecte_ProgessiveMaps</id>
	<title>Projecte ProgessiveMaps - Historial de revisió</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=Projecte_ProgessiveMaps"/>
	<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Projecte_ProgessiveMaps&amp;action=history"/>
	<updated>2026-08-30T09:22:29Z</updated>
	<subtitle>Historial de revisió per a aquesta pàgina del wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://wiki.joanillo.org/index.php?title=Projecte_ProgessiveMaps&amp;diff=259368&amp;oldid=prev</id>
		<title>Joan: /* Funcionalitats */</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Projecte_ProgessiveMaps&amp;diff=259368&amp;oldid=prev"/>
		<updated>2020-04-26T23:23:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Funcionalitats&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pàgina nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__TOC__&lt;br /&gt;
=Introducció=&lt;br /&gt;
(TBD)&lt;br /&gt;
2 modes:&lt;br /&gt;
*mode SDK, per definir i configurar el mapa.&lt;br /&gt;
*mode Render, per fer funcionar el mapa en una línia de temps.&lt;br /&gt;
=Funcionalitats=&lt;br /&gt;
(TBD)&lt;br /&gt;
*App1. Definim una sèrie de punts sobre el mapa. Sobre aquests punts posem un marker. L'últim punt el fem amb doble click. Seguidament, es traça la spline que millor s'ajusta als punts.&lt;br /&gt;
*App2. Interpolació d'àrees tancades. Donada una sèrie de punts que defineixen una àrea, interpolar amb més punts tota aquesta àrea. Pintar l'area.&lt;br /&gt;
*App3. Donada una àrea petita i una àrea grossa, interpolar les dues àrees de manera que l'àrea petita s'expandeixi a l'àrea grossa. [https://openlayers.org/en/latest/examples/draw-and-modify-features.html]&lt;br /&gt;
*App4. Donats una sèrie de punts (Markers), omplir-los de forma seqüencial amb un delay de temps. [https://openlayers.org/en/latest/examples/dynamic-data.html][https://openlayers.org/en/latest/examples/feature-animation.html][https://openlayers.org/en/latest/examples/feature-move-animation.html]&lt;br /&gt;
*App5. Donada una sèrie de labels, omplir-los de forma seqüencial amb un delay de temps.&lt;br /&gt;
*App6. Fer zoom i centrar en un punt. Controlar el temps amb què es viatja cap al zoom. ([https://openlayers.org/en/latest/examples/animation.html])&lt;br /&gt;
*App7: distingir click, double click, alt-click, hover sobre el mapa [https://openlayers.org/en/latest/examples/select-features.html]&lt;br /&gt;
*App8: carregar una imatge com a mapa [https://openlayers.org/en/latest/examples/static-image.html][https://openlayers.org/en/latest/examples/wms-custom-proj.html]&lt;br /&gt;
*App9: mapa físic sense labels [https://www.arcgis.com/home/webmap/viewer.html?webmap=3b26766ef1cb476bada969e6c251f3d2]&lt;br /&gt;
*App10: Botons, custom controls [https://openlayers.org/en/latest/examples/custom-controls.html]&lt;br /&gt;
*App11: Imatges satèl·lit [https://openlayers.org/en/latest/examples/full-screen-drag-rotate-and-zoom.html][https://openlayers.org/en/latest/examples/bing-maps.html]&lt;br /&gt;
&lt;br /&gt;
=Aplicacions unitàries=&lt;br /&gt;
Abans de posar-ho tot conjuntament, totes les funcionalitats es provaran en unes aplicacions unitàries.&lt;br /&gt;
==App1==&lt;br /&gt;
Primer havia pensat de fer servir la llibreria ''cubic-spline'' que s'explica més avall. Però aquest problema de suavitzar segments ja està resolt a ''Smoothing lines using Chaikins algorithm'':&lt;br /&gt;
*https://openlayers.org/en/latest/examples/chaikin.html&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ npm instal chaikin-smooth&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*[[Exemples_Openlayers_(ol_package)#Smoothing_lines_using_Chaikins_algorithm]]&lt;br /&gt;
&lt;br /&gt;
=Llibreries=&lt;br /&gt;
==cubic-spline==&lt;br /&gt;
'''NOTA''': no cal. suavitzar segments està resolt a [https://openlayers.org/en/latest/examples/chaikin.html], que és exactament el que jo vull.&lt;br /&gt;
&lt;br /&gt;
Donats una sèrie de punts, vull augmentar la resolució entre els punts obtenint una línia suavitzada.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /projectes/ProgressiveMaps&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Projecte '''cubic-spiline''':&lt;br /&gt;
*https://www.npmjs.com/package/cubic-spline&lt;br /&gt;
*https://github.com/morganherlocker/cubic-spline&lt;br /&gt;
This is helpful for smoothing line graphs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git clone https://github.com/morganherlocker/cubic-spline.git&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Depèn d'un paquet que es diu ''tape'':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ npm install tape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I ja funciona:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ npm test&lt;br /&gt;
&amp;gt; node test.js&lt;br /&gt;
&lt;br /&gt;
TAP version 13&lt;br /&gt;
# spline&lt;br /&gt;
ok 1 should be equal&lt;br /&gt;
ok 2 should be equal&lt;br /&gt;
ok 3 should be equal&lt;br /&gt;
ok 4 should be equal&lt;br /&gt;
ok 5 should be equal&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Faig la modificació '''test2.js''' per tal d'obtenir un codi mínim que funcioni i que es vegi com es suavitza una corba:&lt;br /&gt;
*script '''test2.js''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
const Spline = require(&amp;quot;./&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
const xs = [1, 2, 3, 4, 5];&lt;br /&gt;
const ys = [9, 3, 6, 2, 4];&lt;br /&gt;
&lt;br /&gt;
// new a Spline object&lt;br /&gt;
const spline = new Spline(xs, ys);&lt;br /&gt;
&lt;br /&gt;
//comprovació&lt;br /&gt;
console.log(spline.at(1));&lt;br /&gt;
console.log(spline.at(2));&lt;br /&gt;
&lt;br /&gt;
// interpolate a line at a higher resolution&lt;br /&gt;
for (var i = 0; i &amp;lt; 50; i++) {&lt;br /&gt;
  console.log(i/10 + &amp;quot; &amp;quot; + spline.at(i * 0.1));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ node test2.js&lt;br /&gt;
&lt;br /&gt;
9&lt;br /&gt;
3&lt;br /&gt;
0 14.999999999999998&lt;br /&gt;
0.1 14.916053571428568&lt;br /&gt;
0.2 14.669142857142853&lt;br /&gt;
0.3 14.277375&lt;br /&gt;
0.4 13.758857142857144&lt;br /&gt;
0.5 13.131696428571427&lt;br /&gt;
0.6 12.414&lt;br /&gt;
0.7 11.623874999999998&lt;br /&gt;
0.8 10.779428571428571&lt;br /&gt;
0.9 9.898767857142857&lt;br /&gt;
1 9&lt;br /&gt;
1.1 8.101232142857143&lt;br /&gt;
1.2 7.220571428571427&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
El mòdul ''tape'' té a veure amb el testing. No el necessitem si no fem testing.&lt;br /&gt;
&lt;br /&gt;
En teoria, per instal·lar la llibreria és:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ npm install cubic-spline&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
però en aquests moments (abril 2020) no està disponible en els repositoris. Tant se val, perquè n'hi ha prou en incloure el fitxer del projecte on es defineix la classe ''Spline'', en aquest cas ''index.js''.&lt;br /&gt;
&lt;br /&gt;
{{Autor}}, abril 2020&lt;/div&gt;</summary>
		<author><name>Joan</name></author>
		
	</entry>
</feed>