首頁 資料庫 mysql教程 PostGIS常见的空间数据的导入导出

PostGIS常见的空间数据的导入导出

Jun 07, 2016 pm 05:18 PM
數據

本片文章简单记录了PostGIS涉及的常用数据导入导出的使用方法。这里要注意几个参数,是选用-c还是-a要看你的应用方式,-S这个是在

本片文章简单记录了PostGIS涉及的常用数据导入导出的使用方法。

1.将osm数据导入PostGIS

osm2pgsql -c -d osm -l -E 4326 -S /usr/share/osm2pgsql/default.style xxxxx.osm


这里要注意几个参数,是选用-c还是-a要看你的应用方式,-S这个是在Ubuntu下路径不同时使用,espg可以不用再使用900913了。自然要使得数据库采用UTF8编码最好。

osm2pgsql SVN version 0.70.5
Usage:
osm2pgsql [options] planet.osm
osm2pgsql [options] planet.osm.{gz,bz2}
osm2pgsql [options] file1.osm file2.osm file3.osm


This will import the data from the OSM file(s) into a PostgreSQL database
suitable for use by the Mapnik renderer


Options:
   -a|--append Add the OSM file into the database without removing
              existing data.
   -b|--bbox Apply a bounding box filter on the imported data
              Must be specified as: minlon,minlat,maxlon,maxlat
              e.g. --bbox -0.5,51.25,0.5,51.75
   -c|--create Remove existing data from the database. This is the
              default if --append is not specified.
   -d|--database The name of the PostgreSQL database to connect
                to (default: gis).
   -i|--tablespace-index The name of the PostgreSQL tablespace where indexes will be create
                to (default: pg_default).
   -l|--latlong Store data in degrees of latitude & longitude.
   -m|--merc Store data in proper spherical mercator (default)
   -M|--oldmerc Store data in the legacy OSM mercator format
   -E|--proj num Use projection EPSG:num
   -u|--utf8-sanitize Repair bad UTF8 input data (present in planet
                dumps prior to August 2007). Adds about 10% overhead.
   -p|--prefix Prefix for table names (default planet_osm)
   -s|--slim Store temporary data in the database. This greatly
            reduces the RAM usage but is much slower.
   -S|--style Location of the style file. Defaults to /usr/share/default.style
   -C|--cache Only for slim mode: Use upto this many MB for caching nodes
              Default is 800
   -U|--username Postgresql user name.
   -W|--password Force password prompt.
   -H|--host Database server hostname or socket location.
   -P|--port Database server port.
   -e|--expire-tiles [min_zoom-]max_zoom Create a tile expiry list.
   -o|--expire-output filename Output filename for expired tiles list.
   -r|--input-reader Input frontend.
              libxml2   - Parse XML using libxml2. (default)
              primitive - Primitive XML parsing.
   -O|--output Output backend.
              pgsql - Output to a PostGIS database. (default)
              gazetteer - Output to a PostGIS database suitable for gazetteer
              null  - No output. Useful for testing.
   -x|--extra-attributes
              Include attributes for each object in the database.
              This includes the username, userid, timestamp and version.
              Note: this option also requires additional entries in your style file.
   -k|--hstore Generate an additional hstore (key/value) column to  postgresql tables
   -z|--hstore-column Generate an additional hstore (key/value) column to containing all tags
                      that start with the specified string, eg --hstore-column "name:" will
                      produce an extra hstore column that contains all name:xx tags
   -G|--multi-geometry Generate multi-geometry features in postgresql tables.
   -K|--keep-coastlines Keep coastline data rather than filtering it out.
              By default natural=coastline tagged data will be discarded based on the
              assumption that post-processed Coastline Checker shapefiles will be used.
   -h|--help Help information.
   -v|--verbose Verbose output.


Add -v to display supported projections.
Use -E to access any espg projections (usually in /usr/share/proj/epsg)

linux

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
2 週前 By 尊渡假赌尊渡假赌尊渡假赌
倉庫:如何復興隊友
4 週前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

使用ddrescue在Linux上恢復數據 使用ddrescue在Linux上恢復數據 Mar 20, 2024 pm 01:37 PM

使用ddrescue在Linux上恢復數據

開源!超越ZoeDepth! DepthFM:快速且精確的單目深度估計! 開源!超越ZoeDepth! DepthFM:快速且精確的單目深度估計! Apr 03, 2024 pm 12:04 PM

開源!超越ZoeDepth! DepthFM:快速且精確的單目深度估計!

如何多條件使用Excel過濾功能 如何多條件使用Excel過濾功能 Feb 26, 2024 am 10:19 AM

如何多條件使用Excel過濾功能

超級智能體生命力覺醒!可自我更新的AI來了,媽媽再也不用擔心資料瓶頸難題 超級智能體生命力覺醒!可自我更新的AI來了,媽媽再也不用擔心資料瓶頸難題 Apr 29, 2024 pm 06:55 PM

超級智能體生命力覺醒!可自我更新的AI來了,媽媽再也不用擔心資料瓶頸難題

Google狂喜:JAX性能超越Pytorch、TensorFlow!或成GPU推理訓練最快選擇 Google狂喜:JAX性能超越Pytorch、TensorFlow!或成GPU推理訓練最快選擇 Apr 01, 2024 pm 07:46 PM

Google狂喜:JAX性能超越Pytorch、TensorFlow!或成GPU推理訓練最快選擇

iPhone上的蜂窩數據網路速度慢:修復 iPhone上的蜂窩數據網路速度慢:修復 May 03, 2024 pm 09:01 PM

iPhone上的蜂窩數據網路速度慢:修復

美國空軍高調展示首個AI戰鬥機!部長親自試駕全程未乾預,10萬行代碼試飛21次 美國空軍高調展示首個AI戰鬥機!部長親自試駕全程未乾預,10萬行代碼試飛21次 May 07, 2024 pm 05:00 PM

美國空軍高調展示首個AI戰鬥機!部長親自試駕全程未乾預,10萬行代碼試飛21次

首個自主完成人類任務機器人出現,五指靈活速度超人,大模型加持虛擬空間訓練 首個自主完成人類任務機器人出現,五指靈活速度超人,大模型加持虛擬空間訓練 Mar 11, 2024 pm 12:10 PM

首個自主完成人類任務機器人出現,五指靈活速度超人,大模型加持虛擬空間訓練

See all articles