<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="https://blog.geothings.ch/feed_style.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <tabi:metadata xmlns:tabi="https://github.com/welpo/tabi">
        <tabi:base_url>https://blog.geothings.ch</tabi:base_url>
        <tabi:separator>
            •
        </tabi:separator>
        <tabi:about_feeds>
            This is a web feed, also known as an Atom feed. Subscribe by copying the URL from the address bar into your newsreader. Visit About Feeds to learn more and get started. It's free.
        </tabi:about_feeds>
        <tabi:visit_the_site>
            Visit website
        </tabi:visit_the_site>
        <tabi:recent_posts>
            Recent posts
        </tabi:recent_posts>
        <tabi:last_updated_on>
            Updated on $DATE
        </tabi:last_updated_on>
        <tabi:default_theme></tabi:default_theme>
        <tabi:post_listing_date>date</tabi:post_listing_date>
        <tabi:current_section>tutorial</tabi:current_section>
    </tabi:metadata><link rel="extra-stylesheet" href="https://blog.geothings.ch/skins/mint.css?h=504215cf6bc10586b487" /><title>geothings - tutorial</title>
        <subtitle>spatial data | open source | oversharing</subtitle>
    <link href="https://blog.geothings.ch/tags/tutorial/atom.xml" rel="self" type="application/atom+xml"/>
    <link href="https://blog.geothings.ch/tags/tutorial/" rel="alternate" type="text/html"/>
    <generator uri="https://www.getzola.org/">Zola</generator><updated>2024-09-28T00:00:00+00:00</updated><id>https://blog.geothings.ch/tags/tutorial/atom.xml</id><entry xml:lang="en">
        <title>How to build a single file QGIS project?</title>
        <published>2024-09-28T00:00:00+00:00</published>
        <updated>2024-09-28T00:00:00+00:00</updated>
        <author>
            <name>jujube</name>
        </author>
        <link rel="alternate" href="https://blog.geothings.ch/blog/single-file-qgis/" type="text/html"/>
        <id>https://blog.geothings.ch/blog/single-file-qgis/</id>
        
            <content type="html">&lt;p&gt;We talked about &lt;a rel=&quot;external&quot; href=&quot;https://www.geothings.ch/posts/managing-shared-qgis-projects/&quot;&gt;how to collaborate on QGIS project&lt;/a&gt; at a “project management” level, but in practice, how do you make things easy for you to easily share a project. Well, one way is to minimize the amount of files by:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Storing your project in database&lt;/li&gt;
&lt;li&gt;Storing your data in database&lt;/li&gt;
&lt;li&gt;Storing your styles in database&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;introducing-geopackage&quot;&gt;Introducing Geopackage&lt;/h2&gt;
&lt;p&gt;Geopackage is basically a SQLite database with well defined rules for storing geospatial data. You get a single file that can contain all your data, stored in different layers. The standard has been extended to allow &lt;a rel=&quot;external&quot; href=&quot;https://www.geopackage.org/extensions.html&quot;&gt;storage of QGIS projects&lt;/a&gt;, which allows to bundle a lot into a single file.&lt;/p&gt;
&lt;h2 id=&quot;storing-your-project-in-geopackage&quot;&gt;Storing your project in Geopackage&lt;/h2&gt;
&lt;p&gt;The first step would be to store your new project into a GPKG file. Open QGIS and create a new Geopackage database:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Layer &amp;gt; Create a new layer &amp;gt; New Geopackage layer&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Then you can save your project in this newly created Geopackage:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Project &amp;gt; Save To &amp;gt; GeoPackage...&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And that’s it, you can then open this project from QGIS:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Project &amp;gt; Open from &amp;gt; GeoPackage...&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;You now have a Geopackage containing your project.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;GeoPackage&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Project&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;storing-your-data-in-geopackage&quot;&gt;Storing your data in Geopackage&lt;/h2&gt;
&lt;p&gt;It’s rather self-explanatory, your can store all the data used in your project in the same Geopackage. If you use shapefile, &lt;a rel=&quot;external&quot; href=&quot;https://switchfromshapefile.org/&quot;&gt;please stop&lt;/a&gt;, it been making no sense for a while now.&lt;/p&gt;
&lt;p&gt;Convert your data into Geopackage layer by right clicking on your layer of interest:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Export &amp;gt; Save features as... &amp;gt; GeoPackage&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Select the Geopackage database containing your project as &lt;code&gt;File name&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;At this point you should already have your project and data in a single file, which is already way easier than managing multiple data sources.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;GeoPackage&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Project&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Data&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;layer 1&lt;/li&gt;
&lt;li&gt;layer 2&lt;/li&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;storing-styles&quot;&gt;Storing styles&lt;/h2&gt;
&lt;p&gt;Having your data stored is nice, but styles are also important to add symbologies and capabilities to your layers. Geopackage also allow to store your style directly.&lt;/p&gt;
&lt;p&gt;Define your layers styles (forms, symbologies, actions etc.) and then right click on your layer:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Properties... &amp;gt; Symbology &amp;gt; Style &amp;gt; Save Style... &amp;gt; In Database&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And hey you can even go further! If you have .svg symbols in your style, you can load the symbol definition in the Geopackage. Like this you avoid broken links and unfound .svg file.&lt;/p&gt;
&lt;p&gt;To do this, first create a new table in your Geopackage:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Layer &amp;gt; Create Layer &amp;gt; New GeoPackage Layer...&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Select your Geopackage and fill the layer name (&lt;code&gt;symbols&lt;/code&gt; or whatever you like). Then under &lt;code&gt;New Field&lt;/code&gt;, add a field of type &lt;code&gt;Binary Object (BLOB)&lt;/code&gt; and create the layer.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://blog.geothings.ch/blog/single-file-qgis/add_svg_definition.PNG&quot; alt=&quot;alt text&quot; /&gt;
&lt;em&gt;Add svg to Geopackage&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Then add a new feature in your &lt;code&gt;symbols&lt;/code&gt; and embed your .svg file in the BLOB column.&lt;/p&gt;
&lt;p&gt;Finally, from your data layer symbology, select the &lt;code&gt;SVG Marker&lt;/code&gt; symbol type and &lt;code&gt;Edit&lt;/code&gt; the definition of the SVG with the rule of your choice, for example:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&#39;base64:&#39;|| to_base64(attribute(get_feature( &#39;symbols&#39;, &#39;fid&#39;, 1), &#39;svg&#39;))&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Here we’ll use the symbol with the &lt;code&gt;fid&lt;/code&gt; value 1. You can create the rule that wou want, but make sure to encode the binary definition into base64.&lt;/p&gt;
&lt;div class=&quot;admonition tip&quot;&gt;
&lt;div class=&quot;admonition-icon admonition-icon-tip&quot;&gt;&lt;/div&gt;
&lt;div class=&quot;admonition-content&quot;&gt;
&lt;strong class=&quot;admonition-title&quot;&gt;TIP&lt;/strong&gt;
&lt;p&gt;You can also directly embed the file instead of creating the rule, you’ll just lose some flexibility in the choice of you symbol. A rule-based choice would allow you to use different SVG definitions based on a attribute for example.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;At this point you should be in a situation like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;GeoPackage&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Project&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Data&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;layer 1&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Style 1&lt;/li&gt;
&lt;li&gt;Style 2&lt;/li&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;layer 2&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Style 1&lt;/li&gt;
&lt;li&gt;Style 2&lt;/li&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;…&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Which should be enough to cover the needs of most projects, all of this in a single file! Now it’s way easier to share, and there is no risk of breaking a link.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Easy right? And the best in all that, is that you can do exactly the same with a PostgreSQL database: storing your QGIS project, storing data (obviously) and storing your styles. It just take some “pre-procesing” by saving your data into your GPKG/PostgreSQL database, but you’ll want to do that anyway, and if you don’t, I assure you you want to.&lt;/p&gt;
</content>
        </entry><entry xml:lang="en">
        <title>Serving vector tiles with Martin</title>
        <published>2023-12-20T00:00:00+00:00</published>
        <updated>2023-12-20T00:00:00+00:00</updated>
        <author>
            <name>jujube</name>
        </author>
        <link rel="alternate" href="https://blog.geothings.ch/blog/vector-tiles-with-martin/" type="text/html"/>
        <id>https://blog.geothings.ch/blog/vector-tiles-with-martin/</id>
        
            <content type="html">&lt;p&gt;There are some amazing tools out there, and they are getting build fast. I haven’t had the opportunity to work with vector tiles during my day-to-day jobs, but I wanted to explore what it is and how to set some things up, just for the fun of it. We’ll see here how to start using &lt;a rel=&quot;external&quot; href=&quot;https://github.com/maplibre/martin&quot;&gt;Martin&lt;/a&gt;, a vector tile server built in Rust serving PostGIS data.&lt;/p&gt;
&lt;h2 id=&quot;vector-tiles&quot;&gt;Vector tiles&lt;/h2&gt;
&lt;p&gt;The standard has been set by &lt;a rel=&quot;external&quot; href=&quot;https://www.mapbox.com/&quot;&gt;Mapbox&lt;/a&gt;. In the same manner a WMTS serves raster tiles, vector tiles allow for the visualization of large volumes of data over the web, but as their name suggests, they are vectors.&lt;/p&gt;
&lt;p&gt;It comes with some advantages compared to raster formats:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It’s significantly lighter, about 20 to 50% of its raster equivalent according to &lt;a rel=&quot;external&quot; href=&quot;https://documentation.maptiler.com/hc/en-us/articles/4411234458385-Raster-vs-Vector-Map-Tiles-What-Is-the-Difference-Between-the-Two-Data-Types-&quot;&gt;MapTiler&lt;/a&gt;. Vector data are series of points and each pixel of the map doesn’t have to have information declared; a rectangle polygon covering thousands of square kilometers can still be defined with 4 points.&lt;/li&gt;
&lt;li&gt;It is stylized dynamically. While raster tiles need to be generated with their style embedded, vector tiles style can just be modified on the fly, without going through the laborious process of tiles generation that can take easily several hours/days.&lt;/li&gt;
&lt;li&gt;It’s fast. Moving through a vector tile map feels smooth, there is no apparent tile loading.&lt;/li&gt;
&lt;li&gt;What you request is what you get. You directly query the tiles, not some sort of other service along your tiles.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;It’s an amazing standard to visualize spatial data in a web map. Obviously it’s not suitable for all kinds of data, you have to have discrete data that make sense to be visualized as vector; I doubt that raw satellites images as vector tiles are a good idea.&lt;/p&gt;
&lt;h2 id=&quot;installing-postgresql-and-postgis&quot;&gt;Installing PostgreSQL and PostGIS&lt;/h2&gt;
&lt;p&gt;First thing first, we need to store data somewhere. Martin is designed to be used with PostGIS, PMTiles and MBTiles, we’ll explore the PostGIS alternative.&lt;/p&gt;
&lt;p&gt;The following commands were used on an Ubuntu distribution.&lt;/p&gt;
&lt;p&gt;Let’s start by installing PostgreSQL:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-3 z-i&quot;&gt;apt&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; install postgresql&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then the PostGIS extension:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-3 z-i&quot;&gt;apt&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; install postgis&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We’ll already set things up in the database by creating a dedicated user, creating a database and creating the PostGIS extension in there. From psql, create a user:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;sql&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-9&quot;&gt;create user&lt;/span&gt;&lt;span class=&quot;z-3 z-i&quot;&gt; martin_usr&lt;/span&gt;&lt;span class=&quot;z-9&quot;&gt; with password&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; &amp;#39;my_password&amp;#39;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Create a database:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;sql&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-9&quot;&gt;create database&lt;/span&gt;&lt;span class=&quot;z-3 z-i&quot;&gt; martin_db&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Go to your new database (&lt;code&gt;\c martin_db&lt;/code&gt;) and create the extension:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;sql&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-9&quot;&gt;create&lt;/span&gt;&lt;span&gt; extension postgis;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We won’t cover here the more extensive tuning of the database. You should be set on the database side for this example.&lt;/p&gt;
&lt;h2 id=&quot;downloading-some-data&quot;&gt;Downloading some data&lt;/h2&gt;
&lt;p&gt;Obviously you’ll want some data to serve as vector tiles. In a production environment you’ll probably want to serve your own data, so this step would probably not be necessary. For the example we don’t have any data yet, so we’ll use some from osm through &lt;a rel=&quot;external&quot; href=&quot;https://download.geofabrik.de/&quot;&gt;GeoFabrik&lt;/a&gt;. Since I’m in Switzerland, let’s download data over the country:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-3 z-i&quot;&gt;curl&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; https://download.geofabrik.de/europe/switzerland-latest.osm.pbf -O&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We are using &lt;code&gt;osm2pgsql&lt;/code&gt; to import data into the database, so the &lt;code&gt;.pbf&lt;/code&gt; format is ideal.&lt;/p&gt;
&lt;p&gt;You can then load your data (&lt;code&gt;apt install osm2pgsql&lt;/code&gt; if you don’t have the tool):&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-3 z-i&quot;&gt;osm2pgsql&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; -d martin_db -U martin_usr switzerland-latest.osm.pbf&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We now have osm data over a whole country, easy right?&lt;/p&gt;
&lt;h2 id=&quot;now-install-martin&quot;&gt;Now install Martin&lt;/h2&gt;
&lt;p&gt;Here comes the best part, the vector tile server itself. There are multiple ways to start working with Martin, we’ll use rust and its package manager &lt;a rel=&quot;external&quot; href=&quot;https://doc.rust-lang.org/book/ch01-03-hello-cargo.html&quot;&gt;cargo&lt;/a&gt;. If you don’t want to install those on your server you might prefer the &lt;a rel=&quot;external&quot; href=&quot;https://maplibre.org/martin/run-with-docker.html&quot;&gt;Docker installation&lt;/a&gt;, or simply using binaries.&lt;/p&gt;
&lt;p&gt;As said earlier, Martin is build in rust, and it’s accessible as a crate using cargo. You can first &lt;a rel=&quot;external&quot; href=&quot;https://www.rust-lang.org/tools/install&quot;&gt;install rust&lt;/a&gt;:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-3 z-i&quot;&gt;curl&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; --proto &amp;#39;=https&amp;#39; --tlsv1.2 -sSf https://sh.rustup.rs&lt;/span&gt;&lt;span class=&quot;z-1&quot;&gt; |&lt;/span&gt;&lt;span class=&quot;z-3 z-i&quot;&gt; sh&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then install Martin:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-3 z-i&quot;&gt;cargo&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; install martin&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-3 z-i&quot;&gt;martin&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; --help&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And that’s it! Martin’s here.&lt;/p&gt;
&lt;h2 id=&quot;can-t-be-that-simple-right&quot;&gt;Can’t be that simple right?&lt;/h2&gt;
&lt;p&gt;Finally, you can run your new server:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-3 z-i&quot;&gt;martin&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; &amp;quot;postgresql://martin_usr:my_password@localhost:5432/martin_db&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Martin can discover geometric tables in the database from the given url, so by default everything is served. So yes it can be that simple! Obviously environment variables need to be set, passwords hidden etc. But you have an idea of the process.&lt;/p&gt;
&lt;p&gt;You can try by yourself reading the catalog:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-3 z-i&quot;&gt;curl&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; http://0.0.0.0:3000/catalog&lt;/span&gt;&lt;span class=&quot;z-1&quot;&gt; |&lt;/span&gt;&lt;span class=&quot;z-3 z-i&quot;&gt; json_pp&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;json&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;   &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;fonts&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;&amp;quot; : {},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;   &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;sprites&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;&amp;quot; : {},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;   &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;tiles&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;&amp;quot; : {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;      &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;planet_osm_line&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;&amp;quot; : {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;         &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;content_type&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;&amp;quot; :&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; &amp;quot;application/x-protobuf&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;         &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;&amp;quot; :&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; &amp;quot;public.planet_osm_line.way&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;      },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;      &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;planet_osm_point&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;&amp;quot; : {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;         &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;content_type&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;&amp;quot; :&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; &amp;quot;application/x-protobuf&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;         &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;&amp;quot; :&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; &amp;quot;public.planet_osm_point.way&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;      },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;      &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;planet_osm_polygon&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;&amp;quot; : {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;         &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;content_type&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;&amp;quot; :&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; &amp;quot;application/x-protobuf&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;         &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;&amp;quot; :&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; &amp;quot;public.planet_osm_polygon.way&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;      },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;      &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;planet_osm_roads&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;&amp;quot; : {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;         &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;content_type&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;&amp;quot; :&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; &amp;quot;application/x-protobuf&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;         &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;z-4&quot;&gt;&amp;quot; :&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; &amp;quot;public.planet_osm_roads.way&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;   }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-4&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;visualize-data-using-qgis&quot;&gt;Visualize data using QGIS&lt;/h2&gt;
&lt;p&gt;Once the server is running we can easily visualize our data in a client. Starting QGIS 3.14,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Layer&lt;/em&gt; &amp;gt; &lt;em&gt;Add Layer&lt;/em&gt; &amp;gt; &lt;em&gt;Add Vector Tile Layer&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And enter the url then &lt;em&gt;OK&lt;/em&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;http://localhost:3000/planet_osm_line,planet_osm_point,planet_osm_polygon/{z}/{x}/{y}&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src=&quot;https://blog.geothings.ch/blog/vector-tiles-with-martin/add-vector-tiles.png&quot; alt=&quot;add-vector-tiles&quot; /&gt;&lt;/p&gt;
&lt;p&gt;You should see a rather absurd amount of data.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://blog.geothings.ch/blog/vector-tiles-with-martin/visualization.png&quot; alt=&quot;visualization&quot; /&gt;&lt;/p&gt;
&lt;h2 id=&quot;to-conclude&quot;&gt;To conclude&lt;/h2&gt;
&lt;p&gt;Here is how to get started with Martin, a rust vector tile server. It’s just the start, we don’t cover here the creation of symbology and more in depth configurations and optimization, but it gives an idea of how easy and powerful such a tool can be.&lt;/p&gt;
</content>
        <summary type="html">Vector tiles seems nice, let&#39;s see who&#39;s Martin.</summary>
        </entry>
</feed>
