This is a static archive of our old OSM Help Site. Please post any new questions and answers at community.openstreetmap.org.

Keep buildings only in osm file

1

Hello! I'm trying to convert osm to kmz. I've found one solution, but I need to make osm much smaller. https://lh6.googleusercontent.com/-0azPV5xcqRU/UThetPP9JCI/AAAAAAAAAMM/4WYBEnYzP0M/s800/buildings_big.jpg

How can I keep only buildings in osm file? It will be perfect to keep buildings outline only with height visulization like on screenshot.

asked 19 Dec '16, 13:48

squadgazzz's gravatar image

squadgazzz
31336
accept rate: 0%

edited 19 Dec '16, 13:49

1

What is your current solution?

(19 Dec '16, 15:38) skorbut

convert OSM to OBJ > convert OBJ to KMZ

(21 Dec '16, 06:18) squadgazzz

2 Answers:

2

You can use osmfilter a very simple tool for such task:

osmfilter my-data.osm --keep=building=* -o=my-data-buildings.osm

answered 21 Dec '16, 11:08

Gagan's gravatar image

Gagan
3053515
accept rate: 14%

thank you! do you maybe know a better way to visualize buildings height and convert file to kmz/kml for google earth? now I'm doing this - convert OSM to OBJ > convert OBJ to KMZ. It doesnt work for files more than 100mb size. After filtering buildings I have 500mb size file..

(21 Dec '16, 11:38) squadgazzz

If you just want a visualization you can take a look at OSM2World.

(21 Dec '16, 12:06) scai ♦

@squadgazz I have not worked on OSM 3D building, so can not suggest on this.

(21 Dec '16, 16:41) Gagan

2

Are you familiar with the Overpass API? I've used Overpass Turbo to visualise a simple query to extract only building=* in your area:

http://overpass-turbo.eu/s/kMy

You can also get KML or geoJSON directly from the overpass API to import in Google Earth. In Overpass Turbo, go to 'Export', then choose the format you want.

answered 20 Dec '16, 20:30

Stereo's gravatar image

Stereo
3562513
accept rate: 11%

edited 20 Dec '16, 20:34

cool,thanks. but how to visualize buildings height like on screenshot?

(21 Dec '16, 06:28) squadgazzz

also I have a problem with export the whole city. Moscow for example.. I already have osm file of this city(1500mb size). But don't know how to keep buildings only to make file much smaller

(21 Dec '16, 06:46) squadgazzz