tag:blogger.com,1999:blog-73173482160813920292024-02-10T00:32:23.169-08:00Things I doJonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-7317348216081392029.post-76661592485447155902021-01-05T00:58:00.006-08:002021-01-05T08:21:11.837-08:00 A new release of nsnstrace<p><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">During the holidays I managed to get some time to hack on </span><a href="https://github.com/nsntrace/nsntrace/" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; text-decoration-line: underline; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;">nsntrace</span></a><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">. I have </span><a href="http://jonasdn.blogspot.com/2016/07/getting-network-trace-from-single.html" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; text-decoration-line: underline; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;">mentioned nsntrace on this blog</span></a><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> in the past but you might need a refresher:</span></p><p><span style="font-family: Arial; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">The </span><span style="background-color: white; color: #24292e; font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">nsntrace application uses Linux network namespaces and iptables magic to perform network traces of a single application. The traces are saved as pcap files and can be analyzed by for instance wireshark or tshark</span></p><span id="docs-internal-guid-497b79c7-7fff-25d0-97bf-ef74428792d8"><div><br /></div><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: white; color: #24292e; font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">In May of 2020 nsntrace moved to a collaborative maintenance model and to its own </span><a href="https://github.com/nsntrace/" style="text-decoration-line: none;"><span style="background-color: white; color: #1155cc; font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; text-decoration-line: underline; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;">GitHub organisation</span></a><span style="background-color: white; color: #24292e; font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">. This helped a lot with my guilt for neglecting its maintenance. We even managed to get some pull requests merged and some issues solved.</span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: white; color: #24292e; font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVFwVJ8euVXK0LrQ_uAmM4ujsVtQpBUNnpTGLaRR9zdOckirWU1oXbRk4vmBRLco844vfKNZBzuNvtm89d-uBwJ_N-xYioHRHWElqxq9sWnSjo4bwQwqkytEDH7_NKbIj3EV4-AHEMG7Kq/s695/org.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="262" data-original-width="695" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVFwVJ8euVXK0LrQ_uAmM4ujsVtQpBUNnpTGLaRR9zdOckirWU1oXbRk4vmBRLco844vfKNZBzuNvtm89d-uBwJ_N-xYioHRHWElqxq9sWnSjo4bwQwqkytEDH7_NKbIj3EV4-AHEMG7Kq/s320/org.png" width="320" /></a></div><br /><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: white; color: #24292e; font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">For the new release we landed some notable pull requests.</span></p></span><h2 style="text-align: left;"><br /></h2><h2 style="text-align: left;"><span style="color: #1155cc;"><a href="https://github.com/nsntrace/nsntrace/pull/33" style="font-family: Arial; font-size: 16pt; font-weight: normal; white-space: pre-wrap;">Handle loopback nameservers</a></span></h2><span><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">On many systems the nameserver functionality is handled by an application such as </span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">systemd-resolved</span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> or </span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">dnsmasq</span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> and the nameserver address in </span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">resolv.conf</span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> is a loopback address (like 127.0.0.53) where that application listens for incoming DNS queries.</span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">This would not work for us since the network namespace we create has its own separate loopback device and cannot reach the one where </span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">systemd-resolved </span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">or </span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">dnsmasq</span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> listens. If somebody reading this has a solution to this problem, please let us know in the comments or via GitHub!</span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">What we ended up doing were </span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">two </span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">things. First we added a warning output for when we detect only loopback nameservers. And second we offer a new </span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">--use-public-dns</span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> command line option to override the system resolv.conf in our namespace.</span></p><br />
<!--HTML generated using hilite.me--><div style="background-attachment: scroll; background-color: white; background-image: none; background-position: 0% 0%; background: none 0% 0% repeat scroll rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: medium solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #996633;">$ </span>sudo ./src/nsntrace ping lwn.net
Warning: only loopback <span style="color: #333333;">(</span>127.x.y.z<span style="color: #333333;">)</span> nameservers found.
This means we will probably not be able to resolve hostnames.
Consider passing --use-public-dns to use public nameservers.
Starting network trace of <span style="background-color: #fff0f0;">'ping'</span> on interface wlp58s0.
Your IP address in this trace is 172.16.42.255.
Use ctrl-c to end at any time.
</pre></div>
<div align="left" dir="ltr" style="margin-left: 0pt;"><br /></div><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">In order to have our own nameservers for our network namespace we will </span><a href="https://unix.stackexchange.com/a/198591" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; text-decoration-line: underline; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;">bind mount </span></a><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">our own resolv.conf file, with public nameservers from Cloudflare, OpenDNS and Quad9, over the one in /etc/resolv.conf.</span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">But we do not want to affect other applications outside of our namespaced application, so we enter a </span><a href="https://lwn.net/Articles/689856/" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; text-decoration-line: underline; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;">mount namespace</span></a><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> (CLONE_NEWNS) before we do the bind mount.</span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">This, however, is not enough. Before the bind mount we need to remount the root partition with special mount flags to make sure our changes to the subtree are not propagated to the outside mount namespace.</span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">This is basically how the </span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">ip-netns</span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> tool allows for namespace specific nameservers as well.</span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><br /></p></span><h2 style="text-align: left;"><span style="font-weight: normal;"><a href="https://github.com/nsntrace/nsntrace/pull/29"><span><div>Treat lone dash ("-") output filename as stdout</div></span></a></span></h2><span><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">This started as an </span><a href="https://github.com/nsntrace/nsntrace/issues/24" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; text-decoration-line: underline; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;">issue</span></a><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> from a user that reported:</span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: white; color: #24292e; font-family: Arial; font-size: 10.5pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">I am using nsntrace to dump and analyze a processes network traffic in real time. In order to do that, I need to get the network dump piped to another process, not written to a file.</span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: white; color: #24292e; font-family: Arial; font-size: 10.5pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></p><div style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;"><span style="background-color: white; color: #24292e; font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">The user requested that nsntrace followed the convention of treating a lone dash (‘-’) as filename to mean output to stdout. As an aside, does anyone know where that convention originated?</span></div><div style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;"><span><span style="color: #24292e; font-family: Arial;"><span style="background-color: white; caret-color: rgb(36, 41, 46); white-space: pre-wrap;"><br /></span></span></span><span style="background-color: white; color: #24292e; font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">We got this implemented and we made sure to write all non-pcap output to stderr in the case of a lone dash filename being detected. We also made sure that the application under trace behaves by replacing its stdout file descriptor with stderr, using the </span><a href="https://man7.org/linux/man-pages/man2/dup.2.html" style="text-decoration-line: none;"><span style="background-color: white; color: #1155cc; font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; text-decoration-line: underline; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;">dup2 syscall</span></a><span style="background-color: white; color: #24292e; font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">.</span><span><br /></span><span style="background-color: white; color: #24292e; font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">This change enables us to do live packet capture using tshark.</span></div></span><span><br />
<!--HTML generated using hilite.me--><div style="background-attachment: scroll; background-color: white; background-image: none; background-position: 0% 0%; background: none 0% 0% repeat scroll rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: medium solid gray; overflow: auto; padding: 0.2em 0.6em; text-align: left; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #996633;">$ </span>sudo nsntrace -o - wget lwn.net | tshark -r - -Y <span style="background-color: #fff0f0;">'http.response or http.request'</span>
13 0.467670 172.16.42.254 → 239.255.255.250 SSDP 214 M-SEARCH * HTTP/1.1
16 0.541178 172.16.42.255 → 66.228.47.22 HTTP 200 GET / HTTP/1.1
20 0.747923 66.228.47.22 → 172.16.42.255 HTTP 448 HTTP/1.1 302 Moved Temporarily <span style="color: #333333;">(</span>text/plain<span style="color: #333333;">)</span>
41 1.468987 172.16.42.254 → 239.255.255.250 SSDP 214 M-SEARCH * HTTP/1.1
71 2.472515 172.16.42.254 → 239.255.255.250 SSDP 214 M-SEARCH * HTTP/1.1
</pre></div>
<div align="left" dir="ltr" style="margin-left: 0pt;"><br /></div></span><h2 style="text-align: left;"><a href="https://github.com/nsntrace/nsntrace/pull/31"><span style="font-weight: normal;"><span><div align="left" dir="ltr" style="margin-left: 0pt;">Give the network namespace a name</div></span></span></a></h2><span><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">To give a network namespace a name in the eyes of tools like</span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><a href="https://man7.org/linux/man-pages/man8/ip-netns.8.html" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; text-decoration-line: underline; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;">ip-netns</span></a><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> we need to bind mount </span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">/proc/<pid>/net/ns/ </span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">to</span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> /run/netns/NAME</span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">. It is described in the man page of </span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">ip-netns</span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">:</span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">By convention a named network namespace is an object at /run/netns/NAME that can be opened. The file descriptor resulting from opening /run/netns/NAME refers to the specified network namespace. Holding that file descriptor open keeps the network namespace alive. The file descriptor can be used with the setns(2) system call to change the network namespace associated with a task.</span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">By implementing this, the nsntrace network namespace will show up when we use </span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">ip-netns.</span></p><br />
<!--HTML generated using hilite.me--><div style="background-attachment: scroll; background-color: white; background-image: none; background-position: 0% 0%; background: none 0% 0% repeat scroll rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: medium solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #996633;">$ </span>ip netns list
nsntrace-128411
</pre></div>
<div align="left" dir="ltr" style="margin-left: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br />And we might even use </span><span style="font-family: Arial; font-size: 12pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">ip-netns </span><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">to enter the same network namespace as a running nsntrace process.</span></div><div align="left" dir="ltr" style="margin-left: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div><div align="left" dir="ltr" style="margin-left: 0pt;"><span style="font-family: Arial; font-size: 12pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"></span><h2 style="text-align: left;"><a href="https://github.com/nsntrace/nsntrace/pull/30"><span style="font-weight: normal;"><span>Creating a Snap package of nsntrace<br /></span></span></a></h2></div></span><span><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">By adding a </span><span style="font-family: Arial; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">snapcraft.yaml </span><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">file we enable building a </span><a href="https://snapcraft.io/docs" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; text-decoration-line: underline; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;">snap package</span></a><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> of nsntrace and adding it to the </span><a href="https://snapcraft.io/" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; text-decoration-line: underline; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;">snapcraft app store</span></a><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">. Which might mean more people can find nsntrace, and that the maintenance team get a bit more control of distribution of nsntrace.</span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br /></span></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Thanks for reading! And check out the new </span><span style="color: #1155cc; font-family: Arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; text-decoration-line: underline; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;"><a href="https://github.com/nsntrace/nsntrace/releases/tag/v4" style="text-decoration-line: none;">release!</a></span></p><div><br /></div></span>Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com0tag:blogger.com,1999:blog-7317348216081392029.post-32627446802482725622020-10-22T10:29:00.005-07:002020-11-12T23:36:26.240-08:00Proposal to add build graph output to GNU Make<h4 style="text-align: left;">Background</h4><p style="text-align: left;">In 2015 I worked as a consultant at a large company in Lund. My position was with the <i>build</i> team and one of our responsibilities was managing and maintaining the build system for their Android based phones.</p><p>The problem I was tasked with solving was the fact that running 'make' for a product after a successful build resulted in a lot of stuff being rebuilt unnecessarily.</p><p>A stock Android build tree behaved nicely: a second run of 'make' only produced a line about everything being up-to-date. But the company products were taking a good 15 minutes for a rebuild even if nothing had been changed.</p><p>The Android build system works by including all recipes to be built (programs / libraries / etc) using the GNU Make include directive, so that you end up with one giant Makefile that holds all rules for building the platform. Possibly to avoid the problems laid out in the paper <i><a href="https://embeddedartistry.com/blog/2017/04/10/recursive-make-considered-harmful/">Recursive make considered harmful</a>.</i></p><p>As you can imagine this results in quite a large Makefile that is near impossible to debug. To help us out GNU Make has an option that helps you figure out what is going on with every decision it makes:</p><p></p><blockquote>-p, --print-data-base Print make's internal database.</blockquote><p>This is very powerful and lets you investigate a lot about what Make is doing. It may be a bit too powerful though. It is a lot of information to digest. You can see example output from when I run it against the project from my last <a href="https://jonasdn.blogspot.com/2020/08/getting-to-know-risc-v-through-hifive1.html">blog post</a>, <i>riscv-asm-hello-morse </i>in a gist <a href="https://gist.github.com/jonasdn/0602fbd1ea63311ec40aad6d2a7269b3">here.</a></p><p>The bugs we found and the fixes we implemented were mostly about targets depending on non-existing files or depending on <a href="https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html">phony targets.</a> The fixes were almost never the hard part, it was finding the bugs that was hard.</p><p>Lately I have been working a bit with the <a href="https://www.yoctoproject.org/docs/2.1/yocto-project-qs/yocto-project-qs.html">Yocto build system</a> which uses <i>Bitbake </i>to build recipes. And Bitbake has a <i>-g</i> option to generate a dependency graph that lets you figure out why something was built.</p><p>I wondered if something similar could be made useful for GNU Make. So I attempted to implement it as:</p><blockquote><p> -g, --output-graph Output (dot) graph of modified targets for each goal.</p></blockquote><p>Here I might need to pause to inject that I am not the first person to have this idea:</p><p></p><ul style="text-align: left;"><li><b>In 2009</b> an anonymous user suggested XML output for Make's dependency graph: <a href="https://savannah.gnu.org/bugs/?func=detailitem&item_id=25751">https://savannah.gnu.org/bugs/index.php?25751</a><br /><br /></li><li><b>In 2016</b> user Yuri proposed something similar: <a href="https://savannah.gnu.org/bugs/?func=detailitem&item_id=47308">https://savannah.gnu.org/bugs/index.php?47308</a><br /><br /></li><li><b>In 2019 </b>user<b> </b>Shlomi Fish brought it up again: <span style="color: #0000ee;"><u><a href="https://savannah.gnu.org/bugs/index.php?56204">https://savannah.gnu.org/bugs/index.php?56204</a></u></span></li></ul><div><br />And I am sure I am missing more submissions.</div><p></p><p>In my defense my approach is a bit different. I only want to include targets that have been updated from <a href="https://www.gnu.org/software/make/manual/html_node/Goals.html">Make goals </a>that have changed, which will trim the graph quite a bit. It is not an attempt to show the information from <i>--print-database</i> in a new way.</p><h4 style="text-align: left;">Example 1</h4><div>If I use my proposal to generate a graph from the riscv project mentioned above:</div><div><br /></div><div></div><blockquote><div>$ make -g</div><div><div>riscv64-unknown-elf-as -march=rv32imac -mabi=ilp32 -g -o0 -c -o hello-morse.o hello-morse.S</div><div>riscv64-unknown-elf-as -march=rv32imac -mabi=ilp32 -g -o0 -c -o wait.o wait.S</div><div>riscv64-unknown-elf-as -march=rv32imac -mabi=ilp32 -g -o0 -c -o led.o led.S</div><div>riscv64-unknown-elf-as -march=rv32imac -mabi=ilp32 -g -o0 -c -o morse.o morse.S</div><div>riscv64-unknown-elf-ld hello-morse.o wait.o led.o morse.o -m elf32lriscv -nostartfiles -nostdlib -Thello-morse.lds -o hello-morse.elf</div><div>riscv64-unknown-elf-objcopy -O ihex hello-morse.elf hello-morse.hex</div><div><b>make: Writing dependency graph to '/home/jonas/sandbox/riscv/riscv-asm-hello-morse/all.dot'</b></div></div></blockquote><div><div></div><div>The last line here (my bold) is new and added by my patch. If we now look at the graph generated by this build.</div></div><div></div><blockquote><div></div></blockquote><blockquote><blockquote><div>$ cat all.dot</div><div>strict digraph "all" {</div><div> "hello-morse.elf" -> "hello-morse.o" </div><div> "hello-morse.elf" -> "wait.o" </div><div> "hello-morse.elf" -> "led.o" </div><div> "hello-morse.elf" -> "morse.o" </div><div> "hello-morse.hex" -> "hello-morse.elf" </div><div> "all" -> "hello-morse.hex" </div><div> "all"</div><div>}</div></blockquote></blockquote><blockquote><div><div></div></div></blockquote><p>And we can generate a PNG from it:</p><p></p><blockquote>$ dot -Tpng all.dot -o all.png</blockquote><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQfmudhovl-B_3OJAZmFDiWIXYrAUGOGFs0P5PeoKcEkTY3U4HAcXl_ljzi1YnZDMHlIj6R2_rIKqkDNkWXjRdCvs9UEI9xs7IEP2u8wonTZ3Lg2nc9bsZ-qQIWGTxbups8Ob8N7hrfM8f/s598/all.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="347" data-original-width="598" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQfmudhovl-B_3OJAZmFDiWIXYrAUGOGFs0P5PeoKcEkTY3U4HAcXl_ljzi1YnZDMHlIj6R2_rIKqkDNkWXjRdCvs9UEI9xs7IEP2u8wonTZ3Lg2nc9bsZ-qQIWGTxbups8Ob8N7hrfM8f/s320/all.png" width="320" /></a></div><br /><p>And if I force a rebuild and re-generate the PNG:</p><div></div><blockquote><div>$ touch morse.S</div><div>$ make -g </div></blockquote><blockquote></blockquote><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHegLuKgycvBySnyTDrdR0omp8qyuaj95ZVAS2xIn5SE3qpqu3WvttTlEJZN9GCHKhTWESUkbYoHOcS7L0EB8ogkBVb8ru0fk-7ccruBb58WuxGKlQgXQok1SayJBO3QjYbVYFDg82Bunh/s347/all.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="347" data-original-width="236" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHegLuKgycvBySnyTDrdR0omp8qyuaj95ZVAS2xIn5SE3qpqu3WvttTlEJZN9GCHKhTWESUkbYoHOcS7L0EB8ogkBVb8ru0fk-7ccruBb58WuxGKlQgXQok1SayJBO3QjYbVYFDg82Bunh/s320/all.png" /></a></div><h4 style="text-align: left;"><br /><br />Example 2</h4><div>In my <a href="https://jonasdn.blogspot.com/2020/08/getting-to-know-risc-v-through-hifive1.html">last blog post</a> I mentioned the freedom-e-sdk used to build software for the hifive1-revb board. I noticed that it had the same problem as the Android based build system above, it always rebuilt on a second 'make' run.</div><div><br /></div><div>The graph for the second run looks like:<br /><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYEJf5Tnn1SXPTwwN1DFYywJv_jg2kBCt2s0zRCavKpcLtsrnATmeUaWU-wlnqtzpkbK6QynMBgkU-hP2SVzep8Ty3fsUbHnKvicAbgdwJ4_DcCjMNx5R6BwkR-s79JXBc_CHTMpbro-My/s1565/all.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="485" data-original-width="1565" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYEJf5Tnn1SXPTwwN1DFYywJv_jg2kBCt2s0zRCavKpcLtsrnATmeUaWU-wlnqtzpkbK6QynMBgkU-hP2SVzep8Ty3fsUbHnKvicAbgdwJ4_DcCjMNx5R6BwkR-s79JXBc_CHTMpbro-My/w622-h192/all.png" width="622" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><br /><div>Which helps us see that the build is forced because Make cannot find the <i>libmetal-pico.a</i> file. And looking at the Makefile we find that, yes, it does not check if the bsp support picolibc before depending on <i>libmetal-pico.a. </i>Fixing that will make rebuilding on the second 'make' run go away.</div><div><br /></div><h4 style="text-align: left;">Example 3</h4><div>If I want to track what happens on rebuild of the Make project itself I run into an issue.</div><blockquote><div>$ touch src/file.c</div><div>$ make -g</div></blockquote><div>The resulting <i>all.dot</i> file hardly contains any information about the rebuild:</div><div><blockquote><div>strict digraph "all" {</div><div> "all" -> "all-recursive" [label="forced: PHONY prerequisite"]</div><div> "all"</div><div>}</div></blockquote><div></div></div><div style="text-align: left;">The problem is that the <i>make</i> process is using <i>make </i>to build sub-targets, this comes from the <i>all-recursive </i>target. In order to solve this we need to tell, in this case automake, that all calls to <i>make </i>should use the <i>-g</i> option.</div><blockquote><div style="text-align: left;">$ touch src/file.c</div><div style="text-align: left;">$ AM_MAKEFLAGS="-g" make -g</div></blockquote><p>This gives us an additional <i>all-am.dot </i>file from the <i>all-am </i>make goal, which holds the missing information:</p><div style="text-align: left;"></div><div style="text-align: left;"><div></div><blockquote>strict digraph "all-am" {<div> "make" -> "src/file.o" </div><div> "all-am" -> "make" </div><div> "all-am"</div><div>}</div></blockquote><div></div></div><h4 style="text-align: left;">Status and feedback</h4><div>I have <a href="https://savannah.gnu.org/bugs/?func=detailitem&item_id=59318">submitted this proposal to the GNU Make project</a>. The maintainers will decide if this is something that is worthwhile and something they could consider maintaining.</div><div><br /></div><div>You can also find the implementation in my Make fork at GitHub, <a href="https://github.com/jonasdn/make/commits/output-graph">here</a>.</div><div><br /></div><div>I would love to hear your thoughts on this. Is this something you would find useful? Please comment here or drop me a line on Twitter (<a href="https://twitter.com/jonasdn">@jonasdn</a>) with your opinions!</div><p></p><p></p>Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com2tag:blogger.com,1999:blog-7317348216081392029.post-69323027595226787342020-08-12T00:11:00.007-07:002020-08-12T01:07:59.002-07:00Getting to know RISC-V through the hifive1-revb board<p>I have been interested in the <a href="https://riscv.org/" target="_blank">RISC-V</a> architecture for a while. RISC-V is an <b>I</b>nstruction <b>S</b>et <b>A</b>rchitecture, like ARM, MIPS or x86, but it is developed and provided under an open source license.</p><p>A couple of weeks ago the <a href="https://www.sifive.com/boards/hifive1-rev-b">hifive1-revb </a>development board I ordered from <a href="https://www.crowdsupply.com/sifive/hifive1-rev-b">Crowd Supply</a> arrived and I have been using it to get to know RISC-V a bit. The small <i>get-to-know-the-board </i>project I settled on was to use the LEDs on the board to blink <i>HELLO</i> in morse code using RISC-V assembly.</p><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3Owa7z70obPcEIn0fSinZFiENG-K7UncPOXOwoRkRoA3OR4CxjAIhXu8nlhLLPwWRiNR573cSsAGYsFGXywOLMIelWdG5P74utyMFZuIbAFNR4IuDml7KVYeawGLXNBPfjrwKX8z-x8j_/s563/hifive1-revb.png" style="display: block; margin-left: auto; margin-right: auto; padding: 1em 0px; text-align: center;"><img border="0" data-original-height="420" data-original-width="563" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3Owa7z70obPcEIn0fSinZFiENG-K7UncPOXOwoRkRoA3OR4CxjAIhXu8nlhLLPwWRiNR573cSsAGYsFGXywOLMIelWdG5P74utyMFZuIbAFNR4IuDml7KVYeawGLXNBPfjrwKX8z-x8j_/s0/hifive1-revb.png" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">The HiFive1 Rev B and its components, which are described in the getting started guide</td></tr></tbody></table><h3 style="text-align: left;"><br />Getting to know the development board</h3><p>Starting with a new development board (or micro-controller) is a bit like getting to know a new API. The problem, like with many other areas, is knowing what information you need and where to find it.</p><p><i>Simply put - you are not supposed to <b>just know</b> how to talk to or get software onto a board that is put in front of you.</i></p><p>Your best bet is always that the vendor will provide information on which extra hardware is required (cables, power supplies, ...), how to develop software for the board and how to get that software onto the board. </p><p>The hifive1 revb comes with a <a href="https://sifive.cdn.prismic.io/sifive%2F4f5a7851-1b52-463b-a293-f352036bc809_hifive1b-getting-started-guide_v1.1.pdf">getting started guide</a> that tells us that only a micro-USB cable is needed for power, communication, debugging and getting software onto the board.</p><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI3DDKn7qQDFysBSUK8hhASUW2cwrUGImNG8-RVloAlmx4Hd57oe6uKQfge6ueyrQ1dRmVG1EBAQRKxEu-Ho5ChZRGAg3nVepM21wN3EKHowdugh5ou280KDcqjmlLoL5eUm4VAljxA_U7/s581/jlink.png" style="display: block; margin-left: auto; margin-right: auto; padding: 1em 0px; text-align: center;"><img border="0" data-original-height="294" data-original-width="581" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI3DDKn7qQDFysBSUK8hhASUW2cwrUGImNG8-RVloAlmx4Hd57oe6uKQfge6ueyrQ1dRmVG1EBAQRKxEu-Ho5ChZRGAg3nVepM21wN3EKHowdugh5ou280KDcqjmlLoL5eUm4VAljxA_U7/s0/jlink.png" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">J-Link OB connectivity<br /></td></tr></tbody></table><p>The reason we can get all that with <i>just </i>an USB cable is that the hifive1 revb comes with a <a href="https://www.segger.com/products/debug-probes/j-link/models/j-link-ob/#what-is-the-j-link-ob"><i>J-Link OB</i> from Segger</a><i>. </i>This chip is mounted on the the development board and connected to the RISC-V core (<a href="https://sifive.cdn.prismic.io/sifive%2F3d777659-a0dd-49ed-a011-5bebba17aecf_fe310-g002-ds.pdf">FE310-G002</a>) via a <a href="https://en.wikipedia.org/wiki/JTAG">JTAG</a> (standard port-thingie for debugging) and a serial port. This makes interacting with the board quite pleasant.</p><p>The getting started guide also tells us how to develop software for the board. It points us to the <a href="https://github.com/sifive/freedom-e-sdk">Freedom E SDK</a> which is maintained by <a href="https://www.sifive.com/">SiFive</a> and provides libraries and build systems for making developing software for any and all of SiFive's development boards.</p><p>Since I wanted to get to know RISC-V a bit on my own I chose to not use the Freedom E SDK (but I glanced at it when my own stuff failed to work).</p><h3 style="text-align: left;">Making a LED shine red</h3><div>The development board includes a FE310-G002 RISC-V core, and the SiFive page for the board links us to the<a href="https://sifive.cdn.prismic.io/sifive%2F9ecbb623-7c7f-4acc-966f-9bb10ecdb62e_fe310-g002.pdf"> manual for that core</a> as well as the <a href="https://sifive.cdn.prismic.io/sifive%2Fa4546ced-0922-4d87-9334-e97c1a9fd9a5_hifive1.b01.schematics.pdf">schematics</a> of the board itself.</div><div><br /></div><div>After looking around a bit in the schematics one can find the part that tells us about the LEDs, from that we see that the red LED is connected to <i>GPIO_22</i>. A GPIO is a digital port on the CPU that is not dedicated to a specific function, it can be used to control any peripheral of your choosing,</div><div><br /></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAmh6Qx35qcu8gP_8M4ZOQUl9UZgUCJ_t4WUab4s8lxIcgnfw7iENC-OA0i_95ZyV7UMgRFkk0Ucf3yJ2IIdpi83-Ipzqpkrsw5vS9wGtaR9MhZY0nwL56TtqZH_iZcpP4zsflctirkwfq/s376/gpio_leds.png" style="display: block; margin-left: auto; margin-right: auto; padding: 1em 0px; text-align: center;"><img border="0" data-original-height="323" data-original-width="376" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAmh6Qx35qcu8gP_8M4ZOQUl9UZgUCJ_t4WUab4s8lxIcgnfw7iENC-OA0i_95ZyV7UMgRFkk0Ucf3yJ2IIdpi83-Ipzqpkrsw5vS9wGtaR9MhZY0nwL56TtqZH_iZcpP4zsflctirkwfq/s0/gpio_leds.png" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">LED schematics<br /></td></tr></tbody></table><br /><div>Next up is looking at the GPIO section of the FE301-002 manual. And the interesting part for us is the GPIO memory map. </div><div><br /></div><div>RISC-V uses <i>memory mapped I/O</i> which means that the same memory address space, and the same instructions, are used to talk to both memory and devices. The GPIO memory map will tell us how to interface with the GPIO controller of the FE3001-002.</div><div><br /></div><div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJDMxuyxm4RmKlMSG4omqqPY3bTrtVGHggwJiCRuT4eWpMmUW9w1kvXQZq_uzSJ4G9f4dJU1t0DwtVuG1x6W-tBQwE1A59sVa-lxfFM7EYo-xbO4iSPJlD5c7JUc9CjWqjMKpjqH7s8ail/s689/gpio+memory+map.png" style="border: 1px solid black; display: block; padding: 1em 0px; text-align: center;"><img border="0" data-original-height="579" data-original-width="689" height="430" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJDMxuyxm4RmKlMSG4omqqPY3bTrtVGHggwJiCRuT4eWpMmUW9w1kvXQZq_uzSJ4G9f4dJU1t0DwtVuG1x6W-tBQwE1A59sVa-lxfFM7EYo-xbO4iSPJlD5c7JUc9CjWqjMKpjqH7s8ail/w513-h430/gpio+memory+map.png" width="513" /></a></div><div><br /></div><div>From the manual we can read that the <i>base address</i> of the GPIO instance is <i>0x10012000,</i></div><div>and that there are 32 GPIOs. We also get the offsets to a bunch of registers that control different things about the GPIOs. All registers are 32 bits wide. This means that if we wanted to enable a GPIO as an output, we would write a bit-mask detailing which GPIO we wanted to enable to the offset <i>0x08</i> of address <i>0x10012000</i>.</div><div><br /></div><div>In RISC-V assembly that would look something like this: <br /><br /> <!--HTML generated using hilite.me--><div style="background: rgb(240, 240, 240); border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #666666;">.</span>section <span style="color: #666666;">.</span>text
<span style="color: #666666;">.</span>equ GPIO_BASE, <span style="color: #40a070;">0x10012000</span> <span style="color: #60a0b0; font-style: italic;"># Memory address of FE310-G002 GPIO</span>
<span style="color: #666666;">.</span>equ GPIO_RED, <span style="color: #40a070;">0x400000</span> <span style="color: #60a0b0; font-style: italic;"># (00000000010000000000000000000000)</span>
<span style="color: #666666;">.</span><span style="color: #007020; font-weight: bold;">global</span> led_init
led_init:
li t0, GPIO_BASE <span style="color: #60a0b0; font-style: italic;"># li: load the constant GPIO_BASE into t0</span>
li t1, GPIO_RED <span style="color: #60a0b0; font-style: italic;"># Load the constant GPIO_RED into t1</span>
sw t1, <span style="color: #40a070;">0x08</span>(t0) <span style="color: #60a0b0; font-style: italic;"># To enable GPIO_RED we write a 32bit word with</span>
<span style="color: #60a0b0; font-style: italic;"># the 22nd bit set to offset 0x08 (output_en)</span>
sw t1, <span style="color: #40a070;">0x40</span>(t0) <span style="color: #60a0b0; font-style: italic;"># We make the GPIO "active high", by writing</span>
<span style="color: #60a0b0; font-style: italic;"># to offset 0x40 (out_xor) </span>
ret</pre></div></div><div><br /></div><div></div><div>The <span style="background-color: #f3f3f3;">li</span><span style="background-color: white;"> (load immediate) instruction will load the value of the constant into a (temporary) register. And the </span><span style="background-color: #f3f3f3;">sw</span><span style="background-color: white;"> (store word) instruction will write that value to the given offset of the address found in the register.</span></div><div><span style="background-color: white;"><br /></span></div><div><span style="background-color: white;">The write to the register at offset 0x40 (output_xor) will make the GPIO <i>active high</i>, meaning that writing a 1 to the GPIO will make its output high, the other way around is the default.</span></div><div><span style="background-color: white;"><br /></span></div><div><span style="background-color: white;">If we now want to turn on the LED we write <i>0x4000000</i> (bit 22 set) to offset <i>0x0c</i> of the GPIO_BASE address.</span></div><h3 style="text-align: left;"><span style="background-color: white;"><br />Making our program wait</span></h3><div><span style="background-color: white;">In order to find out how we can implement a function that will wait for a fixed number of milliseconds we need to turn to the FE301-002 manual again, there we can find the <i>mtime</i> register. </span></div><div><span style="background-color: white;"><br /></span></div><div><span style="background-color: white;">The <i>mtime</i> register contains the number of cycles performed since the <a href="https://en.wikipedia.org/wiki/Real-time_clock"><b>R</b>eal <b>T</b>ime <b>C</b>lock</a> started. The mtime register is accessed through address<i> </i></span><i>0x200bff8 </i>and we can find out that the frequency of the RTC is <i>32768 kHz</i> from reading the RTC chapter of the manual.</div><div><br /></div><div>Knowing all this, we can put together a function that will wait until the RTC<b> </b>has counted enough cycles to satisfy our waiting time. In RISC-V assembly that might be expressed like this:<br /><div><br /></div><!--HTML generated using hilite.me--><div style="background: rgb(240, 240, 240); border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #666666;">.</span>section <span style="color: #666666;">.</span>text
<span style="color: #666666;">.</span>equ MTIME_REG, <span style="color: #40a070;">0x200bff8</span> <span style="color: #60a0b0; font-style: italic;"># memory address of MTIME register</span>
<span style="color: #666666;">.</span>equ RTC_FREQ, <span style="color: #40a070;">33</span>
<span style="color: #666666;">.</span><span style="color: #007020; font-weight: bold;">global</span> wait_ms
<span style="color: #60a0b0; font-style: italic;">#</span>
<span style="color: #60a0b0; font-style: italic;"># Arguments:</span>
<span style="color: #60a0b0; font-style: italic;"># - a0: number of milliseconds to busy wait</span>
<span style="color: #60a0b0; font-style: italic;">#</span>
wait_ms:
li s0, MTIME_REG <span style="color: #60a0b0; font-style: italic;"># li: load the constant MTIME_REG into s0</span>
lw s1, <span style="color: #40a070;">0</span>(s0) <span style="color: #60a0b0; font-style: italic;"># lw: load the value at offset 0 of MTIME_REG,</span>
<span style="color: #60a0b0; font-style: italic;"># to get the number of cycles counted by the RTC</span>
li s2, RTC_FREQ <span style="color: #60a0b0; font-style: italic;"># Load the constant RTC_FREQ into S2</span>
mul s2, s2, a0 <span style="color: #60a0b0; font-style: italic;"># Multiply milliseconds with the frequency</span>
<span style="color: #60a0b0; font-style: italic;"># to get cycles to wait</span>
add s2, s1, s2 <span style="color: #60a0b0; font-style: italic;"># Add cycles to wait to cycles counted</span>
<span style="color: #007020;">cmp</span>:
lw s1, <span style="color: #40a070;">0</span>(s0) <span style="color: #60a0b0; font-style: italic;"># Load current number of cycles into s1</span>
blt s1, s2, <span style="color: #007020;">cmp</span> <span style="color: #60a0b0; font-style: italic;"># If current number of cycles are lower</span>
<span style="color: #60a0b0; font-style: italic;"># than target, keep looping</span>
ret
</pre></div>
</div><div><br /></div><h3 style="text-align: left;"><br />Getting the software onto the board</h3><div>Now we have gathered all the information we need from the schematics and manual, and we have put together some clever code to make the board perform our desired actions. Now it is time to get the source into a shape that the board can understand.</div><div><br /></div><div>First we need to get a <a href="https://en.wikipedia.org/wiki/Toolchain">toolchain</a> capable of handling code for the RISC-V architecture. The getting started guide tells us that you can get it from the <a href="https://www.sifive.com/boards">SiFive website.</a> It is also possible to get a toolchain through regular software distribution channels.<br /><br /></div><div>For Fedora you might try:</div><div><br /><!--HTML generated using hilite.me--><div style="background: rgb(240, 240, 240); border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #60a0b0; font-style: italic;"># dnf install gcc-riscv64-linux-gnu</span>
</pre></div>
</div><div><br /></div><div>And for Ubuntu maybe:</div><div><br /><!--HTML generated using hilite.me--><div style="background: rgb(240, 240, 240); border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #60a0b0; font-style: italic;"># apt install gcc-riscv64-unknown-elf</span></pre></div></div><div><br /></div><div>Using this we can compile our programs. There are still some gotchas though.</div><div><br /></div><div>We need to tell the compiler or assembler in detail what platform we are building the software for, in our case we can find this information in the manual, it tells us that FE3001-G002 is a 32 bit RISC-V with the <a href="https://en.wikichip.org/wiki/risc-v/standard_extensions">I, M, A and C extensions.</a></div><div><br /></div><div class="separator" style="clear: both;">This can be translated to the command line of the assembler in this way:</div><div><br /></div><!--HTML generated using hilite.me--><div style="background: rgb(240, 240, 240); border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #60a0b0; font-style: italic;"># riscv64-unknown-elf-as -march=rv32imac -mabi=ilp32 \</span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #60a0b0; font-style: italic;"> -c -o wait.o wait.S</span>
</pre></div><div><br /></div><div>The -<i>mabi=ilp32 </i>flag tells the assembler that <b>i</b>nts <b>l</b>ongs and <b>p</b>ointers are all 32 bits in size.</div><div><br /></div><div>After this we can generate object code for the correct platform. But we need to link it together to create a binary that can run on our hifive1-revb board. The way we do this is by using the linker (<i>ld</i>) program.</div><div><br /></div><div>The linker will put the code at the memory address that we tell it to. This is done by way of a <i>linker script. </i>A linker script is always used when <i>ld </i>is used. Most of the time we are not aware of it, because we are developing in a standard environment where we do not need to be concerned about the memory layout of the system. But even so, a linker script is being used. One can find out what the default built-in linker script is by running <i>ld </i>with the <i>--verbose</i> flag.</div><div><br /></div><div>The default linker script I got when I ran the <i>riscv64-unknown-elf-ld </i>program without specifying a linker script can be seen in this <a href="https://gist.github.com/jonasdn/50edfe583c5aae944bda0a0fe89783fa">gist.</a></div><div><br /></div><div>I am sure (actually I am not) there are people for whom linker scripts come natural and that they can wake up at all hours of the night to write one. But I am not one of them. Enough time usually passes between me having to write one that I end up googling all the basics every time. For people wanting to learn more about them, I can recommend the excellent blog post: <a href="https://interrupt.memfault.com/blog/how-to-write-linker-scripts-for-firmware">From Zero to main(): Demystifying Firmware Linker Scripts</a> by François Baldassari.</div><div><br /></div><div>I wanted to write the smallest possible linker script I could get away with for the hifive1-revb board, and I ended up with this:</div><div><br /><!--HTML generated using hilite.me--><div style="background: rgb(240, 240, 240); border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;">MEMORY
{
flash (rx) <span style="color: #666666;">:</span> ORIGIN <span style="color: #666666;">=</span> <span style="color: #40a070;">0x20010000</span>, LENGTH <span style="color: #666666;">=</span> <span style="color: #40a070;">512</span>M
}
SECTIONS
{
.text <span style="color: #666666;">:</span>
{
<span style="color: #666666;">*</span>(.text)</pre><pre style="line-height: 125%; margin: 0px;"> } > flash</pre><pre style="line-height: 125%; margin: 0px;"><br /></pre><pre style="line-height: 125%; margin: 0px;"> .rodata :
{
*(.rodata)
} > flash
}
</pre></div>
</div><div><br /></div><div>So first I define a memory region called <i>flash</i> and tell the linker that the start of this region is at address <i>0x20010000. </i>This is taken from the FE310-G002 manual, the Freedom E SDK and google, where I found out that the current bootloader code of the hifive1-revb will jump to <i>0x20010000</i> (if anyone can find an official source for this, please comment)<i>.</i></div><div><i><br /></i></div><div>Then I tell the linker that there are two sections, one called <i>.text </i>(this is by convention where the machine code lives) and one called <i>.rodata </i>(this is where const data is kept). And both of them should reside in flash.</div><div><br /></div><div>This makes <i>ld </i>place our code at address <i>0x2001000</i> where the bootloader of the development board expects it to be.</div><div><br /></div><div>With all this known, we can perform the linking:</div><div><br /><!--HTML generated using hilite.me--><div style="background: rgb(240, 240, 240); border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #60a0b0; font-style: italic;"># riscv64-unknown-elf-ld hello-morse.o -m elf32lriscv -nostartfiles \</span></pre><pre style="line-height: 125%; margin: 0px;"><span style="color: #60a0b0; font-style: italic;"> -nostdlib -Thello-morse.lds -o hello-morse.elf</span>
</pre></div>
</div><div><br /></div><div>We specify our linker script using the <i>-T</i> flag. The output of this command is an <a href="https://en.wikipedia.org/wiki/Executable_and_Linkable_Format">elf executable</a> which is all well and good. But it is not what we want to upload to our board. The board wants a binary in <i>hex </i>format, we can get that from an elf using the <i>objcopy</i> command.</div><div><br /><!--HTML generated using hilite.me--><div style="background: rgb(240, 240, 240); border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #60a0b0; font-style: italic;"># riscv64-unknown-elf-objcopy -O ihex hello-morse.elf hello-morse.hex</span>
</pre></div>
</div><div><br /></div><div>And now we are ready to use tools from Segger, you can download the <a href="https://www.segger.com/downloads/jlink/"> J-Link Software and Documentation Pack</a> from the Segger website.</div><div><br /></div><div>And the magic incantation to have it download your software to the development board is as follows:</div><div><br /><!--HTML generated using hilite.me--><div style="background: rgb(240, 240, 240); border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;"><pre style="line-height: 125%; margin: 0px;"><span style="color: #bb60d5;">$ </span>JLinkExe
SEGGER J-Link Commander V6.40 <span style="color: #666666;">(</span>Compiled Oct 26 2018 15:08:38<span style="color: #666666;">)</span>
DLL version V6.40, compiled Oct 26 2018 15:08:28
Connecting to J-Link via USB...O.K.
Firmware: J-Link OB-K22-SiFive compiled Nov 22 2019 12:57:38
Hardware version: V1.00
S/N: 979014353
<span style="color: #bb60d5;">VTref</span><span style="color: #666666;">=</span>3.300V
Type <span style="color: #4070a0;">"connect"</span> to establish a target connection, <span style="color: #4070a0;">'?'</span> <span style="color: #007020; font-weight: bold;">for </span><span style="color: #007020;">help</span>
J-Link>connect
Please specify device / core. <Default>: FE310
Type <span style="color: #4070a0;">'?'</span> <span style="color: #007020; font-weight: bold;">for </span>selection dialog
Device>FE310
Please specify target interface:
J<span style="color: #666666;">)</span> JTAG <span style="color: #666666;">(</span>Default<span style="color: #666666;">)</span>
TIF>
Device position in JTAG chain <span style="color: #666666;">(</span>IRPre,DRPre<span style="color: #666666;">)</span> <Default>: -1,-1 <span style="color: #666666;">=</span>> Auto-detect
JTAGConf>
Specify target interface speed <span style="color: #666666;">[</span>kHz<span style="color: #666666;">]</span>. <Default>: 4000 kHz
Speed>
Device <span style="color: #4070a0;">"FE310"</span> selected.
Connecting to target via JTAG
<span style="color: #bb60d5;">TotalIRLen</span> <span style="color: #666666;">=</span> 5, <span style="color: #bb60d5;">IRPrint</span> <span style="color: #666666;">=</span> 0x01
JTAG chain detection found 1 devices:
<span style="color: #60a0b0; font-style: italic;">#0 Id: 0x20000913, IRLen: 05, Unknown device</span>
Version: 0.13, AddrBits: 7, DataBits: 32, IdleClks: 5, Stat: 0
ISA: RV32I+ACMU
RISC-V identified.
J-Link>loadfile hello-morse.hex
Downloading file <span style="color: #666666;">[</span>hello-morse.hex<span style="color: #666666;">]</span>...
Comparing flash <span style="color: #666666;">[</span>100%<span style="color: #666666;">]</span> Done.
</pre></div>
</div><div><br /></div><div>We ask the JLink software to connect and get a series of questions in return. We tell the software that our device is a FE310 and after that answer the default (JTAG, auto-detect, 4000 kHz).</div><div><br /></div><div>After this we issue a loadfile command with our hex file as argument, and we are off!</div><div><br /></div><div>The complete, heavily commented, assembly source and Makefile for the hello morse program can be found at my github <a href="https://github.com/jonasdn/riscv-asm-hello-morse">here.</a></div><div><span style="color: #0000ee;"><u><br /></u></span></div><div>Thank you for reading! Below is a video of the hifive1-revb blinking some morse!</div><div><br /></div><div><br /></div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dyZKABos3UEpD49bn2B4rW4_aEV5GRp9EubTgbIeWcVmVt88XmO6L_W0ZqoW31JVlaW1Mo_b9-iWC8jnT_9tg' class='b-hbp-video b-uploaded' frameborder='0'></iframe></div><div><br /><a href="https://github.com/jonasdn/riscv-asm-hello-morse"><div class="separator" style="clear: both;"><br /></div></a></div><div><br /></div><div><br /></div>Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com0tag:blogger.com,1999:blog-7317348216081392029.post-2435687530024341062017-02-06T22:22:00.001-08:002017-02-06T22:23:37.916-08:00Maps at FOSDEMI went to FOSDEM again this year, my fourth year running. I go with a great group of friends and it is starting to become quite the tradition.<br />
<br />
<h3>
Maps meeting</h3>
FOSDEM lines up pretty well with the GNOME release cycle, in that after the conference we have about a month of time to get the last stuff in before the next 6 month development cycle comes to an end. With that in mind we had a quite quick and informal Maps meeting on what the immediate priorities where for the release and what we wanted to do after that.<br />
<br />
<h4>
Transit routing</h4>
<div>
We want to merge <a href="http://ml4711.blogspot.se/2017/02/next-stop-brussels.html">Marcus transit-routing branch</a> this cycle. This will not add anything if there is no <a href="http://www.opentripplanner.org/">OpenTripPlaner</a> server available. But our plan is to be able to add one to our service file so this can be turned on if we get some sponsorship or in any other way manage to solve the infrastructure needs. This will also be a way of disabling the functionality if we lose infrastructure, such as with our MapQuest tiles previously.</div>
<div>
<br /></div>
<h4>
Geocoding / search as you type</h4>
<div>
We now have a Mapbox account. We could use the <a href="https://www.mapbox.com/geocoding/">Mapbox geocoding API</a> instead of <a href="http://wiki.openstreetmap.org/wiki/Nominatim">Nominatim</a> that we currently use. And with that we could achieve search-as-you-type functionality. The timing is right for a switch like this, since <a href="https://www.collabora.com/">Collabora</a> recently landed a patch bomb on <a href="https://developer.gnome.org/geocode-glib/">geocode-glib</a> to make it handle custom backends through an interface. So we could write a Mapbox interface in Maps.</div>
<div>
<br /></div>
<div>
I did some prototyping with this during some FOSDEM talks and the (buggy) result can be seen in the video below.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/000QuLzpiOM/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/000QuLzpiOM?feature=player_embedded" width="320"></iframe></div>
<div>
<br /></div>
<div>
An issue with using Mapbox geocoding service that I do not yet know if we can solve is that there does not appear to be a link between the id you get for a resulting place and the <a href="https://www.openstreetmap.org/#map=5/51.500/-0.100">OpenStreetMap</a> id. This makes it really hard for us to support editing the nodes you find.</div>
<div>
<br /></div>
<h4>
Tile styles</h4>
<div>
Also since we have a Mapbox account it would be possible for us to make our own styles. For instance an hi-contrast style, a custom print style or a general GNOME style. This is a daunting task. But if anyone feel up for it, please let us know.</div>
<div>
<br /></div>
<h3>
Mapbox GL Native</h3>
<div>
Thiago Santos from Mapbox held a <a href="https://fosdem.org/2017/schedule/event/geo_mapboxgl/">talk</a> about Mapbox GL Native which is a hardware-accelerated map rendering engine. It is written in C++-14 and has recently been <a href="https://www.mapbox.com/blog/qt-framework-support/">ported to QT</a>. Thiago talked about what is needed to port Mapbox GL Native to new platforms, and specifically called out GTK+ and GNOME Maps. Saying that it should be possible to make Mapbox GL Native work with our infrastructures.</div>
<div>
<br /></div>
<div>
Mapbox have written a <a href="https://www.mapbox.com/blog/cross-platform-maps/">blogpost</a> outlining what needs to be true about a platform for Mapbox GL Native to be ported to it. Porting Mapbox GL Native to GLib land might be a nice <a href="https://developers.google.com/open-source/gsoc/">GSoC</a> or <a href="https://www.gnome.org/outreachy/">Outreachy</a> project for GNOME/GTK+.</div>
<div>
<br /></div>
<div>
<br /></div>
Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com0tag:blogger.com,1999:blog-7317348216081392029.post-30405951285581206402016-08-22T12:00:00.002-07:002016-08-22T12:01:49.487-07:00Maps is fast again!I just released a bunch of Maps releases.<br />
<ul>
<li>3.21.90</li>
<li>3.20.3</li>
<li>3.18.4</li>
<li>3.16.4</li>
<li>3.14.4</li>
<li>3.12.4</li>
<li>3.10.4</li>
</ul>
<br />
All of them speeding up the fetching of tiles in two ways.<br />
<ol>
<li>By downloading a service file telling us where third-party tile servers are instead of using redirect by proxy</li>
<li>Allowing for more consecutive HTTP requests</li>
</ol>
Number 2 is only available by using the (as of now unreleased) version 0.12.4 of libchamplain.<br />
<br />
Once your distro of choice picks up one of these stable releases you should be back to at least the old Mapquest speed of Maps. And if your distro upgrades to latest libchamplain when it arrives you will see even greater speeds.<br />
<br />
And as a bonus, the latest libchamplain release will bring horizontal map wrapping, courtesy of excellent GSoC student Marius Stanciu!<br />
<a class="spell" href="https://www.google.se/search?q=courtesy+of&spell=1&sa=X&ved=0ahUKEwi6rsGZ2tXOAhWKZpoKHYgkDo0QvwUIGigA"><br /></a>Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com1tag:blogger.com,1999:blog-7317348216081392029.post-63038280632960546442016-07-31T10:23:00.002-07:002016-07-31T11:05:57.889-07:00Maps has tiles againThis is a short post to inform you all that Maps has tiles again. We now get our tiles from <a href="https://www.mapbox.com/">Mapbox</a>, with whom we have made an agreement going forward. We access Mapbox through a GNOME based redirect, so that we could redirect to something else if a similar situation would arise again.<br />
<br />
Maps has been released with the new tiles in the versions: <br />
3.21.4<br />
3.20.2<br />
3.18.3<br />
3.16.3<br />
3.14.3<br />
<br />
And I think at least Fedora has been updated.<br />
<br />
So, while it was unfortunate that MapQuest closed down for us and we were caught off guard. We now have a better tile setup than before and more options going forward.<br />
<br />
More information about our setup with Mapbox will come from a blog post on Planet GNOME soon. I will leave you with a taste of the new tiles.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZzIimQd-HeTeyoHvupAPj5hiAzP2PUqJQUCiu9VR6dX2aarOHB_63k0s9jzWP2ucSbg0Dl8s6CLLmgrKef5Ky7Y570gsx_HCY7Vq83lDN0jg_wdwQ1ZYB8MRe-PvqPx4qodc5t-SIUmob/s1600/aerial_new.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="216" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZzIimQd-HeTeyoHvupAPj5hiAzP2PUqJQUCiu9VR6dX2aarOHB_63k0s9jzWP2ucSbg0Dl8s6CLLmgrKef5Ky7Y570gsx_HCY7Vq83lDN0jg_wdwQ1ZYB8MRe-PvqPx4qodc5t-SIUmob/s400/aerial_new.png" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4sCfEKW-9OBNkKcdw6gn_bUz6JRxhIhF_f930GXXbS-iHWUc0El1K3elziT1mllO7J4tf7Yri-x7zKvYrAzBsZNu9sv9auq_DnmMUQYAeY3I_wOwjLkl-V_w9khjc6_IoGarasF1bNc71/s1600/street_new.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="216" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4sCfEKW-9OBNkKcdw6gn_bUz6JRxhIhF_f930GXXbS-iHWUc0El1K3elziT1mllO7J4tf7Yri-x7zKvYrAzBsZNu9sv9auq_DnmMUQYAeY3I_wOwjLkl-V_w9khjc6_IoGarasF1bNc71/s400/street_new.png" width="400" /></a></div>
<br />Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com3tag:blogger.com,1999:blog-7317348216081392029.post-79326714978764047702016-07-16T13:37:00.001-07:002016-07-16T13:41:10.217-07:00Getting a network trace from a single applicationI recently wanted a way to get a network packet trace from a specific application. My googling showed me an old <a href="http://askubuntu.com/a/499850">askubuntu thread</a> that solved this by using Linux network namespaces.<br />
<br />
You create a new network namespace, that will be isolated from your regular network, you use a virtual network interface and iptables to make the traffic from it reach your regular network. Then you start an application and wireshark in that namespace and then you have a trace of that application.<br />
<br />
I took that idea and made it into a small program, hosted on github, <a href="https://github.com/jonasdn/nsntrace">nsntrace</a>.<br />
<br />
<pre>> nsntrace
usage: nsntrace [-o file] [-d device] [-u username] PROG [ARGS]
Perform network trace of a single process by using network namespaces.
-o file send trace output to file (default nsntrace.pcap)
-d device the network device to trace
-u username run PROG as username </pre>
<br />
It does pretty much the same as the askubuntu thread above describes but with just one step.<br />
<br />
<pre>> sudo nsntrace -d eth1 wget www.google.com
Starting network trace of 'wget' on interface eth1.
Your IP address in this trace is 172.16.42.255.
Use ctrl-c to end at any time.
--2016-07-15 12:12:17-- http://www.google.com/
Location: http://www.google.se/?gfe_rd=cr&ei=AbeIV5zZHcaq8wfTlrjgCA [following]
--2016-07-15 12:12:17-- http://www.google.se/?gfe_rd=cr&ei=AbeIV5zZHcaq8wfTlrjgCA
Length: unspecified [text/html]
Saving to: ‘index.html’
index.html [ <=> ] 10.72K --.-KB/s in 0.001s
2016-07-15 12:12:17 (15.3 MB/s) - ‘index.html’ saved [10980]
Finished capturing 42 packets.
> tshark -r nsntrace.pcap -Y 'http.response or http.request'
16 0.998839 172.16.42.255 -> 195.249.146.104 HTTP 229 GET http://www.google.com/ HTTP/1.1
20 1.010671 195.249.146.104 -> 172.16.42.255 HTTP 324 HTTP/1.1 302 Moved Temporarily (text/html)
22 1.010898 172.16.42.255 -> 195.249.146.104 HTTP 263 GET http://www.google.se/?gfe_rd=cr&ei=AbeIV5zZHcaq8wfTlrjgCA HTTP/1.1
31 1.051006 195.249.146.104 -> 172.16.42.255 HTTP 71 HTTP/1.1 200 OK (text/html)
</pre>
<br />
If it is something you might have use for or find interesting, please check it out, and help out with patches. It turns out I have a lot to learn about networking and networking code.<br />
<br />
All the best!Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com4tag:blogger.com,1999:blog-7317348216081392029.post-83177315180943441852016-07-16T13:26:00.001-07:002016-07-16T13:26:36.345-07:00Maps and tilesHello all!<br />
<br />
Right now we are having infrastructural problems with Maps. We can no longer use the MapQuest tiles, see mail thread from maps list archive <a href="https://mail.gnome.org/archives/maps-list/2016-July/msg00000.html">here</a> for more information.<br />
<br />
We are working on getting past this and getting a working Maps application released soon. But this is also showing us more clear that we need to get a better grip around the tiles infrastructure if we want to have a Map application and/or a Map infrastructure in GNOME. We are having good discussions and I think we will get through this with a nice plan forward to prevent stuff like this happening. And also with a plan to do better in the future and do cooler stuff with tiles.<br />
<br />
All the best!<br />
<br />Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com0tag:blogger.com,1999:blog-7317348216081392029.post-27067630351644153362016-03-01T12:49:00.000-08:002016-03-01T13:04:37.549-08:00Walkthrough of Maps 3.20 release notesWe have now entered <a href="https://wiki.gnome.org/ThreePointNineteen">beta period for GNOME 3.20</a> and the <a href="https://wiki.gnome.org/ThreePointNineteen/ReleaseNotes#Maps">release notes for Maps</a> are starting to look final.<br />
<br />
This blog post will expand a bit on the official release notes, adding screenshots and some reasoning to most of the items.<br />
<br />
<h2 class="separator" style="clear: both; text-align: left;">
Map bubble re-work</h2>
<div class="separator" style="clear: both; text-align: left;">
For
this cycle we wanted to add some more meta-data to our small map
bubbles. But at the same time we thought that the bubbles were kind of
cluttered.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfnBJePytFx8KC1PbRP-c_3XlgyGqP1jbpZ2oS9_3qmSN76qvGiwFooeeH0M9a3OF-lW8u-piJmjBrt6ZJJ4FrzAHLD7EJLJvPpgOK1p0xDoo8C-M38XD4t-7PEi0ornPB0zE-Cjlh5g/s640/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-02-13+11-59-23.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="276" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfnBJePytFx8KC1PbRP-c_3XlgyGqP1jbpZ2oS9_3qmSN76qvGiwFooeeH0M9a3OF-lW8u-piJmjBrt6ZJJ4FrzAHLD7EJLJvPpgOK1p0xDoo8C-M38XD4t-7PEi0ornPB0zE-Cjlh5g/s400/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-02-13+11-59-23.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So
we added a way to expand the bubble, so that we show the minimum amount
of information by default. And only show more if user presses the more
information dots.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhfVOdRkfK49kbSjELQ6bWUO4Runkj6rkohWOQKJ5s4i8MFJTcJCzfQy2DFbq1BNS7bc6Sjm5CXPBcWztVF6MGWk_S5dM17S37rhMOuXXUEgBiF9PrCuZITtY5nL0uooKdeibCfPpLWg/s640/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-02-13+11-59-41.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="276" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhfVOdRkfK49kbSjELQ6bWUO4Runkj6rkohWOQKJ5s4i8MFJTcJCzfQy2DFbq1BNS7bc6Sjm5CXPBcWztVF6MGWk_S5dM17S37rhMOuXXUEgBiF9PrCuZITtY5nL0uooKdeibCfPpLWg/s400/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-02-13+11-59-41.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
This
is sort of a stop-gap feature. For 3.22 we want to do a more ambitious
re-design of how we show information about a place on the map.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
For this release we added <i>website, phone number, internet access </i>and <i>altitude</i> information, if available, to our map bubbles.<br />
<br />
<h2>
Editing items on OpenStreetMap</h2>
One of the things I am most excited about in this release of Maps is the ability to edit and add places on <a href="https://wiki.openstreetmap.org/wiki/Main_Page">OpenStreetMap</a>. It is due to most awesome work by <a href="http://ml4711.blogspot.se/">Marcus Lundbladh</a>. We now have an edit symbol on our map bubbles. If you press it you will be prompted for your OpenStreetMap credentials. Or a link to where you can set up an account.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQQKuykxBtFq0xf0otGMPu0yWcsMOIMN3vKG8FeG0BFUx3RJEjZsKxwFHPuVNVyaWa6NoSe2N6g0l2bZP9UWVj4W5Zh-mmUTVhQIXSQGk6k_KCEh8ji7GASEMbIgKom9FdF_5hyphenhyphenVQV_g/s640/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2015-12-09+21-30-38.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="260" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQQKuykxBtFq0xf0otGMPu0yWcsMOIMN3vKG8FeG0BFUx3RJEjZsKxwFHPuVNVyaWa6NoSe2N6g0l2bZP9UWVj4W5Zh-mmUTVhQIXSQGk6k_KCEh8ji7GASEMbIgKom9FdF_5hyphenhyphenVQV_g/s640/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2015-12-09+21-30-38.png" width="400" /></a></div>
<br />
After that you get an editor view where you can update the object on OpenStreetMap.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiME_BAvOBQSNFN7G_yxxr6WDyOfR3F4Tn750KaJmEv5eQpTrwuMfj0hMLJavw-VjDNAfzW2o1vYfZMNONJc5F4PcDdAajqFrBV8hcBVrRKyGsetGBzWpYMCns60uahw0UPUmmmgzDz9E_x/s1600/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-03-01+13-14-57.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiME_BAvOBQSNFN7G_yxxr6WDyOfR3F4Tn750KaJmEv5eQpTrwuMfj0hMLJavw-VjDNAfzW2o1vYfZMNONJc5F4PcDdAajqFrBV8hcBVrRKyGsetGBzWpYMCns60uahw0UPUmmmgzDz9E_x/s400/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-03-01+13-14-57.png" width="400" /></a></div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: left;">
It is also possible to add a new <a href="http://wiki.openstreetmap.org/wiki/Node">node</a> to OpenStreetmap.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaVfL4WVYsyG-S4LigTcSCwdQZfT_Vnr48Xrw1_rIhXqNHTF1Cl0rbYDdzQIP9lXvX1EhugruuKSmsVGGlu-3y5CZBHGwwhmGFrn3wYjupVa4I8hHXZhTchpbltNrCb71TDLPmMh0yJA/s400/add-location.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaVfL4WVYsyG-S4LigTcSCwdQZfT_Vnr48Xrw1_rIhXqNHTF1Cl0rbYDdzQIP9lXvX1EhugruuKSmsVGGlu-3y5CZBHGwwhmGFrn3wYjupVa4I8hHXZhTchpbltNrCb71TDLPmMh0yJA/s400/add-location.png" width="400" /></a></div>
By using the map context menu and choosing Add to OpenStreetMap.<br />
<br />
<h2>
Printing of routes</h2>
Due to <a href="http://bugbie.blogspot.se/2016/02/gnome.html">excellent work</a> from our <a href="https://outreachy.gnome.org/?q=program_home&prg=6">Outreachy</a> intern Amisha we managed to land printing of routes this cycle. This is something we have wanted for a while. It helps us cover some of the offline niche. You can search for a route at home, print to paper or PDF and bring that with you on a journey where you do not have access to net.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzDNG_S9kqfVXMwtdiMy9MsFwVMrkdz20nZzCwE1SzZkaDvI6AY8CLa53KS5RL5fZdOF08wZZSA1VWzhiHWfw_MLmYJnHJWhdUMfrQfKWZ87lrb6Csvb4ELd28Jhhivp6wMS6rBG6nNumN/s1600/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-03-01+12-24-21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzDNG_S9kqfVXMwtdiMy9MsFwVMrkdz20nZzCwE1SzZkaDvI6AY8CLa53KS5RL5fZdOF08wZZSA1VWzhiHWfw_MLmYJnHJWhdUMfrQfKWZ87lrb6Csvb4ELd28Jhhivp6wMS6rBG6nNumN/s400/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-03-01+12-24-21.png" width="400" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
When you have successfully search for a route a print icon will appear in Maps header bar. From there one can initiate printing. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsd0_jwDfIisy2v9sVwvjfwy9SfJJ4ImGO7Zttbv_ASbc3m0FrEaiAEOK7L3Ge3T-fvD3YVomwccSj0-sembH8DxQUlm9JSYQiU-vsTwHfy3NcJUSioeADHf8LyhW442YLKraE80p4HF7l/s1600/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-03-01+12-30-45.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="317" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsd0_jwDfIisy2v9sVwvjfwy9SfJJ4ImGO7Zttbv_ASbc3m0FrEaiAEOK7L3Ge3T-fvD3YVomwccSj0-sembH8DxQUlm9JSYQiU-vsTwHfy3NcJUSioeADHf8LyhW442YLKraE80p4HF7l/s400/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-03-01+12-30-45.png" width="400" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Right now you will get one of two print layouts, depending on the distance of the route. The image above is of the long route layout.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2 class="separator" style="clear: both; text-align: left;">
Adding of custom map layers</h2>
<div class="separator" style="clear: both; text-align: left;">
Hashem, another one of our Outreachy interns, has <a href="http://hsh.mx/lots-of-small-changes/">contributed a lot to Maps</a> this cycle. A lot of small details here and there. The most visible contribution is support for KML and GPX layers, as well as an UI to handle them in Maps.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Maps now registers as a handler for the mime-types of <a href="https://www.google.se/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjp8K6cs5_LAhVpb5oKHaSHAKQQFggcMAA&url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FGeoJSON&usg=AFQjCNEKrjIhfAE6-vEZcqbXZmw4PwMDHg&sig2=oEFQSpV3mf5cfeIebSDeFA">GeoJSON</a>, <a href="https://www.google.se/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwimr6els5_LAhVpAZoKHXixAxkQFggbMAA&url=https%3A%2F%2Fsv.wikipedia.org%2Fwiki%2FKeyhole_Markup_Language&usg=AFQjCNFm58MaoddFOx8rzF_KpcQgIRa8eg&sig2=qllB3maZBkG6oZTw1Umrsg&bvm=bv.115339255,d.bGs">KML</a> and <a href="https://en.wikipedia.org/wiki/GPS_Exchange_Format">GPX</a>. Which means that Maps will be a suggestion from GNOME when you attempt to open files of those types on the web or on the desktop.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkw7WEVYGOM2FYz28_e9s5ytu7imBFRyfXEUxbsX80HHjyU1hB36Xkl-6DXA4X9IRQh8loh-gF-TBkNIAP98R0QRgC3Zxo0M2joROKj9ARYO3k_4pC_URLgwU9rII0hSwUbwfc_Mx-tmHp/s1600/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-03-01+12-41-00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="196" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkw7WEVYGOM2FYz28_e9s5ytu7imBFRyfXEUxbsX80HHjyU1hB36Xkl-6DXA4X9IRQh8loh-gF-TBkNIAP98R0QRgC3Zxo0M2joROKj9ARYO3k_4pC_URLgwU9rII0hSwUbwfc_Mx-tmHp/s400/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-03-01+12-41-00.png" width="400" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
It is possible to open layers through the UI, the command line and through drag and drop to an open Maps window.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
For GeoJSON we also support the <a href="https://www.mapbox.com/help/an-open-platform/">Mapbox simple style</a> specification. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2 class="separator" style="clear: both; text-align: left;">
Scale ruler</h2>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrsbuEPVdCMVt0PKa__mQd8DEaT8S2Wlkox7a-OKcoA2AnEkSXRHQKmKd3taxZ_9lcIo1yxjCQJpLyTC-En2K46bff4HMkVhqKcyxIEGgO7m4kZC8IYzBGqNf35DZbm-QuAcrQNQTh2BYl/s1600/scale.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrsbuEPVdCMVt0PKa__mQd8DEaT8S2Wlkox7a-OKcoA2AnEkSXRHQKmKd3taxZ_9lcIo1yxjCQJpLyTC-En2K46bff4HMkVhqKcyxIEGgO7m4kZC8IYzBGqNf35DZbm-QuAcrQNQTh2BYl/s1600/scale.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
A minor change UI wise and code wise, but one that was requested for some time was merged this cycle. The adding of a scale ruler to Maps. It is visible in the bottom left corner of the images above.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2 class="separator" style="clear: both; text-align: left;">
Exporting of view to PNG</h2>
<div class="separator" style="clear: both; text-align: left;">
The library that contains our map widget, <a href="https://wiki.gnome.org/Projects/libchamplain">libchamplain</a> got support for exporting a view to a cairo_surface. That meant that we could implement the feature of exporting to PNG quite easily.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlj_cQRCA6vXaahT7Qm0KTPvOf2TAfQIVHF_roJXk2Xr-nSjFZQYETlnDE3NjJN5a4uY5blX2s4w9InNekVCSEKgfqBSIXiRqsM7NNc1MvsiSU5RbVHk3xlXmRfaEkGSMEE9Werhyv5CPp/s1600/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-03-01+12-53-34.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="143" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlj_cQRCA6vXaahT7Qm0KTPvOf2TAfQIVHF_roJXk2Xr-nSjFZQYETlnDE3NjJN5a4uY5blX2s4w9InNekVCSEKgfqBSIXiRqsM7NNc1MvsiSU5RbVHk3xlXmRfaEkGSMEE9Werhyv5CPp/s400/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-03-01+12-53-34.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
This is triggered by the map context menu.<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2 class="separator" style="clear: both; text-align: left;">
Handling geo: URI</h2>
<div class="separator" style="clear: both; text-align: left;">
The <a href="https://en.wikipedia.org/wiki/Geo_URI_scheme">geo URI scheme</a> is a way of linking to a certain location. Maps is now registered as a handler of this URI. So if you encounter it in the wild, say in your web browser. Try to click it and Maps should be your suggested agent for it.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
We can also get a geo URI from Maps, by using the Copy Location item in the map context menu. It is also possible to paste or enter a geo URI in the Maps search bar to have Maps go to the location, or give one on Maps command line.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2 class="separator" style="clear: both; text-align: left;">
Help overlay</h2>
<div class="separator" style="clear: both; text-align: left;">
Along with many other GNOME apps we added a help overlay to show our shortcut bindings.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvr9uXbos_AJUPQxi0EzvMEw3erQlvtaHhuEean92z8OCy4sI-50R7rhQMcyxOA8vXzZh8OBvM6e5zi4TrmGWPK8_Zl0KmaX66LMxBpNdEWQ2qRDR4ipKcsEgO5NpFDkqhCMEEvDZTvsVT/s1600/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-03-01+12-58-47.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="183" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvr9uXbos_AJUPQxi0EzvMEw3erQlvtaHhuEean92z8OCy4sI-50R7rhQMcyxOA8vXzZh8OBvM6e5zi4TrmGWPK8_Zl0KmaX66LMxBpNdEWQ2qRDR4ipKcsEgO5NpFDkqhCMEEvDZTvsVT/s400/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2016-03-01+12-58-47.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com5tag:blogger.com,1999:blog-7317348216081392029.post-56079980280768475572016-01-04T01:55:00.000-08:002016-01-04T01:58:10.493-08:00Maps and Outreachy<a href="https://www.gnome.org/outreachy/">Outreachy</a> is the successor of the Outreach Program for Women (OPW). OPW
was inspired by Google Summer of Code and by how few women applied for
it.<br />
<br />
The program was renamed to Outreachy with the goal of expanding to
engage people from various underrepresented groups and was moved to
Software Freedom Conservancy as its organizational home.<br />
<br />
For this period (December 2015 - March 2016) <a href="https://wiki.gnome.org/Apps/Maps">Maps</a> has two Outreachy interns!<br />
<br />
<a href="https://plus.google.com/100588220183615341183">Amisha Singla</a> will be working on adding the <a href="https://bugzilla.gnome.org/show_bug.cgi?id=746790">possibility of printing the route</a> in Maps. Working towards the preliminary mockups done by Andreas Nilsson<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/maps/print-map.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/maps/print-map.png" width="282" /></a></div>
Her blog has been connected to <a href="http://planet.gnome.org/">Planet GNOME</a> but to see her earlier blog post please se the <a href="http://bugbie.blogspot.se/">direct link here.</a><br />
<br />
<br />
Hashem Nasarat will be working on bringing support for <a href="http://apprentice.craic.com/tutorials/28">KML/KMZ</a> to Maps.<br />
as well as formalizing the UX and UI for dealing with custom layers.<br />
<br />
He is currently working on realizing these mockups:<br />
His blog is also on Planet GNOME and the <a href="http://hsh.mx/">direct link is here.</a><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/maps/custom-map.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/maps/custom-map.png" width="320" /></a></div>
<br />
Both interns are doing awesome work and we are very very lucky to have them! Maps needs them and also you! For doing design, code evaluation of infrastructure and work flow!<br />
<br />
<br />
<br />
<br />
<br />Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com0tag:blogger.com,1999:blog-7317348216081392029.post-14090945692887948482015-12-12T10:55:00.000-08:002015-12-12T10:58:12.854-08:00What's cooking in Maps in GNOME 3.20We are coming up on the 3.19.3 release this Monday and 3.19.4 will be January 14th which will also be the start of <a href="https://wiki.gnome.org/ThreePointNineteen">the UI freeze</a>.<br />
<br />
I want<span id="goog_364065084"></span><span id="goog_364065085"></span>ed to take some time and give an update on what we have done for Maps this cycle and what we can expect in Maps 3.20.<br />
<br />
<h2>
Open with browser</h2>
We have had support to open a location with other applications for a while. New in 3.20 will be Open with browser. That will send you to the <a href="https://openstreetmap.org/">OpenStreetMap</a> page for the location in question.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8n0jRYrt5LhOG3cj818-oWrT9YbV8PQ_K8hubzGgy2dlESWQppNL9ePzuwiKWsfXOXhQWk6tM5I-AVhmo0pDq8mWF1PElCZPw9LKW1sVZFIG4-wQz1veF8Q4ywTtl7La1Rhj01Otvam8q/s1600/browser.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="286" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8n0jRYrt5LhOG3cj818-oWrT9YbV8PQ_K8hubzGgy2dlESWQppNL9ePzuwiKWsfXOXhQWk6tM5I-AVhmo0pDq8mWF1PElCZPw9LKW1sVZFIG4-wQz1veF8Q4ywTtl7La1Rhj01Otvam8q/s320/browser.png" width="320" /></a></div>
<br />
<br />
<h2>
Fun with URIs</h2>
Maps in 3.20 will be able to handle the '<a href="https://en.wikipedia.org/wiki/Geo_URI_scheme">geo' URI scheme</a>. That means that if you follow the link in the previous sentence and go to the wiki page and click on a geo: URI, your browser will suggest that you open the URI with Maps.<br />
<br />
The GNOME IRC application <a href="https://wiki.gnome.org/Apps/Polari">Polari</a> has also gotten support to linkify the geo: URI.<br />
<br />
<br />
<h2>
Geojson</h2>
I wrote about this in <a href="http://jonasdn.blogspot.se/2015/10/geojson-in-maps.html">an earlier blog post</a> we now have support for opening <a href="https://en.wikipedia.org/wiki/GeoJSON">GeoJSON</a> file, that contain simple geometric shapes and annotations. Since then contributor <a href="https://plus.google.com/+AlafazamKhan">Alaf Azam</a> added initial support for the <a href="https://www.mapbox.com/help/define-simplestyle/">Mapbox simple style</a> specification for styling GeoJSON data. Which mean we can have stuff looking pretty like below.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgifWuii3Z_0IyQPUxHvmA_1TLFJHtN0fHG8VDqRIBo7P924qV3DuysSuAAgwq6kyOzoso0fVLf3HKejBaiXQHX1Vu_BZkiDTGR_NWkmEFXq80T_YGLh-jUjOhAMCXn6ZRBAEiG26Kthilt/s1600/maps-simplestyle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="242" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgifWuii3Z_0IyQPUxHvmA_1TLFJHtN0fHG8VDqRIBo7P924qV3DuysSuAAgwq6kyOzoso0fVLf3HKejBaiXQHX1Vu_BZkiDTGR_NWkmEFXq80T_YGLh-jUjOhAMCXn6ZRBAEiG26Kthilt/s400/maps-simplestyle.png" width="400" /></a></div>
<br />
<br />
<h2>
Export to PNG</h2>
We added functionality to export the current view to PNG.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRjQQtHzbVksfM59i4ZRH1sXri8W29GGLGQqPBBoF64piCmSqay3d-950qaD0KGz1Cy-zZhRic1fqGbnIMo-7gSmmj_gjc5vsPFUEzybr6YOdytK8RFwH6yVWT3LDTZvUDtR_ZZykAGGYR/s1600/export.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="241" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRjQQtHzbVksfM59i4ZRH1sXri8W29GGLGQqPBBoF64piCmSqay3d-950qaD0KGz1Cy-zZhRic1fqGbnIMo-7gSmmj_gjc5vsPFUEzybr6YOdytK8RFwH6yVWT3LDTZvUDtR_ZZykAGGYR/s400/export.png" width="400" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<h2 class="separator" style="clear: both; text-align: left;">
Editing OpenStreetMap from Maps </h2>
One thing I have wanted for a while now is happening thanks to <a href="https://plus.google.com/104562511598312921230">Marcus Lundbladh</a> we will have the possibility to do simple editing of OpenStreetMap from GNOME Maps. He has written a more in-detail blog post about it <a href="http://ml4711.blogspot.se/2015/12/the-light-at-end-of-tunnel.html">here.</a><br />
<br />
Right now we have merged support to add/alter fields of information in places that already exist. And we will expand on that and maybe add functionality to add points of interest. A reason to use GNOME Maps is that we use the open data from OpenStreetMap and it feels good to offer a way to give data back.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyR4JhLedHEmTEOJNUgH905ByasvrGQOTmtGYX8r18_-I0X87z2nTXtq5fEQRiEMkOaMX_XVSqlvAmVBUQLIPCwlpJ2xDsLleRcWcJcJrHrTeA7OwOJNNfVyNoHnuADBGfkL_KHwZg7qVr/s1600/signin.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="302" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyR4JhLedHEmTEOJNUgH905ByasvrGQOTmtGYX8r18_-I0X87z2nTXtq5fEQRiEMkOaMX_XVSqlvAmVBUQLIPCwlpJ2xDsLleRcWcJcJrHrTeA7OwOJNNfVyNoHnuADBGfkL_KHwZg7qVr/s320/signin.png" width="320" /></a></div>
<br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhy6MIYeYQ3ikpZIZlAHo7LlBw0Hn83WeZ0UBc0UHeq-SIOWwZm-Ly_QnewENLtgNYsR0i3uaBuCsaq58_IPOkmWCEijx3sCWBL_KrFEAUrOEwqJmGaRD0okwRZMnxfLm_h7UNe6iP4Pbn/s1600/edit.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhy6MIYeYQ3ikpZIZlAHo7LlBw0Hn83WeZ0UBc0UHeq-SIOWwZm-Ly_QnewENLtgNYsR0i3uaBuCsaq58_IPOkmWCEijx3sCWBL_KrFEAUrOEwqJmGaRD0okwRZMnxfLm_h7UNe6iP4Pbn/s320/edit.png" width="320" /></a></div>
<br />
<br />
<br />
<br />
So all of this and more, like going to your last previous location on start-up is what is happening in Maps for 3.20. And we also got two <a href="https://www.gnome.org/outreachy/">Outreachy</a> interns for Maps for this round! I will introduce them and what they will work on in a later blog installment!<br />
<br />Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com6tag:blogger.com,1999:blog-7317348216081392029.post-50016911209582388862015-10-26T09:07:00.000-07:002015-10-26T10:04:15.319-07:00GeoJSON in Maps<div class="separator" style="clear: both; text-align: center;">
<br /></div>
For Maps 3.19.1 release we managed to land some support for showing a <a href="https://en.wikipedia.org/GeoJSON">GeoJSON</a> layer. This means that you can get a GeoJSON file from somewhere then open it with Maps.<br />
<br />
<h4>
Usage</h4>
The different ways to load GeoJSON with Maps is currently...<br />
... from the command line: <i>gnome-maps file.geojson</i><br />
... drag the file to a Maps window<br />
... double click the file to open it with Maps<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLhzn8gMkh6IEPUZOJ38EZ7DhK18HkTTOWAiyC__7081b2TZ25ozVA2DMzc6GGN3xYe4kNe4EzoCXJTDc0Hysp8_NZpzRpNJSeJQCSgJMhRdoSE2dsr2d-oTpGe8WNJPRsXsmC70t8qwEo/s1600/Sk%25C3%25A4rminspelning+fr%25C3%25A5n+2015-10-26+12_21_42.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLhzn8gMkh6IEPUZOJ38EZ7DhK18HkTTOWAiyC__7081b2TZ25ozVA2DMzc6GGN3xYe4kNe4EzoCXJTDc0Hysp8_NZpzRpNJSeJQCSgJMhRdoSE2dsr2d-oTpGe8WNJPRsXsmC70t8qwEo/s400/Sk%25C3%25A4rminspelning+fr%25C3%25A5n+2015-10-26+12_21_42.gif" width="400" /></a></div>
<br />
<br />
In order for double clicking the GeoJSON file to work we need to install the <a href="http://www.iana.org/assignments/media-types/application/vnd.geo+json">application/vnd.geo+json</a> mime-type on the desktop. I have <a href="http://cgit.freedesktop.org/xdg/shared-mime-info/commit/?id=4ed3648868a2c2dddfa8c31aaf660e9d5131fefd">added</a> the mime-type to the <a href="http://www.freedesktop.org/wiki/">freedesktop.org</a> component <a href="http://freedesktop.org/wiki/Software/shared-mime-info/">shared-mime-info</a>. So you will need a release from that module or build it yourself from Git.<br />
<br />
GeoJSON files can be used to create a custom layer above the map. For instance displaying political areas like counties or voting area. An example would be all the municipalities of Norway. <br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqjJnzBzirNEaD7xHWe0STaz8PEXKUlVhMwRhBVxxQYfDRQ0MHE7TepcLXs8CK3vx9GFH7SfRAXVj3GU85vcucYrBqqaHq-XYc1HOZXV-FAgUQeAGJwogjtBfVkTRPqL56vTV6ySl0ZFb5/s1600/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2015-10-26+12-25-15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="390" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqjJnzBzirNEaD7xHWe0STaz8PEXKUlVhMwRhBVxxQYfDRQ0MHE7TepcLXs8CK3vx9GFH7SfRAXVj3GU85vcucYrBqqaHq-XYc1HOZXV-FAgUQeAGJwogjtBfVkTRPqL56vTV6ySl0ZFb5/s400/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2015-10-26+12-25-15.png" width="400" /></a></div>
<br />
<br />
You can also add different places, for instance GUADEC this year will be at Karlsruhe. The bid I saw included four different options for venue. We could map this using GeoJSON (I used <a href="http://geojson.io/">geojson.io</a>) to create a layer showing the different options on the map.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6NeaZ30Ujc48rdZ0nt62A6ORJ58nZawjnfJp4RdIybdEZ79Aq1WyqqeWiEZw2n0YKvVnz1xLJ1jVX4tpXlFJMN0ZNBBRy-i2MeZU-ih7UDRT86Es25pTcaJcLWB8nxAYldCjmm1RsFCB8/s1600/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2015-10-26+12-49-59.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6NeaZ30Ujc48rdZ0nt62A6ORJ58nZawjnfJp4RdIybdEZ79Aq1WyqqeWiEZw2n0YKvVnz1xLJ1jVX4tpXlFJMN0ZNBBRy-i2MeZU-ih7UDRT86Es25pTcaJcLWB8nxAYldCjmm1RsFCB8/s400/Sk%25C3%25A4rmbild+fr%25C3%25A5n+2015-10-26+12-49-59.png" width="400" /></a></div>
<br />
<br />
<h4>
Heavy lifting by Mapbox</h4>
It turns out rendering large sets of GeoJSON is non-trivial. Fortunatly it is something that <a href="https://www.mapbox.com/">Mapbox</a> already has solved with their JavaScript library called <a href="https://www.mapbox.com/blog/introducing-geojson-vt/">geojson-vt</a>. Under the heading of "<i>Rendering big geodata on the fly with GeoJSON-VT"</i> the <a href="https://www.mapbox.com/blog/introducing-geojson-vt/">article</a> describes how the library breaks down the GeoJSON set into vector tiles by filtering out features, optimizing detail and clipping.<br />
<br />
We lift the code into Maps, we have to change the way the geojson-vt modules include each other in order to fit into the gjs way of doing things, but other than that, the code is unchanged. The code is then used to construct a <a href="https://wiki.gnome.org/Projects/libchamplain">libchamplain</a> tile source and is then added as an overlay source to the map view.<br />
<br />
<h4>
Limitations</h4>
Right now the code will only handle GeoJSON files that do not change the <a href="http://geojson.org/geojson-spec.html#coordinate-reference-system-objects">Coordinate Reference System (crs)</a> to something other than the one we are used to (latitude and longitude ranging from -180/-90 to 180/80).<br />
<br />
No styling information is taken into account (except the name property for Points). There is no standard GeoJSON styling style. But we could for instance support the one from <a href="http://geojson.org/geojson-spec.html#coordinate-reference-system-objects">Mapbox</a>.<br />
<br />
<h4>
Future</h4>
Styling and UX for this feature may change before we end up in 3.20. Please try it out and comment and file bugs. It will help us!<br />
<br />
If you want to help out now there are some tasks to look at:<br />
<ul>
<li><a href="https://bugzilla.gnome.org/show_bug.cgi?id=757143">Add support for GeoJSON MultiPoint</a> </li>
<li><a href="https://bugzilla.gnome.org/show_bug.cgi?id=757144">Add support for Mapbox simplestyle styling</a> </li>
<li><a href="https://bugzilla.gnome.org/show_bug.cgi?id=757145">Add support for different CRS in GeoJSON</a> </li>
</ul>
Thanks! Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com5tag:blogger.com,1999:blog-7317348216081392029.post-85716778028284873192015-09-30T05:58:00.001-07:002015-09-30T09:28:19.993-07:00Do you want to contribute to Maps?Right now we have quite a number of tasks in our <a href="https://bugzilla.gnome.org/buglist.cgi?keywords=gnome-love&keywords_type=allwords&list_id=66016&product=gnome-maps&resolution=---">Bugzilla</a> that are suitable for someone that want to get started developing for <a href="https://wiki.gnome.org/Apps/Maps">Map</a>s or GNOME in general.<br />
<br />
I am going to list some of them here and maybe it will pique someones interest. However finding a first task to work on is not all that one need to do in order to start developing for GNOME. You also need to be able to build and run the latest developer version of the GNOME module you want to develop for. In order to get there I will defer to the excellent <a href="https://wiki.gnome.org/action/show/Newcomers?action=show&redirect=GnomeLove">Newcomers guide.</a><br />
<br />
On to the Maps entry tasks!<br />
<br />
<br />
<h2>
<a href="https://bugzilla.gnome.org/show_bug.cgi?id=755847">Remember last location and use it at start up</a></h2>
<div>
This task is about saving the latitude and longitude of the view you are currently viewing so that Maps can go there on start-up. Instead of starting with a view of the world every time.</div>
<div>
<br /></div>
<div>
So in order to solve this you will interact a bit with the <a href="https://developer.gnome.org/gio/stable/GSettings.html">GSettings</a> framework and a bit with the <a href="https://developer.gnome.org/libchamplain/unstable/ChamplainView.html">ChamplainView</a> that contains our map.<br />
<br />
<br /></div>
<div>
<br /></div>
<h2>
<a href="https://bugzilla.gnome.org/show_bug.cgi?id=755780">Use stars instead of hearts for favorite places</a></h2>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_lsGiYquM-43VhzhxSLQqCHmBtZ8D7YgPgo3eVhQQnsECKya8i2W1FIS_SdPNCYh7envmdTceXE0c_uyJo53LlnXyGg3x-ls3CbrlU7S2nfDl70KjlXhyphenhyphen_GcDkcI8FF0YtF65rJqXEOWG/s1600/favorite.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_lsGiYquM-43VhzhxSLQqCHmBtZ8D7YgPgo3eVhQQnsECKya8i2W1FIS_SdPNCYh7envmdTceXE0c_uyJo53LlnXyGg3x-ls3CbrlU7S2nfDl70KjlXhyphenhyphen_GcDkcI8FF0YtF65rJqXEOWG/s320/favorite.png" width="320" /></a></div>
<div>
<br /></div>
<div>
We currently use hearts for favorite places on our Map bubbles. The rest of GNOME use stars. We should use stars as well. So here you will interact a bit with CSS and with UI files.</div>
<div>
<br /></div>
<div>
<br />
<br /></div>
<h2>
<a href="https://bugzilla.gnome.org/show_bug.cgi?id=741423">Implement new mockups for map Bubbles</a></h2>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/maps/popup-expander.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/maps/popup-expander.png" width="320" /></a></div>
<div>
We want to fit more information in our map bubbles. New mockups have been provided in the bugzilla for this task. To solve this you need to, among other things, interact a bit with <a href="https://developer.gnome.org/gtk3/stable/GtkBuilder.html">GtkBuilder ui-files</a>.</div>
<div>
<br />
<br /></div>
<h3>
</h3>
<h3>
</h3>
<h2>
<a href="https://bugzilla.gnome.org/show_bug.cgi?id=745242">Support roundabouts in GraphHopper route results</a></h2>
<div>
GraphHopper now supports roundbouts. But we do not show that in our route planner UI. For this task we need to use the information from GraphHopper in the Maps ui.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
These were a few of our tasks, there are <a href="https://bugzilla.gnome.org/buglist.cgi?keywords=gnome-love&keywords_type=allwords&list_id=66016&product=gnome-maps&resolution=---">More!</a> We want your help and need it to make Maps 3.20 the best release yet!</div>
<div>
<br /></div>
<div>
Thanks!</div>
Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com0tag:blogger.com,1999:blog-7317348216081392029.post-40556743130781971612015-09-12T11:54:00.003-07:002015-09-12T12:00:45.204-07:00Using offline (local) tiles with GNOME MapsI managed to get a freeze exception to include a new feature in Maps for 3.18. It is now possible to use local, offline, tiles by using the <i>--local</i> command line option.<br />
What you need are image map tiles, organized in a standard way in a directory. Then you can point Maps towards that directory and have local tiles usable offline.<br />
<br />
For instance, I downloaded a bounding box of London. In the zoom-levels of 11, 12, 13, 14 and 15. The tiles are organized as Z/X/Y.png. Where Z is zoom-level, X and Y are the <a href="http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames">tile numbers.</a> London at those zoom-levels will be 2750 tiles and about 60M.<br />
<br />
I used a perl script found while googling. Please be advised to follow the tile servers usage policy before attempting bulk downloading of tiles.<br />
<span style="font-size: x-small;"><br /></span><span style="font-size: x-small;">$ tree london/</span><br />
<span style="font-size: x-small;">london/<br />├── 11<br />│ ├── 1022<br />│ │ ├── 679.png<br />│ │ ├── 680.png<br />│ │ ├── 681.png<br />│ │ └── 682.png<br />│ ├── 1023<br />│ │ ├── 679.png<br />│ │ ├── 680.png<br />│ │ ├── 681.png<br />│ │ └── 682.png<br />│ └── 1024<br />│ ├── 679.png<br />│ ├── 680.png<br />│ ├── 681.png<br />│ └── 682.png<br />├── 12<br />│ ├── 2044<br />│ │ ├── 1359.png<br />│ │ ├── 1360.png</span><br />
<br />
Using this I can do:<br />
<blockquote class="tr_bq">
$ jhbuild run gnome-maps --local ~/london</blockquote>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/oZkJhC_vjgY/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/oZkJhC_vjgY?feature=player_embedded" width="320"></iframe></div>
<br />
<br />
So this is kind of an hidden feature. So that we can test using offline tiles before we find a way of getting downloading into Maps. One kind of major issue right now is where do we get the tiles? Bulk downloading tiles from OpenStreetMaps is not very nice. OSM is a non-profit org. run by volunteers on donations. We do not want to leach on bandwidth. So we need a way around this. Maybe host our own?<br />
<br />
Please also consider that when and if you want to download tiles to try this Maps feature. See the <a href="http://wiki.openstreetmap.org/wiki/Tile_usage_policy#Bulk_Downloading">tile usage policy</a> about bulk downloading. And try to follow it!<br />
<br />
Please enjoy!<br />
<table><tbody>
<tr><td><br /></td>
</tr>
</tbody></table>
Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com4tag:blogger.com,1999:blog-7317348216081392029.post-21875417842241292012015-08-10T05:44:00.004-07:002015-08-10T05:44:59.987-07:00GNOME Maps presence at GUADEC 2015<span style="font-family: inherit;"><a href="https://2015.guadec.org/">GUADEC</a><span style="font-family: inherit;"> is </span>the GNOME Users And Developers European Conference. This year it was held in Gothenburg.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">I presented a talk about Client side rendering of <span style="font-family: inherit;">maps<span style="font-family: inherit;"> using MapCSS.</span></span></span><br />
<span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;">I will embed the slide <span style="font-family: inherit;">for that talk to this post. There will also be videos later on, as all talks were recorded.</span></span></span></span><br />
<br />
<span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;">After the core days we ha<span style="font-family: inherit;">d an <span style="font-family: inherit;">o<span style="font-family: inherit;">pportunity</span> to gather an informal Maps <a href="https://en.wikipedia.org/wiki/Birds_of_a_feather_%28computing%29"><span style="font-family: inherit;">B<span style="font-family: inherit;">oF</span></span></a></span></span> </span></span></span></span><br />
<span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;">were interested gathered to talk abou<span style="font-family: inherit;">t <span style="font-family: inherit;">our</span> <a href="https://wiki.gnome.org/Apps/Maps/Roadmap">roadmap</a>. <span style="font-family: inherit;">We also managed to jot down <span style="font-family: inherit;">some ideas for f<span style="font-family: inherit;">uture <a href="https://developers.google.com/open-source/gsoc/">G</a><span style="font-family: inherit;"><a href="https://developers.google.com/open-source/gsoc/">SoC</a> / <a href="http://outreachy.org/">Outreacy</a> <a href="https://wiki.gnome.org/Outreach/SummerOfCode/2016/Ideas">proposals</a>.</span></span></span></span></span></span></span></span></span><br />
<br />
<span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;">You can find the updated roadmap <a href="https://wiki.gnome.org/Apps/Maps/Roadmap">here</a>.</span></span></span></span></span></span></span></span></span><br />
<br />
<span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;">We are late in the 3.1<span style="font-family: inherit;">8</span> c<span style="font-family: inherit;">ycle and we have not had the amoun<span style="font-family: inherit;">t of developer bandwidth we would have liked. But I still want to get in some stuff be<span style="font-family: inherit;">fore the freezes. <span style="font-family: inherit;">I would love some help from you!</span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<br />
<span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;">For </span></span></span>3.20 we are more ambitious. <span style="font-family: inherit;">And we want to land some features.</span></span></span></span></span></span></span></span></span></span></span><br />
<span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;">Right now the plan is to go for:</span></span></span></span></span></span></span></span></span></span></span><br />
<ul>
<li><div class="line862">
Basic editing of <a class="nonexistent" href="https://wiki.gnome.org/OpenStreetMap">OpenStreetMap</a> data from Maps (<a class="https" href="https://bugzilla.gnome.org/show_bug.cgi?id=726628">bug</a>) <span class="anchor" id="line-15"></span></div>
</li>
<li><div class="line862">
Printing of routes (<a class="https" href="https://bugzilla.gnome.org/show_bug.cgi?id=746790">bug</a>) <span class="anchor" id="line-16"></span></div>
</li>
<li><div class="line862">
Opening and displaying geographic annotation and visualization, possibly through <a class="http" href="http://en.wikipedia.org/wiki/Keyhole_Markup_Language">KML files</a> <span class="anchor" id="line-17"></span></div>
</li>
<li><div class="line862">
Integration with OwnCloud (<a class="https" href="https://bugzilla.gnome.org/show_bug.cgi?id=753406">bug</a>) <span class="anchor" id="line-18"></span></div>
</li>
<li><div class="line862">
Some sort of support for <a class="https" href="https://wiki.gnome.org/Apps/Maps/ClientSideRendering">client side rendering</a> <span class="anchor" id="line-19"></span></div>
</li>
<li>Further support for offline tiles <span class="anchor" id="line-20"></span></li>
<li>Someway to download tile </li>
</ul>
<span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;">There are some nice projec<span style="font-family: inherit;">ts and bugs to work on in Maps. If you want to get inv<span style="font-family: inherit;">o<span style="font-family: inherit;">lved <span style="font-family: inherit;">please check out our <a href="https://bugzilla.gnome.org/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=NEEDINFO&keywords=gnome-love&keywords_type=allwords&product=gnome-maps&query_format=advanced">gnome-love bugs.</a><span style="font-family: inherit;"> </span>And come visit us at <a href="irc://irc.gnome.org/gnome-maps">#gnome-map</a><span style="font-family: inherit;"><a href="irc://irc.gnome.org/gnome-maps">s</a> on<span style="font-family: inherit;"> irc.gnome.org.</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br />
<span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;"> </span></span></span></span></span></span></span></span></span></span></span></span></span> </span></span></span><br />
<br />
<iframe frameborder="0" height="400" marginheight="0" marginwidth="0" scrolling="no" src="https://www.slideshare.net/slideshow/embed_code/key/1iceF6Acns7DB" width="476"></iframe>Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com0tag:blogger.com,1999:blog-7317348216081392029.post-85809134627726195422015-07-22T00:11:00.001-07:002015-07-22T01:22:28.946-07:00GUADEC at Folkets Hus Gothenburg<div class="separator" style="clear: both; text-align: center;">
<a href="http://folketshusgoteborg.se/content/uploads/Folkets-Hus_4-copy_huvudbild.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://folketshusgoteborg.se/content/uploads/Folkets-Hus_4-copy_huvudbild.jpg" height="172" width="400" /></a></div>
<br />
<br />
<span style="font-family: inherit;"><a href="https://2015.guadec.org/">GUADEC</a> is the GNOME Users And Developers European Conference. It is an annual conference taking place in Europe, whose prime topic is the development of the GNOME desktop environment.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">This year GUADEC will take place at Gothenburg, Sweden on August 7 – 9 the core days at Folkets Hus. </span><span style="font-family: inherit;">I am not sure that people are aware of what a Folkets Hus is, so I thought I'd take a moment to write something about them and their history.</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.upplandia.se/bilder/H%C3%A4ver%C3%B6/H%C3%A4ver%C3%B6%20-%20Vykort/slides/H%C3%A4ver%C3%B6%20-%20Herr%C3%A4ng%20Folkets%20Hus.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://www.upplandia.se/bilder/H%C3%A4ver%C3%B6/H%C3%A4ver%C3%B6%20-%20Vykort/slides/H%C3%A4ver%C3%B6%20-%20Herr%C3%A4ng%20Folkets%20Hus.jpg" height="207" style="cursor: move;" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
At the end of the 19th century, the trade unions and the labour movement began to organise themselves in earnest. This meant they needed places to get together, to hold meetings and for education. This might seem innocent enough, but the opposition was great. Workers were not welcome to use existing premises. Landowners forbade open-air meetings, as fear for revolutionary ideas was great.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.malmofolketspark.se/wp-content/uploads/2013/08/B3VoUUKV8BgvxEhIyT_DvS0ljGo7d8Oz3Kc3COu-2-Q.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://www.malmofolketspark.se/wp-content/uploads/2013/08/B3VoUUKV8BgvxEhIyT_DvS0ljGo7d8Oz3Kc3COu-2-Q.png" height="200" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
So the labour movement in southern Sweden decided to buy land, build houses and use them for their organisational needs without interference. The idea spread and all over the country Folkets Hus was constructed. And not only houses: Amusement Parks, Zoos, Open Air theaters, Cinemas and much more. The Folkets Hus movement was important for making the labour movement a part of peoples lives. Today the People's park and communiy centre movement is made up of about 600 meeting places in Sweden.<br />
<br />
The People's park are a natural part of many cities and their connection to the early days of the labour movement are beginning to fade away in common memory.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://www.malmo-time.se/uploads/image/1005%20GRUPPER/4%20Annat%20kul/4_folkets_park_grasmattan_picnic_malmo_sweden_malmotime_se.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://www.malmo-time.se/uploads/image/1005%20GRUPPER/4%20Annat%20kul/4_folkets_park_grasmattan_picnic_malmo_sweden_malmotime_se.JPG" height="215" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">People's park in Malmö</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
The Folkets Hus in Gothenburg, where GUADEC will be held, was constructed between 1948 and 1951. In 1956 a cinema and restaurant/dance hall was added.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://folketshusgoteborg.se.customer.i8t.com/content/uploads/Danssalongen_1_1957.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://folketshusgoteborg.se.customer.i8t.com/content/uploads/Danssalongen_1_1957.jpg" height="248" width="320" /></a></div>
<br />
Since then people have gathered there for dance, movies, study circles and for meetings and social events. Today Folkets Hus in Gothenburg acts as a venue for <a href="http://folketshusgoteborg.se/konferenslokaler/">conferences</a> a part of <a href="http://www.giff.se/en">Göteborg Film Festival</a> a workplace for hundreds of people and a home to a large art collection.<br />
<br />
I hope you will enjoy it here!Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com2tag:blogger.com,1999:blog-7317348216081392029.post-72480713437279952172015-05-05T13:34:00.001-07:002015-05-06T00:25:54.489-07:00Client side rendering of our map using MapCSS!We want to support an offline mode in <span id="goog_86427398"></span><a href="https://www.blogger.com/">GNOME Maps</a><span id="goog_86427399"></span>. A mode where you could download an area and have the map data available even if you do not have an Internet connection. The problem is that we are currently using pre-rendered bitmaps. We download them and we show them. This makes supporting an offline mode a bit tough since the amount of data we would have to save would be large.<br />
<br />
We have talked off and on about how neat it would be if we could download some kind of vector data and render the map ourselves. But never really made any progress. Until now, kind of.<br />
<br />
I have been working on a library that I call<a href="https://github.com/jonasdn/vector-tile-glib"> Vector-tile-glib</a>. This library will parse and render the <a href="https://www.mapbox.com/developers/vector-tiles">Mapbox Vector tile format</a>, and style it using <a href="http://wiki.openstreetmap.org/wiki/MapCSS/0.2">MapCSS</a>. I have hacked a bit on evenings and other spare times when my son has been asleep. It has been fun. It is not done, nor stable. But it has reached a point where I want to tell more people about it and maybe even get some help. There is much left to do, and many many rough edges.<br />
<br />
So what I have now is pretty much something that parses the vector tile and can output something to a <a href="http://cairographics.org/">Cairo</a> context using MapCSS. Or in pictures:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVshtCNgAT2q1KrAqhaJIb-AK8jSUjbr2KLPyuP5LlSngSleDNRhCcSniu5x6rB2R4VFampPS4m3FGg6K6oCR2scOMq3QsyB4IYMvV0Wwklpo52t5HPqEWZ9i_hzk_nuhyphenhyphenaUuPCsNSEo6L/s1600/image.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVshtCNgAT2q1KrAqhaJIb-AK8jSUjbr2KLPyuP5LlSngSleDNRhCcSniu5x6rB2R4VFampPS4m3FGg6K6oCR2scOMq3QsyB4IYMvV0Wwklpo52t5HPqEWZ9i_hzk_nuhyphenhyphenaUuPCsNSEo6L/s1600/image.png" height="200" width="200" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<b>+</b></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPcESbX4QWlRBMRHtfuKMf6OP3k-BLu-IXR88SsHHgxbaFOJVV3gO4ABsBscfx_Pt8or98vAz385wGHh_oQVhspyvuVfK06yARfzyanVjG17pTSBqDJCasl6fR-INEYyIYm2QfwPnzMVGQ/s1600/mapcss.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPcESbX4QWlRBMRHtfuKMf6OP3k-BLu-IXR88SsHHgxbaFOJVV3gO4ABsBscfx_Pt8or98vAz385wGHh_oQVhspyvuVfK06yARfzyanVjG17pTSBqDJCasl6fR-INEYyIYm2QfwPnzMVGQ/s1600/mapcss.png" height="320" width="300" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
=</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK0LqTHi76RlkOYA_J9xymkm1Islr3XI0satDFJLTGUE6TzD-31nHXfjGc4hI3dUMwxGjkz4G09iwbC570c0N91Wkr6f7j6eDO5aEkRo_ts6vBZ4lYlFbm-0g-HtoFOxx3e5ApWtW5Z5LW/s1600/image.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK0LqTHi76RlkOYA_J9xymkm1Islr3XI0satDFJLTGUE6TzD-31nHXfjGc4hI3dUMwxGjkz4G09iwbC570c0N91Wkr6f7j6eDO5aEkRo_ts6vBZ4lYlFbm-0g-HtoFOxx3e5ApWtW5Z5LW/s1600/image.png" height="200" width="200" /></a></div>
<br />
<br />
In order to try it out I have also written a subclass of a <a href="https://wiki.gnome.org/Projects/libchamplain">Champlain</a> renderer in Maps so we can try this library out in real time. The work is on a branch on the <a href="https://git.gnome.org/browse/gnome-maps/log/?h=wip/jonasdn/vector-tiles">GNOME Maps git repository</a> called<b> wip/jonasdn/vector-tiles</b>, try it out!<br />
<a href="https://plus.google.com/107646837068615384568/about">Andreas Nilsson</a> and <a href="https://plus.google.com/104562511598312921230/posts">Marcus Lundblad</a> have been helping me out with an initial style. Join them!<br />
<br />
For you to try this, build Maps from the wip branch, then choose the aerial view to get the client side rendered map. Like in the video below:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/Ur24vH2UC7s/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/Ur24vH2UC7s?feature=player_embedded" width="320"></iframe></div>
<br />
<br />
You can also try out live editing the MapCSS, like in this video:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/1egb6AFi-p8/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/1egb6AFi-p8?feature=player_embedded" width="320"></iframe></div>
<br />
<br />
There are also tools to use in the vector-tile-glib repo, for rendering to PNG, dumping tags from a vector tile and downloading tiles from Mapzen tile service. See the <a href="https://github.com/jonasdn/vector-tile-glib">Github README.md</a> for more details on them.<br />
<br />
I think this could be something cool to have. Partly for providing a path towards offline Maps and partly to have a map style of our GNOME. Help is appreciated! I am not a parser person or a render person, so I am sure I have made a bunch of really silly mistakes. Pointing them out would be helpful!<br />
<br />Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com10tag:blogger.com,1999:blog-7317348216081392029.post-28692087138129287542014-04-22T05:41:00.000-07:002014-04-22T05:44:36.575-07:00What's coming in Maps 3.14 and beyond<a href="https://wiki.gnome.org/Apps/Maps/">GNOME Maps</a> is a simple maps application being developed in javascript, using the <a href="https://wiki.gnome.org/action/show/Projects/Gjs">Gjs</a> bindings. The map data for Maps comes from <a href="http://en.wikipedia.org/wiki/OpenStreetMap">OpenStreetMap</a> which is a collaborative project to create a free and editable map of the world.<br />
<br />
Maps began as a preview in GNOME 3.10 and is still under active <a href="https://git.gnome.org/browse/gnome-maps/">development</a>.<br />
<br />
<h3>
How it looks today </h3>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglYcHtCGiEHB7mYXl0ykXuFIE99zbW7h44xdhz34ii2Ul_jQ-7C242GIpZQCRWSKDRT9tX8dnGmermqN2V-U2KQs0gI6hwIP-fDsUj2R_QS5HPHTkE-8ZLoxGBPn_xJ_C7V3LAxLH1uvBP/s1600/Screenshot+from+2014-04-21+12:45:27.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglYcHtCGiEHB7mYXl0ykXuFIE99zbW7h44xdhz34ii2Ul_jQ-7C242GIpZQCRWSKDRT9tX8dnGmermqN2V-U2KQs0gI6hwIP-fDsUj2R_QS5HPHTkE-8ZLoxGBPn_xJ_C7V3LAxLH1uvBP/s1600/Screenshot+from+2014-04-21+12:45:27.png" height="179" width="320" /></a></div>
<br />
Two map types are provided, one aerial and one street type.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxLf4V8CEc_-yB8gjrCW57ZC8CRV_rCSNJRWSPHrVLpnJ8B7GeInl5Ndqzye8M9pOTJe7n6uEnBZLNMI3tYXacolW0cbERzpHqP-GpcITf1Yq1RtVExfGDOc_0zyFbn7dfKQUHYbwgKJBB/s1600/Screenshot+from+2014-04-21+13:49:44.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxLf4V8CEc_-yB8gjrCW57ZC8CRV_rCSNJRWSPHrVLpnJ8B7GeInl5Ndqzye8M9pOTJe7n6uEnBZLNMI3tYXacolW0cbERzpHqP-GpcITf1Yq1RtVExfGDOc_0zyFbn7dfKQUHYbwgKJBB/s1600/Screenshot+from+2014-04-21+13:49:44.png" height="179" width="320" /></a></div>
<br />
We use the <a href="http://www.freedesktop.org/wiki/Software/GeoClue/">Geoclue</a> D-Bus service to try to pinpoint your location with the most accuracy it can manage.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTTDXFsGFbHDQs3OOGDbG9wWw9VMwEna-7MnTtNwBTkhDlLmxkGGA97rnXTJX5invXhH1i21pirCZfktLCSUaD1ElDjPEFNo4SLcIrsVpwW0HyvCArOUH34gPhVdKXJDMAygzfrJvFVvyi/s1600/Screenshot+from+2014-04-21+12%253A43%253A47.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTTDXFsGFbHDQs3OOGDbG9wWw9VMwEna-7MnTtNwBTkhDlLmxkGGA97rnXTJX5invXhH1i21pirCZfktLCSUaD1ElDjPEFNo4SLcIrsVpwW0HyvCArOUH34gPhVdKXJDMAygzfrJvFVvyi/s1600/Screenshot+from+2014-04-21+12%253A43%253A47.png" height="179" width="320" /></a></div>
<br />
The search-entry will auto-complete. Not against the search server because that would violate the terms of agreement with <a href="http://wiki.openstreetmap.org/wiki/Nominatim">Nominatim</a> the search service we currently use. But Maps keep track of the recent-places you have visited and completes against them. And will also complete against bookmarked places and contacts later on.<br />
<br />
This, among some other things, is what Maps can do today. There are plans and mockups brewing though. And I would like to go through some of them here.<br />
<br />
<h3>
Route search</h3>
There is work under way to provide route search to Maps. This will be done using <a href="http://graphhopper.com/">GraphHopper</a> an open source road routing enginge. <a href="http://whitetuesdays.blogspot.se/">Mattias Bengtsson</a> started this project as GSoC project and the patches will soon be under heavy review. When this has landed Maps users will be able to find routes for car, bicycle and walking.<br />
<br />
Bug for routing implementation <a href="https://bugzilla.gnome.org/show_bug.cgi?id=728695">here</a>.<br />
<br />
To illustrate how this could look in Maps I have here a video from quite some time a go that demos the functionality. The final result may look different and probably better as well.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/CA-kuKMSlkA?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
We also have a GSoC student, Dario Di Nucci, looking into adding support
for intermediate points, or via points, to GraphHopper so that we can
use them in Maps!<br />
<br />
<h3>
Point of interests (POI)</h3>
Often when you are using a map application you want to actually find out something about the world around you. For instance where the nearest restaurant, ATM, bathroom or pub is located.<br />
<br />
This is something that Maps also want to do. We have plans of showing you the POI's near you as icons overlayed the map. One idea is that this will kick in at appropriate zoom-levels and show you a small icon that represents, for instance a pub.<br />
I have for you a small mockup video of the concept.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dwP0de1mZEyOT964Ch7RmRPwklCzfG5bojdxyYebv395qCUj-WQHkiA867q4zwVsyUmSseDvOHYLFeOgtTJ' class='b-hbp-video b-uploaded' frameborder='0'></iframe></div>
<br />
We have been accepted to this years GSoC and will have student looking in to this.<br />
Rishi Raj Singh Jhelumi will be working on this functionality. Both the overlaying of POI icons and figuring out where (which service) to get the POI data from.<br />
<br />
<h3>
Contact data and check-ins</h3>
Another idea that we are thinking about is to integrate your contacts in Maps. So that the search auto-completes to the address of your contacts. And also possible having them appear in the same way that the POI's do in the section above.<br />
<br />
Similar to this is the integration of check-in information. So that you can see on the map where people you are connected to have checked-in using Facebook or FourSquare.<br />
<br />
We will have a GSoC student working on this as well! Damián Nohales will be looking at integrating this to Maps and also have a look at enriching our map markers to have some actual useful information in a pretty way.<br />
<br />
<h3>
Map markers</h3>
Right now we use those little black markers as seen on the screenshot above to mark a place on the map. They do not provide much information about the place and there is really not much you can interact with.<br />
<br />
Our plan is to replace them with GtkPopovers. Our designers have created some nice mockups for this and you can look at them <a href="https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/maps/v2/markers-and-bubbles.png">here</a>. And a sneak preview below, the mockups also contains ideas on how and when different markers should be used.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1kmCSIBSe9UjxVZrhlbxduzyfic5J7yjflumPjk56HhIGj7C9spciUzoHjNtYR7AWdvv2CrBWQF3P7vUoK6TC6SwKK3UZQFLJNSDMeWZovdRiKre0JC5pMIQTtQfFXagGD-nB_jFclvvD/s1600/markers.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1kmCSIBSe9UjxVZrhlbxduzyfic5J7yjflumPjk56HhIGj7C9spciUzoHjNtYR7AWdvv2CrBWQF3P7vUoK6TC6SwKK3UZQFLJNSDMeWZovdRiKre0JC5pMIQTtQfFXagGD-nB_jFclvvD/s1600/markers.png" height="224" width="320" /></a></div>
<br />
<br />
<h3>
Talking to other GNOME applications</h3>
A <a href="https://bugzilla.gnome.org/show_bug.cgi?id=728117">bug</a> has been filed to Maps asking to add links to GNOME Weather and Clocks, so that one could easily find out time and weather information about a place. A use-case might be.<br />
<blockquote class="tr_bq">
<pre class="bz_comment_text" id="comment_text_6">I'll be travelling there, and I know the weather/time
are different, so I want to add check the weather to pack
ahead of me going there.</pre>
</blockquote>
This is something that might be coming to Maps, but the designers have not yet provided any feedback on the idea.<br />
<br />
<h3>
Beyond, search, editing and custom maps?</h3>
As mentioned above the search service Nominatim does not allow us to auto-complete against the search results. This could be dealt with by hosting our own instance of Nominatim, or looking elsewhere for searching.<br />
<br />
One thing that I think Maps stand out and bring extra value is for me the use of the collaborative mapping project OpenStreetMap (OSM). Going forward I would like to see a way to add and update the OSM database through Maps. There is a <a href="https://bugzilla.gnome.org/show_bug.cgi?id=726628">bug</a> for this in bugzilla with this comment from <a href="http://zee-nix.blogspot.se/">Zeeshan Ali</a>:<br />
<blockquote class="tr_bq">
<pre class="bz_comment_text" id="comment_text_1">This would also make us the first OSM editor that works
out of the box w/o requiring java. :) All editors I've
tried so far are either mainly targetted for editing small
parts of the map (some of them even don't all you any editing
until you zoom enough) or they are very difficult to use.</pre>
</blockquote>
<br />
Another thing I think would be cool for Maps is an easy way to create custom overlays for Maps. To Show interesting data with geo connection. Like the infant mortality rate per country, unemployment per Swedish municipality or maybe GNOME contributors density.<br />
<br />
If you have any ideas of features that will not distract from the goal of being a simple map application foremost, please contact us and/or <a href="https://bugzilla.gnome.org/browse.cgi?product=gnome-maps">get involved!</a>Jonas Danielssonhttp://www.blogger.com/profile/04799688851937428458noreply@blogger.com0