How can I convert an OSM file to Shapefile? Is there a good tool or a good web page.
I tried this link https://code.google.com/archive/p/osm2shp/, but there is an error.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
If you install the GDAL and OGR tools (open source, available for all major operating systems, see osgeo.org for downloads and details) you can do this on a command line:
$ ogr2ogr maps map.osm
and it will extract the OSM file into an existing folder called "maps" as several shapefiles. Note that OSM layers can contain more than one geometry type, but shapefiles can't, so you might see:
ERROR 6: Geometry type of `Geometry Collection' not supported in shapefiles. Type can be overridden with a layer creation option of SHPT=POINT/ARC/POLYGON/MULTIPOINT/POINTZ/ARCZ/POLYGONZ/MULTIPOINTZ/MULTIPATCH.
Better to save to a GeoPackage, which can handle Geometry Collection and long field names (another source of shapefile errors):
$ ogr2ogr -f GPKG map.gpkg map.osm 0...10...20...30...40...50...60...70...80...90...100 - done.
now you have a GeoPackage file that contains all the layers which can be read in most major GIS packages.
Use an online tool on the following website: https://export.hotosm.org