Openstreetmap, a global map for worldwide insight
blog.mapbox.com
blog.mapbox.com
I've found it more useful for specific applications that I build because it's far more customizable. The map truly feels like it's part of the app and not just some mapbox or leaflet thing sitting on top of gmaps. Again, these aren't hard facts, just stylistic preferences on my part.
The ES6 is not really a dealbreaker if you're using something more traditional. I just make my own "map.js" that exposes the interfaces I need, then I transpile it and include it like anything else.
I know that sounded really complicated, but my package.json is 10 lines, that's it.
This way you can use it in a much more conventional classical way without jumping the whole project over to ES6 syntax.
I'm also thinking of cli vs gui here.
Sounds like delayed gratification.
But for building functionality outside of the map I tend to use Leaflet instead due to the ease of use. You can treat the map more like a black box and the API is easier to use.
Heck I'll just do the straight Google maps api often, it's really easy.
OpenLayer is like vim/emacs, some people think the hassle is worth it.
Nice quote: “Don't lose out on the potential of tomorrow by thinking too big today.”
Classically you would do this with Tilemill for rasters which was amazing software, if crashy. And since we’re on a mapbox thread what I think put them on the map. I wish it was still actively developed and adapted for vectors.
https://github.com/go-spatial/fresco and https://github.com/maputnik/editor are TileMill-like editing programs, though specific to one tile format and renderer (MapboxGL)
https://github.com/Leaflet/Leaflet/issues/268
https://openlayers.org/en/latest/examples/rotation.html
This is a critical point for anyone selecting an API to build on top of with their own ambitious new web app idea.
I can find regions on geofabrik.
The newer way to do raster tiles is to actually generate vector tiles first, and then do the rasterization dynamically. Mapnik can do this, renderers like MapboxGL can be run in headless mode to do this as well.
Yes, I wish this was easier too.
Of course I can guess a lot of data can be removed and simplified, but still, PNG seem lighter...
Many vector tile encoders have wide flexibility in geometry simplification/removal depending on zoom layer and this helps big time with tile size. I find them to be quite nice in lower bandwidth situations because you can overzoom them and still have them look good: if you zoom in and the tiles for the next zoom level haven't loaded, the vector geometry is still able to look decent, rather than pixellated like a raster tile.
What I can tell you is that my vector slippymap XHR is requesting .pbf files, so that would definitely imply protobuffers as the wire format. Ultimately that's using t-rex and mapbox-gl.js, so... not sure if there's something intermediate. But the mapbox docs say sqlite? I'm just very confused now.
The primary standard for vector tiles is Mapbox Vector Tiles (it's an open standard), which is really just a sqlite database following a particular schema.
My own personal experience developing against both png and vector tiles over the past few months is that vector tiles are better in just about every way for the kinds of things you use maps for in apps. I expect that some dataviz applications, though, would be better served by raster tiles, since you'd end up generating a raster overlay anyways.
I've used spatialite, and even though the doc is poor, I've managed to do things with it, and it works fine.
I'm not sure I can generate tiles with QGIS and spatialite.
It's true that open source GIS software is not easy to find, since GIS is not easy in the first place.
You don't need everything, you just provide the areas you want and layer accordingly
I'm on my mobile typing this but hopefully that's enough to get you started.
It should probably take less than a day. There's certainly nuanced GIS wonkiness, let's not pretend otherwise. But when I did set up a tile server I remember it being one of those things you think you simply cannot do without taking like 6 months of cartography night school, but then 45 minutes later it's done.
The domain specific knowledge requirements for standard usage required lightly scanning a couple Wikipedia pages. nothing serious.
1) Download a region from geofabrik. 2) Extract, transform and load the data into pgsql with osm2pgsql. I use the osm2pgsql flex mode. QGis can load osm extracts direcly, but the resulting layers have many errors in the details and using pgsql is much faster while viewing and rendering. Imposm is also a good alternative to osmpgsql. 3) Use QGis for styling the map. 4) Generate static tiles with https://docs.qgis.org/3.10/en/docs/user_manual/processing_al... (With DPI 250 and a tilesize of 512x512 for use on high resolution screens.) 5) Upload the tiles to my own server. 6) Load the tiles in OSMAnd as a custom map.
Qgis has a build in tile server https://www.qgis.org/de/site/about/features.html#qgis-server and leaflet can load the tiles via https://leafletjs.com/reference-1.6.0.html#tilelayer-wms . But this does not work for OSMAnd.
QGis can also create beautiful print maps with the "Atlas" feature.
But loading data directly from a osm.pbf or loading data via the QGis QuickOSM plugin into a spatialite file gives two problems:
1) You can not transform the data to fit your personal usage. Raw osm data is not nice to work with.
2) I had many problems with areas stored as relations (example: islands in lakes) and relation handling overall is a mess.
For the first steps and to toy around osm data in spatialite works. But don't fear osm2pgsql. For standard use cases it's a oneliner.
See: https://cesium.com/docs/tutorials/uploading/
Would love to hear your feedback.
Apart from OL API doc. Could you please recommend any book/course to learn both concepts & API.
Seriously. The nicest part about the source is that it doesn't lie.
It's rarely as scary as your anxiety tells you it's going to be. Even for larger projects. You got it, may as well use is.
I have Open Street Map on my phone, and "harder to use" describes it well. The problem is that for me, and, I'd bet, for many others, "easy to use" is the most important thing a map app can do.
I enjoyed working with OSM, it was actually my first experience building an application around an external API. It was a fun experience and i was fairly pleased with the way it turned out.
It ended up going live for a small time, though, we ended up running into a snag with the government after finding an endangered species in an active mine site and were forced to remove our public data and submit it all to a private government database locked behind fees.
Edit: to further clarify the stack, Mapbox is a collection of tools for creating maps from OSM data.
I like the traffic switch.
OSM has spawned many companies, Mapbox being the most well-known that offers general services.
$ telnet mapscii.me
(Use arrow keys to move, and a/z to zoom in/zoom out)I was totally blown away when I first connected to it.
$ telnet mapscii.me
Trying 144.76.97.34...
Connected to mapscii.me.
Escape character is '^]'.
_
Then nothing more happens. Arrow keys just get printed back out like with `cat`: ^[[A^[[D^[[B^[[C
Eventually I get "Connection closed by foreign host." This is on Arch Linux with telnet from inetutils. Am I holding something wrong?I’m partial to my own (in bio), of course, but I would be happy to answer questions for anyone looking to switch.
Respond or email me (also in bio).
Consider a few different scenarios:
1. If you're trying to serve a single website and map style, with limited traffic in one region, this fairly easily accomplished using a single map tile server using one of the established methods (something like 8 cores, 32GB of RAM, and a few hundred GBs of disk will get you most of the way there). The difficulty is mostly determine how you want to set it up and then provisioning the server to do it. This process will probably take you a few days. Updates will be infrequent, map data will be stale, and speed will be tolerable in your targeted geographic region.
2. Let's say you take a step up. You need to serve global traffic with one style, but only a few requests / second. You can still do this via a single tile server, but now you need a CDN to make it fast. Cache misses will be slow since it has to render and then send the tile to the CDN (up to 500ms of latency due to geographic constraints and cache fill times).
3. Let's say you now need multiple styles, global traffic, 10s of tile requests / second, and good reliabilty. Now you need to distribute your servers, so you'll probably need three or four servers of at least the above mentioned specs, you need to keep them in sync.
4. Now let's say you need multiple styles, global traffic, and up-to-date data. You'll need to keep the OSM data stored locally so you can update it (minimum 500GB in Postgres + PostGIS). You need to distribute this all around the world. You need to handle updates, but do them in sync.
All of these are short of actually offering a commercial service for multiple companies, since in that case you need a global service structure, a CDN that's pretty efficient, enough tile servers to handle spikes in demand (pretty common in map tile services), and probably a couple layers of cache to keep everything moving smoothly.
There are a few projects that make this easier. For instance, openmaptiles.org is what our solution was modeled after (and we still use their schema, mostly unchanged), but in the end it's hard because it's a lot of data, that requires a lot of compute (either up-front or at a moments notice) to be responsive, and requires a lot of orchestration to keep it all well-oiled.
OpenStreetMap is an unwieldy but not "big" dataset - it fits easily on a consumer grade SSD. You need to index the dataset so that retrieving a specific slice is extremely fast - doing point in polygon tests, clipping operations on source geometries that have tens of thousands of vertices, etc should not happen at query time. This inevitably means pre-rendering as much as possible.
In addition, this needs to work for every intermediate tile level when zooming out - each parent tile covers 4 child tiles, so you need some strategy for decimating the amount of data so that the tile sizes don't increase exponentially as you zoom out. This is beyond a pure computer programming problem and becomes a visual design problem as well - features such as roads or transit layers should form a sensible hierarchy with less important features removed.
I've been working on this class of problems for a couple years now and have a related presentation day 2 of the conference mentioned in TFA - details in bio if you'd like to talk more
Do note that while not BigData big, it _is_ large. Your PostgreSQL database (postgis) on your macbook won't be able to import `planet.pbf` in any reasonable time (think: weeks). Your digital-ocean VPS won't have enough diskspace to process a weekly planet.pbf and the free or cheap tier of your RDS won't be able to handle planet.pbf either.
http://download.geofabrik.de/ (also one of the StateOfTheMap conference sponsors) is a good place to find "chopped up" downloads to avoid that: just get only your country, a province or even just one city. On my developer env I always run everything through with `luxembourg.pbf`. or `iceland.pbf`.Luxembourg-latest does still contain nearly 2.5 million datapoints: `osm2geojson luxembourg-latest.osm | wc -l #=> 2417784`
Thanks for pointing me to your StateOfTheMap session. I'll "attend" it for sure.
I guess it depends on specs. I recently did it, importing planet.pbf into this PostGis docker image [1]. It took 44 hours and consumed ~750GB of disk.
OS: Ubuntu 20.04
CPU: Intel i7-8550U
RAM: 16GB
1. Autocomplete places
Mapbox has one, but I found many examples of villages present in OSM, but not in Mapbox. I wrote to support with specific examples and links to OSM, eg https://www.openstreetmap.org/search?query=dalghiu#map=13/45...
but they didn't even reply in 10 days (no support contract).
2. Directions (route, distance & time)
Thanks
I've been asked, preliminarily, by the lab I work for to produce an application that will overlay daily/weekly water quality measurements on a map. I've got no idea where to start as I've never done anything GIS - but I do like keeping things open source. Would this be something to integrate with OSM?
The problem seems simple and generic enough that I'd expect it can be done with zero programming. I just need to find the right place to feed in a table of coordinates and measurements
I know the problem spec is a bit vague, but what's a good place to start?
And if I do need to write an app, is there any way I could stick Clojure/JVM?
If there is a lot of data, you have to take the zoom-level into consideration and aggregate the data on the server side.
Most news papers I have seen use LeafletJS, and Wikipedia are using it
Likely you will use OSM map as a background map. Remember to include a clearly visible attribution!
It is not the most userfriendly (aimed at GIS professionals) but it does have a large, open and friendly community around it, making lots of tutorials, manuals, introductionary material and so on.
Edit: especially your type of "problem" is what qgis is good at: you have a CSV, maybe a postGIS database, some old scans of maps maybe; a government provided shapefile of the waterways and so on. And with qgis you can all project them over Google/OSM/Bing/Mapbox maps, mix, mash, filter, extract and so on. It is a desktop software, so publishing your result would probably mean "make some PDFs" or "render a set of PNGs" or so.
If you are expecting a lot of users, you'll probably have to program
If you are looking for country scale water quality mapping, the it may be worth looking at the work of Akvo Foundation. We have helped more than a dozen countries, in collaboration with UNICEF in many of them, to do drinking water quality mapping in rural areas, on our open source service. We have covered an estimated 100+ million people with surveys. We also work with water quality in lakes and streams. Our mobile phone app is integrated with a suite of water quality sensors and testing methods.
https://akvo.org/safe-water-for-all/
Disclosure: I am one of the co-founders of Akvo.
Assuming your data is already in one of the formats we support (full list here: https://cesium.com/docs/tutorials/uploading/)
I really like the web-based Openroute Service [1] that was shared here recently, but AFAIK this doesn't have an app version.
The best iOS apps with OSM I have found are [Guru maps] (formerly Galileo) and [Pocket Earth]: Have been using paid versions of both for the last 5 (?) years, switching back and forth. Currently on Guru after they added contour maps and offline routing a while back. Haven't checked if Pocket has this yet...
[Guru]: https://gurumaps.app/ [Pocket Earth]: https://pocketearth.com/
https://wiki.openstreetmap.org/wiki/Comparison_of_iOS_applic...
Comparison of Android applications
https://wiki.openstreetmap.org/wiki/Comparison_of_Android_ap...
EDIT: as below, I stand corrected. Please ignore my false statement above.
I was pleasantly surprised when I found it on the App Store [0].
[0] - https://apps.apple.com/ca/app/osmand-maps-travel-navigate/id...
It shows hiking and cycling marked routes and contour lines, has offline maps.
I have never used it for car-based navigation, so I am unsure is it working well.
If you click the info box in Apple Maps underneath the Tom Tom logo it says © Openstreetmap contributers and other providers
Full list: https://gspe21-ssl.ls.apple.com/html/attribution-156.html
I went into the experience thinking it was the wikipedia of maps. But it's not, wikipedia has much better content control than this.
My theory is that it's too easy for random people to enter data into OSM. It should require some sort of validation of the contributor.
And each contribution should have a discussion, just like wikipedia talk pages. I know that sounds like a lot of talk pages but I believe some of those contributions require community discussion to improve.
Also, for a long time now each changeset can be discussed. [1]
I have a hunch you may be from a country where the community has not took up too much [2]. These tend to have more dubious data.
[1] https://blog.openstreetmap.org/2014/11/02/introducing-change...
[2] https://osmstats.neis-one.org/?item=countries
[3] https://goo.gl/maps/knpT8eRR4YhB6Sm86 - look at the shopping mall in satellite and map view
If you had to rely on OSM data to get around, your best bet would be to live and work in northeast London, within the circular.
If you have an Android phone - I want to plug StreetComplete app here. I never mapped opening hours before I started using it.
It asks simple questions, there is no requirement to learn anything OSM specific.
Registration at OSM website is probably the biggest hurdle.
(disclaimer: I am one of contributors to that project)
I use https://github.com/westnordost/StreetComplete for doing this so I don't have to make the investment to learn the technical details of tags.
When I travel to a place where OSM could need improvement I make sure that at least the hotel I will be staying at, nearby restaurants, bars and museums, etc are correctly tagged with phone numbers, opening hours etc. It is not much work and it gives me an opportunity to decide what I want to do before I leave.
When I get there I then have everything ready offline in OsmAnd. In a way I just update OSM instead of adding my own bookmarks/favorites.
But, my personal perspective was a little different. It's more like: I want to use OSM, and get others to use OSM instead of proprietary mapping solutions like Google's, for moral reasons. In that context, being able to make sure my friends can always get to my house using OSM is a great boon.
I realize I didn't share that perspective in my original post, which is probably the source of the confusion here.
There's a number of us who use this kind of data for building back country cycling routes, and while it's great guidance, there's both the problem with roads being listed that are no longer passable (nor often even visible at ground level), or other routes available that don't exist.
Of course, this gets back to the way much of the data is crowd sourced... And we're working on that. :)
For an interesting example, check out this place: Google: https://www.google.com/maps/@46.4133003,-87.5248774,5345m/da... OSM: https://www.openstreetmap.org/#map=14/46.4161/-87.5406
Neither has the actual current lake boundaries (as used as a retention pond), Google has roads where the lake is while OSM doesn't, etc.
https://elevation.nationalmap.gov/arcgis/rest/services/3DEPE...
It's listed as a Theme Overlay at https://viewer.nationalmap.gov/services/
*in the US - it's a TIGER-specific thing (and certainly not exclusive to OSM). It doesn't affect the rest of the world.
Interested to learn what you're doing with cycling routes - I've been working on improving cycling directions in the US (for my site, cycle.travel) for a few years.
For cycling stuff I'm mostly ensuring that mountain bike-specific trails are in OSM and properly tagged (eg: highway=path and NOT highway=cycleway as some are wont to do), with appropriate intersection markers, names, etc.
My goal is to ensure that these trails are in OSM so they'll flow down to Garmin, Trailforks, Mapbox / Strava, etc. I also use the OSM data, exported to vectors, to make PDF maps to support the local trail advocacy/building org that I'm part of.
As examples, check out my edit history: https://www.openstreetmap.org/user/c0nsumer/history#map=7/44...
Here's examples of the print maps I've made. Versions of these hang at many trailheads in southeast Michigan:
1: http://www.cramba.org/storage/maps/stonycreek/CRAMBA_Stony_C...
2: http://www.cramba.org/storage/maps/pontiaclake/CRAMBA_Pontia...
3: http://www.cramba.org/storage/maps/riverbends/CRAMBA_River_B...
Print maps are made using osm2ai.pl to get the routes into Adobe Illustrator (AI) format. I then stylize things there. I know I could use GIS software, but QGIS is a pain to get things looking the way I want (similar to Michigan DNR maps) and ArcGIS is too expensive for unpaid volunteer work. It's also way more hand-off-able in AI format; I can send the files to any graphic designer and they can keep-on with it. GIS software requires far more specialized knowledge.
Just one example is that an Apple store in Sweden was set to accept cash. Just for fun I called them up and asked if they take cash and they laughed at me.
It seemed to me that someone had automated input for businesses without actually verifying their data.
Someone adds a street. What do you want to do to validate it? Is there some international OSM team, which goes to all the locations and checks, whether there is really a street? With Wikipedia articles it is simpler, because you can check sources mostly online or you have experts on subjects world-wide, not bound by location mostly.
A map of the world seems like sooo much work to keep updated, while many Wikipedia articles can stay as they are, if they are OK now, because they treat historical topics for example, or mathematical things. There are new developments in those areas as well, but no one will take a wrong road when driving, because the Wikipedia article was not updated. Or at least it is not likely to happen. By introducing additional barriers, the update frequency on OSM might be even lower. I wonder how many contributors there are for OSM maps. I have personally never updated a map there and have been too lazy to read up on how to do that.
One would have to find a clever way to validate map information, which does not inhibit participation.
Think of it like the stack overflow „tasks“ you are asked to do all the time: review this question, do this, do that ...
On Wikipedia withholding edits until review works in some language versions [2], but because Wikipedia pages are "atoms" that stand on their own, they have it easier.
[1] https://learnosm.org/en/josm/josm-conflict-resolution/
[2] https://en.wikipedia.org/wiki/Wikipedia:Flagged_revisions/Si...
And anyway real problem is a stale data - especially shops. Data that was wrong from start is rare, OSM has nearly no vandalism.
Making easier to verify data is much better idea (one of nicely working things is a StreetComplete Android app - about 20% of shops where I am asked to add opening hours are gone, so I open a note, take a photo and later me or some other mapper removes no longer existing shops)
Thankfully many (not all, like POI) edits can be checked via satellite imagery [3], of which OSM has permission to use many - global ones being Bing, Maxar, Esri, Mapbox. With so much sources of imagery, the update rate is acceptable for most places.
All in all, the result is not as bad as you'd expect. From normal people I hear that OSM is "very accurate" (at least here in Europe). Oddly enough, nobody says anything about blatantly fake info, which indeed does very rarely slip, but apparently gets reverted.
Now as I am thinking, there is "validation team" of sorts, that's Mapbox data team, which uses OSMCha [4] to flag suspicious changesets and checks them (albeit not by physically going there).
[1] https://wiki.openstreetmap.org/wiki/Quality_assurance#Monito...
[2] https://wiki.openstreetmap.org/wiki/Notes
Areas with local mappers will be watched even more closely.
All in all OSM often reaches a level of detail Google Maps can only dream of. In the Netherlands the number of outright errors is really quite small, and at least everything is pretty much up-to-date. Google Maps is still showing (and routing over) a trunk road in my home town that closed over a year ago.
> A map of the world seems like sooo much work to keep updated
It's really not that bad. Major infrastructure draws the attention of people who are fascinated by highways or railway tracks. The same goes for national cycling networks and the roads and cycleways these use. Major administrative rearrangements (changes in the borders of municipalities etc.) also draw a particular group. And finally, local mappers care about their local piece of map, often down to the newest projects. As a local mapper myself I find it a joy to be the first to map a new street or add a newly assigned name to some unnamed way.
It's also a nice hobby, because you visit parts of your town to survey you wouldn't ever come otherwise.
I was linked to OSMstats [1] earlier - was fun to look through, and the "Contributor to Elements Created" ratio made me proud to be a Canadian contributor :)
In the outskirts of Lübeck, Germany, Google tried to tell me to walk through a private company area with a gate. OSM not only knew about this, it had far (far, far) more details about everything.
In Waterkloof Heights, Pretoria, South Africa OSM was roughly 7 years out of date and had barely any information even then.
I did some mapping on the Garden Route years ago. When I later went and looked back at those communities, I was disappointed to see that little work had been done since my own edits long ago. And in general, much seemed to have been added by other foreign overlanders like myself, and not any kind of local OSM community. I wondered if this is because those demographics in South Africa that are affluent enough to be interested in nerdy tech things like OSM, have also grown up in a culture that always warned them of idly walking around towns with phone in hand?
Improving OSM is an area of active research I believe, but I'd suggest the scale of the challenge is of a different magnitude than can be met by the type of ideas you mention. Think about something like Google Maps, or in the UK OS MasterMap. Each of these likely has hundreds of millions of R&D invested in tools, techniques, processes and infrastructure behind them, as well as an ongoing budget in the hundreds of millions, and numerous, well organised, skilled, full time staff. There's a critical mass behind such efforts that as yet OpenStreetMap has not been able to muster, which is no criticism of OSM, but just an acknowledgement of the reality of the situation. We're talking about setups that take dedicated organisations years to develop - the history of the Ordnance Survey for example goes back to 1747!
This is NOT a role for the OSM[0]. In many cases it is the best source of map data, but it will never be the sole single authoritative source of truth.
Treating it as one is horrible idea and will end in tears.
[0]or Google Maps
And often the things you want to map are better mapped seperately in their own dataset. Just consider woodland. Should that block of trees be mapped as individual trees, a block of woodland, or as a linear hedgerow? Different people would answer that question differently. A topographic map forces everyone to have the same answer.
I think that citizen mapping should move to focus on particular subjects and themes that the individual is interested in. And try and get closer to the underlying phenomena that is being described.
In my city (Kraków, Poland) road data, bicycle infrastructure, pedestrian infrastructure is extremely well mapped. Shops? Probably about 3% of them are mapped.
China? You can find entire cities not mapped at all (for multiple reasons, starting from fact that mapping in China is illegal without permission from government).
If you spot any wrong data (or very, very important missing data) - please report it https://wiki.openstreetmap.org/wiki/Notes#Adding_notes
Or even better, map it if you want - feel free to ask for help, for example here (or elsewhere, see https://wiki.openstreetmap.org/wiki/Contact_channels https://community.osm.be/ )
Some interesting tidbits: FB are hyper-conscious of "graffiti-edits" that can sometimes sneak into OSM, so they built a system to self-host the OSM data, which periodically and selectively merges chunks of data from upstream, using fancy algorithms to flag "suspicious" edits upstream.
If self-hosting, have a look at this https://wiki.openstreetmap.org/wiki/Search_engines overview.
I'm biased (I help with the development and build my latest project on top of it), but I love mimirsbrunn https://github.com/CanalTP/mimirsbrunn. Mostly because it is fast, small and relatively easy to deploy (courtesy to Rust). It uses an old (2.x) elasticsearch as backend, so that is a major downside.
OSM is good, but it's not magic. For critical uses, check a second data source!
Maps are, by definition, outdated. They will have mistakes. They will have abstractions of our messy world that go awry at some point.
OSM is in some areas by far the most accurate and up-to-date source (which is als othe reason why for several areas, both Bing maps and Apple maps use OSM as source). In others it is not.
I often give talks about OSM and always use this: "Google, for example, wants to make profit, their maps are just another canvas to put ads on. This is not bad. But it does mean, that in places (I pull open a map of Tjad where Google maps show large areas of Nothing; Tjad, is a lot of nothing -sand, really- but it is obvious Google has no interest in making that map anything good) where there is no money to be made, Google won't drive around with streetview cars, they won't buy datasets to merge, and they won't spend effort improving or validating the maps there."
In a nutshell: you can't just use them in production for your app. Development shouldn't be a problem.
What you're talking about is precisely the commercial service that Mapbox offers. OSM (+ some extra stuff).
Alternatively, you're free to spin up your own tile server. That way you don't pay anyone else (but you pay your server).
Basically you need map data (in form of tiles) and you need a way to show and interact with your map (e. g. Leaflet).
Here is a summary and one way to do it: https://switch2osm.org/the-basics/
Tiles can be images or vector based. I also recommend having a look at https://openmaptiles.org/ if you want vector based tiles. You can generate your own tileset with this (output is a mbtiles SQLite file based on a open source schema; the schema describes which information go into the database and later can be shown) or download a set of tiles (because e. g. for the world it will take a lot of ressources and a long timeto generate a tileset). There are also servers (like tileservergl or tileservergl-light) that can serve the tilset - not only as vector tiles but also as graphical image tiles.
Raw OSM data can be downloaded for free from https://download.geofabrik.de/
There are plenty of companies who take OSM data and make map tiles. Those charge money or give it away for free.
And of course I can use OSM data in many ways I can't use Google data.
Hiking, cycling - Google Maps is not usable, at least in places that I visited, while OSM was great.
Doing anything interesting with data, like making own map, making map-based decorations (I made some laser-cut maps), research involving geodata, data analysis and anything more interesting - it requires access to data.
OpenStreetMap is allowing to do things completely out of scope of Google Maps, so in many cases it is not even competing.
But if you are individual driving car and you are not trying to eliminate Google from your life? Then Google Maps app is often superior.