Exporting planet.osm.pbf into PostgreSql - postgresql

could someone help with this? I found only this: http://wiki.openstreetmap.org/wiki/Osm2pgsql
and this:
http://learnosm.org/en/osm-data/osm2pgsql/ but
windows binary was removed, and I never use cygwin or linux bash.
Actually I've installed Postgresql with postgis, and downloaded planet.osm.pbf.
I need some advice how to proceed with Osm2pgsql, wich will be helpful for newbie. Thanks

I would suggest running a an Ubuntu Server (14.04 or 16.04) and following the instructions here:
https://switch2osm.org/serving-tiles/building-a-tile-server-from-packages/
You can run this on a Virtualbox from your windows machine.
The reason I suggest this is that you will only make things more difficult for yourself trying to install on windows.
I myself was completely new to Linux before I installed my MapServer, and I found it really easy to follow.

Osmosis can also do imports of osm (pbf) file to postgres DB with postgis extension. http://wiki.openstreetmap.org/wiki/Osmosis

Related

PostGIS Installation "could not open extension control file"

I've been scouring posts trying to figure out how to resolve this issue - could not open extension control file "/usr/local/share/postgresql/extension/postgis.control": No such file or directory
I'm installing PostgreSQL and PostGIS with apt-get install postgresql-12 postgis postgresql-12-postgis-3 into a Docker container running python:latest. I'd initially been running Alpine however it seemed there were a number of issues getting PostGIS installed successfully on Alpine distributions.
I've located the file with find /usr -name postgis.control under /usr/share/postgresql/12/extension/postgis.control. I've attempted to move this to the directory PostGIS expects, but I'm still seeing the same error.
It's been driving me totally mad!
Any help is appreciated, and happy to answer any questions that will help me find an answer.
I was never able to resolve this issue, so I ended up switching to the official postGIS docker image which worked flawlessly. Would recommend it to anyone else in a similar situation.
I had the same issue, but installing PostGIS on the ubuntu machine worked for me.
apt-get install postgis*
After the installation above, I was able to create the extension as expected.
CREATE EXTENSION postgis

Installing temporal_tables and cyanaudit extensions in PostgreSQL for Windows

I have an auditing and slowly changing dimensions (SCD) use case that requires the installation of the PostgreSQL temporal_tables and cyanaudit extensions.
However my PostgreSQL server is on Windows and after searching high and low, I still haven't found a way to install these extensions in PostgreSQL for Windows.
Has anyone succeeded in installing these extensions in the Windows environment and can you please share your methodology?
Thanks a million,
JDaniel
I have not tried to install these extensions on Windows but I suggest you have a look on the related source code repositories.
temporal_tables is stored on GitHub: if you search in open and closed issues about Windows installation, I have found: https://github.com/arkhipov/temporal_tables/issues/19.
cyanaudit is stored on bitbucket and I have not found anything related to Windows.
However installation should be easier because it is mainly SQL and PL/PGSQL code: you need to be able to use tar and perl because the installer is using Perl.

how to install postgresql on Linux

I'm new to Linux and have been using KDE for a little while. I'm working on learning more ruby on rails. The book I'm reading uses postgresql but I cannot find a walkthrough of installing postgresql on KDE. On this page - https://yum.postgresql.org/repopackages.php#pg10 - it doesn't list an rpm for KDE so I'm not sure if there's another one I can use or not. I don't know enough about Linux/KDE yet to know. Does anyone know if I can use any of the packages on that page or if there's another way to install postgresql on KDE?
Simple solution
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
sudo -i -u postgres
psql
So KDE is your desktop. It could be used on almost any operating system, and probably doesn't determine your install. It's more about distros/OS that you're on. So, what OS are you on? Wild guess Fedora or Ubuntu. Here are the install guides for each:
Fedora: https://fedoraproject.org/wiki/PostgreSQL
Ubuntu: https://www.postgresql.org/download/linux/ubuntu/
Neither is as bad as it seems. Just take them step by step.
BTW, in the Linux world the command line is king. At first, this will seem daunting, but after a while, you'll find it faster for many things. Maybe Learn Enough Command Line to Be Dangerous would help.

PHP5 - pgsql Module not loaded

I am trying to get work PostgresSQL with PHP, but i stuck on that apache error:
Call to undefined function pg_connect().
When i run phpinfo() i cannot see that my module is loaded, but i do not know why. The pgsql.ini files were loaded. And when i open them, i can see, that the extension is enabled extension=pgsql.so. Under /usr/lib64/php5/extensions there is the .so file. Even the permission are same like the other modules.
Any idea what am I doing wrong?
It would help if you could describe what operating system you are using. I'm assume Linux, but which distribution? One package that is often forgotten when installing postgresql and php is php5-pgsql. This is the connection between the two. For some reason I cannot explain, it is best if all three are installed together. So I suggest uninstalling postgresql and php and then installing postgresql, php5 and php5-pgsql. I hope this works for you!
I found it out. Some libraries where not found.
1.) First of all run php -version
2.) If there is an error where it described that some libraries are missing, you can solve it like me
3.) Search for the files on your system find / -name {LIBRARY NAME}
3a.) If you found them, just create a symlink to /usr/lib64
3b.) If not, find a way to get them and 3 3a

Zend CLI Tool issue - php: permission denied?

today i have recompiled PHP with PDO msql driver and now i cant use Zend CLI tool anymore.
Before Zend CLI tool was working fine, but now i get:
./zf.sh: 44: php: Permission denied
I am really out of ideas what is the problem here :/
i have tried changing permsissions, groups, google... but i didnt find any answers for this type of problem :/
Please help if you have any suggestion what should i do :)
Almost forgot:
Ubuntu, PHP 5.3 (as module) on apache 2.0
thanks for your time and reply!
Edit (PB): For those wondering, line 44
"$PHP_BIN" -d safe_mode=Off -f "$PHP_DIR/zf.php" -- "$#"
Why did you recompile php5? You can just compile the required PDO libs as well you know :p.
And AFAIK MSSQL is (or was at least) compatible with the Sybase DB drivers, so you could just as easily use these.
Check out Install PDO, PDO_SQLITE, PDO_DBLIB, PDO_MYSQL, it should work for Ubuntu too since it's Debian based.
BTW Just reinstall php5 that came with Ubuntu first, then follow the instructions there.
Hope it helps!