Osm2pov on the Mac
|The 3D Development team are currently working on unifying 3D related tags.
For first results see Simple 3D Buildings.
OSM2POV is an converter that produces 3D files for PovRay basing upon OSM geodatas.
This page shows how I get
osm2pov to work on my Mac (Mac OS X 10.6.5, Snow Leopard). This solution is quick and dirty; it is neither the only nor the best way to accomplish this; improvements are appreciated.
You need gcc/g++ V4.3 or higher in order to support the most recent C++ standard (compiler flag
-std=c++0x), but Apple uses 4.2.1 by default.
If you have installed Darwin, you just need to get gcc44 by running
sudo port install gcc44. This may take some time (on my 3 year-old iMac about 30 minutes).
Save the old g++ link by running
sudo mv /usr/bin/g++ /usr/bin/g++.old
Then replace the smybolic link to
sudo ln -sf /opt/local/bin/g++-mp-4.4 g++. Please note that this replaces the standard g++ compiler V4.2.1 provided by Apple.
Install Boost lib
Download the free Boost C++ library for Mac OS X.
Download OSM2POV sources
- Get the source via
git clone https://github.com/guerda/osm2pov.git.
- Add a symbolic link to the include dir of the Boost lib in the osm2pov base dir:
osm2pov$ ln -s <path_to_boost_lib>/boost_1_45_0/boost boost
Adaptions to the source code
- Add the Boost include path: Insert line
INCLUDES = -Iboostin the Makefile
- Same for
- Add line
using namespace boost;at least before the declaration of
- Change private member in class Primitives from
The code should compile and link now. You can check it by running
./osm2pov <osm_file> <pov_file>
Installing povray in MacOS 10.7
If you have the problem that the renderings generated with povray are empty or at least incomplete you should try compiling with clang (using homebrew for example):
sudo brew install povray --use-clang
See also [README of osm-isometric-3d] for more information to setup rendering.