# 4.1 SHP上傳

SHP，ESRI Shapefile（shp），或簡稱shapefile，是美國環境系統研究所公司（ESRI）開發的空間資料開放格式。目前，該檔案格式已經成為了地理訊息軟體界的開放標準。 Shapefile檔案用於描述幾何體物件：點、折線與多邊形。例如，Shapefile檔案可以儲存井、河流、湖泊等空間物件的幾何位置。除了幾何位置，shp檔案也可以儲存這些空間物件的屬性，例如河流的名字、城市的溫度等等。([維基百科](https://zh.wikipedia.org/wiki/Shapefile#cite_note-esri98-1))

系統上傳要求至少須包含以下的副檔：

* **.shp** — 圖形格式，用於儲存元素的幾何實體
* **.shx** — 圖形索引格式。幾何體位置索引，記錄每一個幾何體在shp檔案之中的位置，能夠加快向前或向後搜尋一個幾何體的效率
* **.dbf** — 屬性資料格式，以dBase III+ 的資料表格式儲存每個幾何形狀的屬性資料
* **.prj** — 投影格式，用於儲存地理坐標系統與投影訊息，是一個儲存well-known text投影描述符的文字檔案
* **.cpg** — 用於描述.dbf檔案的頁碼，指明其使用的字元編碼。

本系統提供 SHP 檔案格式上傳資料，並可選擇依 TWD97 或經緯度座標系統，請依本系統提供之 SHP 檔案範本上傳檔案，並壓縮成 zip 檔案格式，上傳後系統將即時展繪於地圖。

![](/files/c8luYTUqajDbF4Qz7wSN)

{% hint style="warning" %}
上傳之檔案名稱請避免使用中文、符號。
{% endhint %}

SHP格式需求檔案包含五個項目.cpg、.dbf、.prj、.shp、.shx，請將此五個檔案放置於一資料夾中再進行壓縮。

![](/files/hrVWAVsjM3kQwhAjf0K5)

![](/files/teSbS0KGzCKYvPjGCOUJ)

{% hint style="info" %}
請將檔案放至同一資料夾後，再進行壓縮，壓縮請注意選擇「新增至壓縮檔(Bandzip)」。
{% endhint %}

開始進行檔案上傳，點選「選擇檔案並，選取壓縮好的zip檔案，選擇好檔案後再點選「確認上傳」。

![](/files/OJoNEAd6GVn7bvxYeD8u)

![](/files/q2gHhOd4MCqch24INe6N)

![](/files/lnLRBo7z4nwwvZqj2UwH)

當 SHP 上傳成功時，系統將立即將檔案中帶有空間資訊之點、線、面展繪於圖台上，同時加入「繪圖及圖形管理」以及「使用者自訂圖層」，使用者圖層使用方式與主圖圖層一致，可加入、刪除、變換順序、調整透明度。

![](/files/36bZXTDMiYHdhDZYNHA7)

![](/files/SOj4G2varAZkHVESphwu)

![](/files/a3gFsL47Aqia9bV5gW51)

當圖形加入繪圖及上傳圖形管理，亦可下載該 SHP 或 GeoJson 檔案供使用者加值應用。

圖層使用方式可參考本講義 2.2 節。

{% content-ref url="/pages/-Lan\_xB39cqoQsYYEhY3" %}
[2.2 圖層套疊(底圖、主題圖)](/hlgis/ch2-operation/ch2-layer-nesting.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hlcecige.gitbook.io/hlgis/ch4-file-upload-analysis-and-data-nesting/4.2-shp-upload.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
