Skip to main content
22 votes
Accepted

Rasterio: Use case for src.meta vs. src.profile when reading and writing rasters?

The meta property contains the basic raster metadata: driver, dtype, nodata, width, height, count, crs, transform The profile property is a super set of meta which includes dataset creation options: ...
user2856's user avatar
  • 74.3k
20 votes
Accepted

Seeking tool for creating Vector MBTiles

POSTGIS now supports outputting vector tiles as endpoint to a Query. https://postgis.net/docs/ST_AsMVT.html I honestly don't recommend this approach because currently that's just geometry and no ...
Geospatial Engineer's user avatar
15 votes

Is Leaflet Framework free?

Leaflet is free ($) and open, with a minimal requirement of keeping the license should you redistribute it. Leaflet is a library that lets you display - and more - data. It is not a data provider. ...
JGH's user avatar
  • 44.4k
15 votes
Accepted

Mapbox map with no style, only self hosted vector data

To remove the basemap from the example shown in your question (https://docs.mapbox.com/mapbox-gl-js/example/hover-styles/), just replace style: 'mapbox://styles/mapbox/streets-v11' with style: {...
pathmapper's user avatar
  • 2,015
14 votes
Accepted

How to add CSS styling in Mapbox GL Popup?

I've read this and several posts on SE, which pointed me in the right direction Your link is pointing to the docs about mapbox.js which is different from mapbox-gl.js. Docs for Mapbox GL JS: https://...
pathmapper's user avatar
  • 2,015
13 votes
Accepted

Mapbox GL JS - "Source Loaded" event

You can use below line of code map.on('idle',function(){ //your code here }) Once all the rendering part has been done then the above function will be called and then you can perform other ...
smkskr's user avatar
  • 146
12 votes

How to test if a layer exist in a MapBox GL JS map?

From: https://github.com/mapbox/mapbox-gl-js/issues/4466#issuecomment-288177042 To safely remove a layer that may or may not exist, guard the call to removeLayer with getLayer: // Always remove the ...
pathmapper's user avatar
  • 2,015
12 votes

Mapbox SDK: Is it free if you host your own vector tiles?

I have a similar problem. I want use openmaptiles + mapbox-gl-js for free without licence key. The licenceconditionen on mapbox page is not very clear. So I asked mapbox directly. I asked: I want ...
Gerd's user avatar
  • 791
12 votes

How to test if a layer exist in a MapBox GL JS map?

Better way: var mapLayer = map.getLayer('route'); if(typeof mapLayer !== 'undefined') { // Remove map layer & source. map.removeLayer('route').removeSource('route'); }
Hexxefir's user avatar
  • 221
12 votes

How to add CSS styling in Mapbox GL Popup?

Mapbox GL JS: If you need even more control over the styling of the popup (e.g. set background color for different types of popups), you can set a custom classname directly on the top level of the ...
mwallisch's user avatar
  • 221
11 votes
Accepted

Style line-width proportionally to maintain relative size in Mapbox GL

You've got the basic principle right, at each integer zoom level increase the line width would need to double to cover the same geographic area on the map (see zoom levels on the OSM wiki). ...
AndrewHarvey's user avatar
  • 2,269
11 votes

How to filter layer features by value?

The "Filter symbols by toggling a list" example toggles the visibility of whole layers. For more fine grained filtering use map.setFilter, see https://www.mapbox.com/mapbox-gl-js/api/#map#setfilter. ...
AndrewHarvey's user avatar
  • 2,269
11 votes

How do I increase the font size of contents in Map in Leaflet.js?

If you look at a single tile, the native resolution is 512x512, whereas the default tileSize in the tileLayer API is 256 Try setting the tileSize and zoomOffset: L.tileLayer('https://api.mapbox.com/...
toms's user avatar
  • 7,098
11 votes
Accepted

Moving marker cursor on two maps Mapbox

Add this style (change url): .marker { background-image: url('cursor.png'); background-size: cover; width: 16px; height: 16px; cursor: pointer; } cursor.png -> Add this script ...
Kadir Şahbaz's user avatar
10 votes

Mapbox GL JS - "Source Loaded" event

I was dealing with this again today, so here's an update! As of mapbox-gl v0.44.2, it's still not quite reliable enough to listen for the sourcedata event and check the properties of the event ...
DMack's user avatar
  • 675
10 votes
Accepted

Mapbox not updating from OSM

Mapbox no longer applies OpenStreetMap edits right away and won't guarantee any timeframe for edits to appear. I've heard that their system for applying changes is backlogged and has lost some changes....
Paul Norman's user avatar
  • 1,616
9 votes
Accepted

How to find layer names within vector tiles, without TileJSON or the .mbtiles file?

If you're okay to write a NodeJS script you can use const request = require('request'); const VectorTile = require('@mapbox/vector-tile').VectorTile; const Pbf = require('pbf'); const zlib = require('...
AndrewHarvey's user avatar
  • 2,269
8 votes

Measured grid in Mapbox

If MapBox uses EPSG:3857 any grid will become distorted as you move away from the equator. If you want an undistorted lat/lon grid try using EPSG:4326 (Plate Carree) - technically the grid is still ...
Ian Turton's user avatar
  • 84.2k
7 votes

Add vector tile sources to QGIS

Vector tiles are now supported directly in QGIS 3.14+: https://www.qgis.org/en/site/forusers/visualchangelog314/index.html https://www.lutraconsulting.co.uk/crowdfunding/vectortile-qgis/
Lutra's user avatar
  • 693
7 votes

Mapbox satellite failed to upload in QGIS

I'm pretty sure the TMS that the plugin is calling is broken, either the token was cancelled, ran out of request capacity, or blocked by MapBox. Try using a different satellite image background, ...
HDunn's user avatar
  • 8,764
7 votes
Accepted

MapBox Text Layer is adding multiple text instead of single centered text

If you're trying to label a polygon then you need to tell Mapbox GL JS exactly where you want that label to be for each polygon. You need to do that by creating your own point from the polygon and ...
AndrewHarvey's user avatar
  • 2,269
7 votes
Accepted

Convert from 16 bit unsigned GeoTIFF to 8 bit for Mapbox with QGIS

It looks like there is a consensus on the cause and fix for your rasters. For the benefit of users in the future experiencing the same issue, it is likely that your export from ArcGIS (Copy Raster?) ...
Michael Stimson's user avatar
7 votes
Accepted

Add a WMS singletile layer in Mapbox GL

You can find below the same code as in the comment to make only single WMS calls (useful to avoid repeated labels). I've made some refactoring. You should also be aware that you need to consume a WMS ...
ThomasG77's user avatar
  • 31.7k
6 votes

Importing Maki Icons to QGIS

With QGIS 3 (and 2), the Maki icons can conveniently be imported using the Resource Sharing plugin. It is available in the QGIS plugin repository, so it is very easy to install it using the QGIS ...
Håvard Tveite's user avatar
6 votes

Mapbox GL JS - "Source Loaded" event

The solution is to use the undocumented style.load event that fires when new things finish loading into the style. map.once('style.load', (ev) => { // ... });
DMack's user avatar
  • 675
6 votes

QGIS exports slightly inaccurate GeoJSON coordinates

ogre.adc4gis.com uses a GDAL utility to do the conversion from shapefile to GeoJSON. QGIS also uses GDAL, which would explain similar results. The GDAL GeoJSON driver can give two types of GeoJSON, ...
nmtoken's user avatar
  • 13.6k
6 votes
Accepted

Using ST_AsMVT with ST_TileEnvelope clipping in mapbox

Your geometries go beyond the range of validity for your projection, so those tiles are failing to render. You need to clip them before you transform (or alternately, clip your tile envelopes before ...
Paul Ramsey's user avatar
  • 20.1k
6 votes
Accepted

Map chopped off across 180degree line from QGIS to Mapbox

By the GeoJSON specification geometries which are crossing the dateline are not strictly forbidden but it is recommended that they are cut in two halves. https://www.rfc-editor.org/rfc/rfc7946 In ...
user30184's user avatar
  • 71.7k
5 votes

Using Mapbox tiles with folium

The answer above is correct, but I wanted to add some detail of where Mapbox users can get the necessary url for the code. When in Mapbox Styles page, simply choose to share your style, and under '...
Mike W's user avatar
  • 71
5 votes

What's the most appropriate way to load Mapbox Studio tiles in Leaflet?

Geografa's answer is referring to tiles made with "Mapbox Studio Classic" (which was originally named "Mapbox Studio"). These "Classic" styles are found on your Mapbox account at https://www.mapbox....
Will's user avatar
  • 1,381

Only top scored, non community-wiki answers of a minimum length are eligible