drxzpo70788179614 2015-03-06 22:40
浏览 88
已采纳

如何在我的mysql数据库中获取planet-latest.osm.bz2?

I have an Intel i3-2350M CPU @ 2.30GHz with Windows 7, 64 bit, 4GByte Ram and enough free HD space.

The openstreetmap-file planet-latest.osm.bz2 is very big and compressed. (The version I have is 36 GByte compressed, and I believe it's like 100 GByte uncompressed. I have a mysql-database running, that I installed with XAMPP. (So I have apache and php available, too.)

My questions are:

  1. The OSM-project seems to have switched to postgresql and postgis. Is this really better (===faster) than MySql? (I strongly doubt that.)
  2. Is there a set of commands to get the compressed file into the database? Or would it reduce the risk of failure of the commands if I first decompress it? 2b. Could I discard of all XML-nodes that are not neccessary for the graphical output in the process of importing the data into the database? (With one stroke. :P )
  3. It's possible for me to convert the data to a .csv-file (out of the XML): Would that make it more complacent to get the data into the database?
  4. How long will the machine take? I can't let it run for hours without supervision. (I can break up the big file in smaller files, though I deem this to be error prone and not advisable.)

Greetings John

P.S. I have most if not all standard programs at hand that are linked ont he OSM-wiki. (Though the OSM-wiki is outright deficient and a bit outdated about the currently available tools.)

  • 写回答

1条回答 默认 最新

  • douzaipou3327 2015-03-06 23:02
    关注

    Open Street Map uses geographic information system features in postgreSQL that aren't available in MySQL. In particular, some of the operations use GIS map-projection features.

    Here's a description of the various schemas and their requirements for database server make and model. http://wiki.openstreetmap.org/wiki/Databases#Database_Schemas

    Both postgreSQL and MySQL are decently fast technologies on 64 bit platforms. For a database the size of global OSM, your performance will depend on fast storage as well as processing power.

    It's hard to give advice about what technology might be faster without knowing a lot more about what you're trying to do. But I can say this: by using the technology created and tested by the open street map team, your nodes-per-month performance will be higher for at least a couple of months -- the months you would spend adapting the data.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值