M
Mapbox Blog
blog.mapbox.com · Company blog · on HN since 2017
Mapbox's engineering blog on mapping, WebGL rendering, spatial search algorithms, and location features like isochrones.
What HN saysHN commenters link it for technical posts, such as the WebGL wind map and the R-tree spatial search dive, which one reader found useful.
77HN people shared it
34linked it in comments
69stories submitted
2.0Kstory points
6 months agolast shared
2017people per year2026
Most-shared posts
- 1I built a wind map with WebGL (2017)4 people · 131 points · first shared 2017 · 26 comments on HN
- 2Add isochrones to your next application e9e84a62345f4 people · first shared 2017
- 3A new kind of map: it’s about time3 people · 969 points · first shared 2017 · 201 comments on HN
- 4Mapbox New Pricing3 people · 10 points · first shared 2019 · 2 comments on HN
- 5Introducing jsxtreme-markdown – Points of interest3 people · 6 points · first shared 2017 · discussion on HN
- 6Spatial search algorithms – Searching through millions of points in an instant3 people · 1 points · first shared 2018 · discussion on HN
- 7Drawing text with signed distance fields in mapbox gl b0933af6f8173 people · first shared 2018
- 8Debanding the World2 people · 162 points · first shared 2019 · 6 comments on HN
- 9Mapbox Worldviews – Dynamically change disputed national borders2 people · 6 points · first shared 2019 · 1 comments on HN
- 10Visualizing street orientations on an interactive map2 people · 5 points · first shared 2018 · discussion on HN
- 11RoboSat: open-source, end-to-end feature extraction from satellite imagery2 people · 5 points · first shared 2018 · discussion on HN
- 12Add LIDAR to Mapbox2 people · 4 points · first shared 2018 · discussion on HN
- 13Mapbox and kepler.gl2 people · 4 points · first shared 2018 · discussion on HN
- 14Building an interactive map of the progression of the 2019-nCoV outbreak2 people · 3 points · first shared 2020 · discussion on HN
- 15A new algorithm for finding a visual center of a polygon2 people · 2 points · first shared 2022 · discussion on HN
What HN people wrote when they linked it
lukan · 2024-08-14
Love it so far. But even more the link from inside about R-Trees:
https://blog.mapbox.com/a-dive-into-spatial-search-algorithms-ebd0c5e3…
I did not know the name before (or forgot), even though I was working at some point with these (even reimplementing). Time to fill some theoretical holes.
incanus77 · 2019-08-18
Back when I was at Mapbox and we were developing the library used for this sort of visualization, I did a take on my home city of Portland, OR in a similar fashion:
https://blog.mapbox.com/visualizing-an-entire-citys-buildings-live-wit…
(Disclaimer: some of the images, and especially the code formatting, don’t seem to have survived very well)
I wrote there a bit more about the data processing side of this, and I tried to make a compelling mobile visualization that was fast. I’d use it a lot for demo and pitch-type meetings, and especially with an HDMI connector direct from iPhone to a 50, 60 or 70” display, the frame rate and fluidity was super impressive.
To this day, I just plain love the tech that we built.
aphextron · 2018-06-16
>Yeah, AR is going to find it’s first killer application in the next year or two.
My money is on something like Nexar [0]. AR enhanced driving is going to save commercial fleet operators incredible amounts of money while we're still reliant on human drivers. Real level 3+ autonomy is still years away, but AR HUDs are going to be huge very soon, and the mapping data they collect will build the basis for those autonomous systems. MapBox just released their new Vision SDK that does deep learning based AR locally on mobile devices that is going to have some amazing applications too [1].
[0] https://www.getnexar.com
[1] https://blog.mapbox.com/vision-sdk-d47486656821
EQmapbox · 2018-05-04
I'd love to make this work, Forrest - drop my name in a note to [email protected] and let's see if we can get you setup with the Isochrone plugin (https://blog.mapbox.com/add-isochrones-to-your-next-application-e9e84a… which sits on top of the Mapbox Matrix API. https://blog.forrestthewoods.com/visualizing-commute-times-378009330ff… is awesome!
mourner · 2017-08-25
Great project! I recently wrote a detailed technical post on how to implement a similar visualization with WebGL — check it out: https://blog.mapbox.com/how-i-built-a-wind-map-with-webgl-b63022b5537f
sandstrom · 2019-11-12
Awesome to see a new release! We've followed Cockroach for a while, would be a good fit four our workload.
However, I think it's sad that their pricing is so opaque.
Even after a few emails back and forth with their sales people it still feels fairly arbitrary, and since it's not transparent we don't know if they're just making numbers up based on what they think we're willing to pay.
I find this sales-tactic off-putting. In theory it allow them to "not leave any money on the table", as they would probably frame it, but I'm curious how many deals they will lose simply because people don't want to be held hostage, or don't want to put up with the sales-hassle.
With AWS and Google Cloud (their main competitors), we know that prices won't be jacked-up.
———
An interesting example of this mistake is Mapbox.
They had a limited free tier, where most use-cases would be "talk to sales for pricing". We had a frustrating 2 months talking with their sales people, finally getting a reasonable deal. But we were very close to just ditching them for Google Maps (even though I liked Mapbox product better and was willing to pay more for it), just because the price negotiation and all the cheap sales-tactics was so time-consuming.
Then, 6 months later, Mapbox CEO posted this blog post:
https://blog.mapbox.com/new-pricing-46b7c26166e7
[excerpt, from Mapbox CEO announcing pricing/sales rethink]
How we price our tools has a significant impact on how those tools get used
…
DonHopkins · 2018-05-28
Another technique related to voxels is the "Signed Distance Field" (using a data Field or procedural Function).
Signed Distance Function:
https://en.wikipedia.org/wiki/Signed_distance_function
2D Signed Distance Fields are used for rendering fonts and other shapes defined by a texture whose signed pixels (-128..128) specify how far each is from the border (+ is outside, 0 is on the border, - is inside). They scale beautifully because you can smoothly interpolate between samples.
Drawing Text with Signed Distance Fields in Mapbox GL:
https://blog.mapbox.com/drawing-text-with-signed-distance-fields-in-ma…
TextMesh Pro - Font Asset Creation Process:
https://www.youtube.com/watch?v=eXhfygRgIVY
You can convert them to piecewise outline contours (like an iso-map slicing at many different elevations) with the Marching Squares algorithm, but it's much more efficient to render them directly pixel-by-pixel with a shader.
Marching Squares:
https://en.wikipedia.org/wiki/Marching_squares
Signed Distance Fields are excellent for shaders efficiently antialiasing and drawing effects like outlines, drop shadows, embossed and beveled edges, glows, multi texture mapping, bump mapping, etc). The shader can quickly determine exactly how far away each pixel is from the outline, and blend the appropriate effects together for that pixel, so you get precise anti-aliasing, outlines, drop shadows, etc, practically for free! (And literally for free, now that Unity gives…
fschutt · 2018-01-04
1. I knew that I had a lots of time. From a business perspective, this doesn't make perfect sense, I know. I knew C++ (sort of) and was looking for a similar language. Learning Rust took me roughly three weeks (coming from C++), it is not as complex as you think. I think the time saved hunting down null pointers has amortized that investment greatly.
2. Again, I didn't know at that time if that was the fault of Windows. All that I saw was an application that was extremely slow, written in either C++ (with Win32) or .NET (both of which are possible). Second, the application had very shitty PDF output (ex. a shape with CMYK was "emulated" by four shapes drawn on top of each other, one for black, one for magenta, etc. - lead to a completely bloated PDF). I suspected that it was the fault of the framework they were using and I didn't want to end up in a similar situation.
3. Display is actually the #1 bottleneck. You have to understand that in a real map needs to draw roughly 10000 lines, fonts, and symbols. The old program (which I had to work with), did this using Win32 drawing routines. Every time you zoom in / out, it could take 1 - 5 seconds (if lots of things were on the screen). In OpenGL, I can do it in a sub-millisecond time (using this technique -
https://blog.mapbox.com/drawing-antialiased-lines-with-opengl-8766f341… paired with primitive restarting in OpenGL (https://www.khronos.org/opengl/wiki/Vertex_Rendering#Primitive_Restart… ArcGIS, for example, has…
zylepe · 2026-01-09
Pole of Inaccessibility is also a useful technique for placing the label for a polygon at a visually pleasing location on a map. @mourner came up with a more efficient algorithm for computing the point https://blog.mapbox.com/a-new-algorithm-for-finding-a-visual-center-of… (https://github.com/mapbox/polylabel) which JTS's MaximumInscribedCircle utility is based on, which I use for "innermost point" label placement in planetiler.
DennisL123 · 2024-03-10
The idea is at least ten years old: https://blog.mapbox.com/audiolizing-server-query-rate-749d5af84a6b
OmarShehata · 2023-10-30
Zenly (recently went bust) did this!
https://blog.mapbox.com/clear-the-fog-with-zenly-fc7778b06c33
> Zenly’s location tech works in real time to uncover the map as you cover more ground. Zenly’s location tracking runs in the background, updating automatically as you check out new neighborhoods and take road trips.
(it's very social though I think, more "compete with friends!" than "explore your neighborhood & find delight in small things)
SideburnsOfDoom · 2022-11-06
I would guess that it's "A demonstration of all the 3D data already in OpenSourceMap"
As heights and number of levels on the building has been a part of the dataset for a while now:
https://wiki.openstreetmap.org/wiki/Key:building:levels
https://wiki.openstreetmap.org/wiki/Key:height
https://blog.mapbox.com/mapping-3d-building-features-in-openstreetmap-…
It's obviously not complete. I took 2 locations that I know well (different countries) and the first has relatively realistic looking 3-d building shapes. The other has nothing.
And that it's using a 3rd party engine. Since the OSM data is "open", there's nothing wrong with making use of it.
jahewson · 2022-08-18
They’re drawn in WebGL using signed distance fields.
https://blog.mapbox.com/drawing-text-with-signed-distance-fields-in-ma…
awhitty · 2022-06-20
Saman worked on many things at Mapbox, most notably to me is the interface for Studio [0], which continues to be an impressive expression of a really advanced set of features for map design. He also explicitly mentioned a stint as an engineering manager at the company in the post- maybe you didn’t catch that? Or maybe you don’t consider management to be doing “actual work”? If you think the latter, maybe consider organizing at your own workplace?
[0] https://blog.mapbox.com/behind-mapbox-studios-new-look-874c156395fd
robocat · 2021-12-20
“Rather than taking a photograph, satellite sensors record electromagnetic radiation in the red, blue, green, and high-resolution panchromatic (black-and-white) bands (as well as several not visible to the human eye, as this Mapbox[2] post helpfully explains). When these bands are combined to produce a visible image, fast-moving objects – like planes in flight – don’t quite match up, producing the rainbow effect.
[2] https://blog.mapbox.com/putting-landsat-8s-bands-to-work-631c4029e9d1
brncsk · 2021-09-27
If you liked this, you might like this as well: https://blog.mapbox.com/debanding-the-world-94439af16e7f
neolog · 2021-06-17
thomasikzelf · 2021-05-24
You can do anti aliasing in the fragment shader using 4 vertices per segment. See:
Shader-Based Antialiased Dashed Stroked Polylines- Nicolas Rougier
And:
https://blog.mapbox.com/drawing-antialiased-lines-with-opengl-8766f341…
I am also rendering round caps in the fragment shader. You can then render multiple lines with 1 draw call. The only problem is drawing transparent lines, because of the overlap between segments.
pvidler · 2021-03-15
You can always render the text to a texture offline as a signed distance field and just draw out quads as needed at render time. This will always be faster than drawing from the curves, and rendering from an SDF (especially multi-channel variants) scales surprisingly well if you choose the texture/glyph size well.
A little more info:
https://blog.mapbox.com/drawing-text-with-signed-distance-fields-in-ma…
MIT-licensed open-source multi-channel glyph generation:
https://github.com/Chlumsky/msdfgen
The only remaining issue would be the kerning/layout, which is admittedly far from simple.
segheysens · 2020-12-09
Mapbox actually put out this blog post for visualizing point clouds in 3D with GL JS + Deck.GL in May 2019 - should still be totally possible!
https://blog.mapbox.com/coloring-lidar-4522ca5a7186
mikewhy · 2020-07-07
Nice, reminds me of this demo from a few years back: https://blog.mapbox.com/bringing-3d-terrain-to-the-browser-with-three-…
mtmail · 2020-02-26
https://www.mapbox.cn/coronavirusmap/ (https://blog.mapbox.com/visualizing-the-progression-of-the-2019-ncov-o… though it seems to cover China only.
sciurus · 2019-12-10
For anyone curious like me about Mapbox's new pricing structure taking effect now, they're at https://blog.mapbox.com/new-pricing-46b7c26166e7
aerodog · 2019-08-17
One more question. How do you see this as effecting much of a different result from Peter Liu's work
https://blog.mapbox.com/bringing-3d-terrain-to-the-browser-with-three-…
Is it just faster? Also, is Peter's work FOSS?
n4r9 · 2019-06-27
Two of the more well-known routing engines have this capability and have written about it on their blogs with some visualisations:
- OSRM (the main routing engine behind openstreetmap.org) https://blog.mapbox.com/matching-gps-traces-to-a-map-73730197d0e2
- Graphhopper https://www.graphhopper.com/blog/2016/08/08/releasing-the-map-matching…
Unfortunately it's not a simple project to get started on because you already need to have a way to import road network data (e.g. from openstreetmap), build an internal graph model, do some geographic indexing and perform fast many-to-many routing calculations.
Kliment · 2018-06-29
non-blogspam original source https://blog.mapbox.com/a-new-kind-of-map-its-about-time-7bd9f7916f7f
MaBu · 2018-03-16
Mapbox has a tutorial https://blog.mapbox.com/add-lidar-to-mapbox-43f7e3912424 it uses OSS tools and you can host results locally, own server or on Mapbox.
seattle_spring · 2018-01-15
Mapbox is built on top of Leaflet [1], so I don't think its success would be a bad thing for Leaflet itself.
[1] https://blog.mapbox.com/mapbox-%EF%B8%8F-leaflet-d60b1be96615
lemonlyman516 · 2017-10-10
Mapbox actually just changed their pricing structure to be more friendly to startups and developers - take a look https://blog.mapbox.com/pay-as-you-go-new-flexible-pricing-options-2da…
kaikai · 2017-09-20
Mapbox also does isochrones:
https://blog.mapbox.com/add-isochrones-to-your-next-application-e9e84a…
disclosure: I work for Mapbox (on geocoding, not visual maps)