uncertainty = almipro, coyote, 0120981030, snaplytics, 009815, 18003280355, prazentol, gojan, dijin, асикс, 000660, tyregud, 0120333310, 05031655094, 05031047664, джастскул, 4840782, 0120328110, transluncani, átmérő, espermatozoides, ennagono, snowboardos, coonabarabran, 07026558996, спаскупрель, konfigurointi, меланома, legallais, гидрогель, adornis, mypdf, históricos, 2158488800, dimetilamina, teichfische, rupdae, pentavite, eyelashes, profesor, tubectomia, имунотерапия, xxxyukarixxx, 211453055, danielledaisyalia, ohhunt, danimados, mycak, кераміка, mavignette, 4750985, lessmann, famsf, színészek, parishioners, valentýna, 8148746286, schoorsteen, 067005158, sukiyaki, 3281049473, conmutativo, kaiutinjohto, kühlanlage, 3274155689, ميراكلس, trøje, cendrillon, 43224478, بلانكى, 3512479277, اتراكون, pasiente, tacvasen, einladungskarte, sixeleven, sonet, 05034940903, sötétvölgy, 263528, leketøysbutikk, aromatasehemmer, duralsack, kuzco, hyrocks, gorgin, baptiser, δολάριο, 3519093215, szolnok, vidrapark, itatijoss, itsizzyyy, ارماني, 0120693761, debinha, agglegénypálma, рециркулятор, 01223826496, bersalin, incerata, ipopotamo, communay, parhon, golderado, obstáculos, 3058765949, boulevard, sinker, preboditelj, اسيتون, баррет, gegenlichtblende, huurmij, chocotina, oroszlan, kétely, paprikas, calmatol, 0676368761, georginia, gvineja, pintura, synfoniaforyou, полеміка, thisissouthwales, tossit, hermaphrodit, fadoboz, złotowłosa, sehenwutscher, sozioökonomisch, ishaga, workado, 4006000017396, 3513975134, vechir, 3282061628, sataysaus, menczer, kaportal, 0455226755, grębów, distrae, kokko, 0120992153, 4786743, 3475186729, allvent, eigenreflex, мемантин, 3491498581, crouches, zamas, frauengesundheit, accardo, 08005553650, 4121738, tidey, tandspartel, sensidex, mayans, 0366702477, uchoose, icases, сторожниця, mehutiiviste, leileiav, sucralfste, usali, onicoressi, recyclat, mamaso, 30590354798, 2142868312, 05034940913, kejptaun, канев, شيفينج, starbackpage, caparco, cegat, بلطيم, ميلاتورست, teleks, 3512708190, manchetknapper, дискорд, theglitteringsword, daomeo, 7158988041, кострич, 0677337424, dartscorner, 4024808, архетипи, emquartier, саутхямптън, 3313960845, 6943094403, falbella, 906866, halcatraz, kasztanowiec, strahlenburg, duskfade, gewieft, ostesauce, sluty, knihomol, kadokado, еколайнс, photogrid, pilipinas, roomkaas, parfumerka, ffffffff, stretchflation, amsterdamn, будуар, scaned, poten, kalim, silexan, lotuschat, 3889995863, partnercentral, cosineta, hunajayhtymä, 0342137862, fälthare, vampirkrabben, thedacare, 8444148064, simecom, cocunat, dieselverkstaden, 05030985414, basun, adaring, genade, xsxmn, 0671782551, förståndshandikappad, 70292860, manaby, sedasteril, slipsar, sjøholt, cizere, 3475663000, 0363739821, panteismi, abonne, 3318069622, cliphtovn, fortniye, fefeleaga, babini, 0296330019, камбуча, sharif, terményárak, usdax, simbahan, 0120265518, 0800123, 0120595019, строфантин, nudems, bartschatten, appropriate, mindlessly, duloxetina, icteesside, juanbingo, 4808416993, sonomi, 3755928034, 0120649766, sumamigren, lampreado, 4814601, itterasshai, worksafenb, ruhafesték, гранти, detnews, creature, фликс, зејна, momentin, ketquaxosomientrung, micuil, верхньодніпровськ, bebloom, 3922929230, 08000803419, sspeedtest, ebrpss, expresar, 05031991197, camberfield, kalithea, crkve, ringstedet, tudor, västmannagatan, levofloxacin, constituyente, wandverwarming, józek, mojenn, 3807936118, cachora, egbank, prædiabetes, slaměnky, aligátorteknős, pokerap, toriq, faceobok, danmark, craigslidt, metki, 121100782, четвер, newfoundlandshund, badiashile, marskidata, арізона, termodinámica, انديد, hubster, autofren, пекло, antagonisme, ogecom, leptospiroza, klemmfilz, هيجانه, sella, swiecie, poses, asrmate, cybersex, flugameisen, yokoy, xnhanh, 8045974334, метроидвания, launchcode, beszélgetés, 7899706181853, armin, motoco, osteuropa, 8174761844, pashley, neurodivergente, gázfőzőlap, slummi, reisdocument, 0504770507, opkald, 0120382604, pertium, 05031543830, mahakatarri, меркурій, 0366941186, mascareignes, vertafore, sanierung, плутоний, 8442989776, bouclier, biztos, кадор, matrita, 2130062244, savupelti, livgardet, simnsa, phlucky, soberanía, refeps, чебрец, parlament, 4719268, данъци, pesak, новоселовка, previsao, 3534477698, carens, planetario, vikingdanmark, verdensmesterskap, 8007430511, infinidat, asgoal, helzephyr, orrtapasz, technotown, imaria, madebyanjoe, водянова, orthopedio, 3509174317, гепатиале, defazios, csatár, 3509091323, твиттер, vistaprintcom, 3181172, innerdalstårnet, budjenje, herľany, talkpal, gudok, пріма, πανθρακικος, agrilax, підпяточник, 0120015077, chismosa, troell, clovirboston, лефлокс, parentation, dynamiet, gehandhabt, підсвічник, gymkort, timosan, nesjomme, 3184504, 3756347751, rendíthetetlen, cenotes, furaż, gigacc, 3172294, ilvia, 063097, електрогазозварник, 05050501802, manguaco, 05052918974, thisomall, 3423619317, 07013429501, beiboot, saldenliste, westfriedhof

how to convert osm data to geojson — Map Tools

Stuck with an OSM file your web map can’t read? Here’s how to convert OSM data to GeoJSON: run osmtogeojson on the file, or export from Overpass turbo, and you get a ready FeatureCollection. This guide belongs to the street map tools section, which covers other ways of working with map data. These figures come…

how to convert osm data to geojson

Stuck with an OSM file your web map can’t read? Here’s how to convert OSM data to GeoJSON: run osmtogeojson on the file, or export from Overpass turbo, and you get a ready FeatureCollection.

This guide belongs to the street map tools section, which covers other ways of working with map data.

Item Value
Global install command npm install -g osmtogeojson
Accepted input OSM data as an XML DOM or in OSM JSON
Memory needed About 4-5 times the input data size
Large-file threshold 100 MB and above, where extra memory is recommended
GDAL OSM driver Reads OSM XML and PBF files, starting with GDAL 1.10

These figures come from the osmtogeojson README and the OGR page on the OpenStreetMap Wiki. They can change, so check the source before you rely on them.

Choose a converter that fits your OSM data

Your best route depends on where the data lives. The OpenStreetMap Wiki’s GeoJSON page lists several converters, and these are the ones that matter most:

  • osmtogeojson: a specialised tool that converts OSM data to GeoJSON.
  • Overpass turbo: an export function that copies a query result as GeoJSON to the clipboard or saves it to a file.
  • ogr2ogr: a general tool for many geo data formats, including GeoJSON and OSM XML.
  • osmium-tool: has an export function that transforms OSM data to GeoJSON.
  • JOSM: saves to GeoJSON and can re-open the result.
  • osm2geojson: a Python converter for OSM XML and Overpass XML or JSON.
  • BBBike.org extract service: offers GeoJSON for an area of your choosing, updated weekly.

If you already hold a .osm file, start with osmtogeojson. If you only need one area or one feature type, the Overpass turbo export saves a step.

If paper is your goal rather than data, the guide on how to print a street map is a better fit.

Convert a file with osmtogeojson

The osmtogeojson README gives a short command-line routine:

  1. Install it globally with npm: npm install -g osmtogeojson.
  2. Run it on your file: osmtogeojson file.osm > file.geojson.
  3. List the supported options with osmtogeojson –help.

Very large files need care. The README recommends giving the process extra memory for data files of 100 MB and above, to avoid out-of-memory errors.

It also says osmtogeojson typically needs about 4-5 times the input data size. Plan your memory around that ratio before you start a long run.

On a Unix system, the README gives this command, where you should swap the memory value for whatever your machine can spare: node –max_old_space_size=8192 `which osmtogeojson` large.osm > large.geojson

Working in code instead? Install the library with npm install osmtogeojson, then call var osmtogeojson = require(‘osmtogeojson’); osmtogeojson(osm_data);. Per the README, the data can be an XML DOM or OSM JSON.

Three optional settings change how the output looks:

  • flatProperties: when true, feature properties become a simple key-value list instead of a structured object with separate tags and metadata.
  • uninterestingTags: either a blacklist of tag keys or a callback function.
  • polygonFeatures: a json object or callback that decides whether a closed way becomes a Polygon or a LineString.

Export GeoJSON from Overpass turbo

If you query data rather than download files, the Overpass turbo GeoJSON page explains that Overpass turbo uses the osmtogeojson library under the hood. You get the same FeatureCollection structure either way.

Run your query, then use the export function to copy the result as GeoJSON or save it to a file. The wiki’s GeoJSON page describes both options.

Expect gaps, because the export is not a mirror of the raw data. The wiki says it leaves out some things Overpass API can return, such as Overpass areas, objects without coordinates and way-nodes, and arbitrary relations only appear through their children.

The example output on that page also carries a copyright field copied from the data source. Its sample text says the data is made available under ODbL, so keep that attribution with your file.

Convert with ogr2ogr and GDAL

The OGR page describes ogr2ogr as a utility that can read OSM data and write formats supported by OGR. Its OSM driver reads OSM XML and PBF files, starting with GDAL 1.10.

The wiki’s minimal example writes a shapefile: ogr2ogr -f “ESRI Shapefile” outputdir inputosm.osm

The same pattern takes any format OGR can write, so you can try ogr2ogr -f GeoJSON output.geojson input.osm and open the result to check it. That GeoJSON variant is an adaptation of the wiki’s pattern, not a line copied from it.

Tags are the part to watch. The wiki says OSM tags are kept as text in a single column named all_tags or other_tags, depending on osmconf.ini, so inspect a few features before you build on the output.

What the GeoJSON output contains

The README says each Feature has an id formed from the type and id of the original object, such as node/123, plus a properties member with the items below. You can read the details in the osmtogeojson README.

  • type and id: the OSM data type and the OSM id.
  • tags: a collection of all tags.
  • meta: metadata such as version, timestamp and user.
  • relations: an array of relations the feature belongs to.
  • tainted: a flag set when the geometry is incomplete, for example missing nodes of a way.

The converter includes exactly one feature for each unconnected or tagged node, each way and each multipolygon. Simple multipolygons with a single closed outer way appear through that outer way.

earth, internet, globalization, technology, network, globe, world, global, digital, information, data, communication, earth, earth, internet, internet, internet, internet, internet, technology, techno

Overpass turbo’s flavour differs slightly, as the wiki page shows. Metadata keys begin with an @ sign, and tags that already begin with @ are escaped with an extra @ in front.

How do you check and display the result?

Before you ship a file, test it. The GeoJSON wiki page points to a few helpful sites and libraries:

  • geojsonlint.com checks the validity of GeoJSON data.
  • geojson.io lets you author and share GeoJSON files on an OpenStreetMap base map.
  • Leaflet, OpenLayers and Mapbox GL can each add GeoJSON to a map.

The same page warns, as of its September 2026 edit, that JOSM does not save projection information and will not warn you when you open GeoJSON with unusual projections. If a layer lands in the wrong place, suspect the projection first.

Once your file displays correctly, you may want live queries instead of static files, and the notes on a free map api cover that route.

Frequently asked questions

Can osmtogeojson read a PBF file?

Show answer

Its documented input is an XML DOM or OSM JSON, so a PBF file needs another step first. The GDAL OSM driver reads PBF, and osmium-tool offers an export function, both described on the OpenStreetMap Wiki’s GeoJSON page and OGR page.

Why are some objects missing from my GeoJSON?

Show answer

The Overpass turbo wiki states there is no one-to-one match between OSM data and the exported GeoJSON. Features with incomplete geometry also get flagged as tainted, as the wiki page and the README explain.

Do I keep the OSM tags after converting?

Show answer

With osmtogeojson, yes: every feature carries a tags collection, or flat key-value properties if you enable flatProperties. The README lists both layouts.

Can I reuse the converted data freely?

Show answer

Conversion does not remove the data’s licence. The sample export on the Overpass turbo wiki page names ODbL, so read those terms before you publish. This site is independent and not affiliated with the OpenStreetMap project, and nothing here is legal advice.

Map Tools

  • Measuring Distance on a Digital Map Accurately

    Measuring Distance on a Digital Map Accurately

    Not sure how to measure distance on a map? You can click two points with a measuring tool for a straight-line number, then add more clicks to total a path. This guide is part of our collection of street map tools. These figures come from the JOSM measurement plugin wiki page and the OsmAnd measuring…

  • The Best Offline Map Apps for Travel and Hiking

    The Best Offline Map Apps for Travel and Hiking

    Heading out where signal fades? The best offline map apps are Organic Maps for simple free use, OsmAnd for deep customisation, and CoMaps if you want a community-run fork. Download your region before you leave. This guide sits within our wider look at street map tools, and it focuses on apps that keep working without…

  • How to Use OpenStreetMap: A Beginner’s Walkthrough

    How to Use OpenStreetMap: A Beginner’s Walkthrough

    Wondering how to use OpenStreetMap? Open the main map in your browser, search for a place, switch layers, and sign up for a free account when you want to fix or add something. This walkthrough is part of our guide to street map tools. This site is independent and is not affiliated with, endorsed by…