> For the complete documentation index, see [llms.txt](https://docs.geopard.tech/geopard-tutorials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.geopard.tech/geopard-tutorials/jpn/giskuikkuhinto/qgis-change-string-to-number-values-in-the-shapefile.md).

# QGIS：シェープファイルのテキストフィールドを数値に変換する

QGISのフィールド計算機でto\_real()またはto\_int()を使い、テキスト値を数値に変換します。小数を保持し、インポートできない散布量列や収量列を修正する方法を説明します。

属性テーブルを開き、フィールド計算機を起動して、新しい小数フィールドを作成し、次の式を入力します `to_real("your_field")`。 `to_int()` 整数にはこちらを使います。保存後に小数が消える場合は、出力フィールドの長さを0にするか、精度を0より大きく設定してください。収量や散布量の列を地図上で色分けできない、または散布量としてインポートできない場合、数値がテキストとして保存されていることがよくあります。

{% hint style="success" %}
修正したファイルをアップロードして、地図として表示しましょう。 [無料で始める](https://app.geopard.tech/auth/sign-up?utm_source=docs\&utm_medium=cta\&utm_campaign=qgis-change-string-to-number-values-in-the-shapefile)
{% endhint %}

QGISでは、「フィールド計算機」ツールを使って文字列を数値に変換できます。まず、変更するレイヤーの属性テーブルを開きます。次に、「フィールド計算機を開く」ボタンをクリックします。「式」ボックスに「to\_real(」と入力し、変換する文字列が格納されているフィールド名を続けて入力して、閉じ括弧を付けます。たとえば、「string\_field」という文字列フィールドを数値フィールドに変換するには、「式」ボックスに「to\_real("string\_field")」と入力します。必要に応じて、適切なオプションを選択し、出力フィールド名やデータ型を変更することもできます。最後に「OK」をクリックして変換を完了します。元の文字列フィールドは属性テーブルに残り、新しい数値フィールドがテーブルに追加されます。

<figure><img src="https://1993076779-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYICBELdyAXXebKAzfLOR%2Fuploads%2Fi3rxrGu9XbcEMSGWGGEX%2FScreenshot%202023-04-03%20at%2017.22.03.png?alt=media&amp;token=1425fbc0-f7fa-4d0d-b794-b50c8db37b8d" alt=""><figcaption></figcaption></figure>

1. 「プロパティ」を開く
2. 「フィールド計算機」に移動する
3. 「既存のフィールドを更新」にチェックを入れる
4. to\_real("attributeName")
5. 編集内容を保存する
6. 属性ごとに同じ操作を繰り返す

   <figure><img src="https://1993076779-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYICBELdyAXXebKAzfLOR%2Fuploads%2Fc6LPt5wG8QlPkfn1B00s%2FScreenshot%202023-04-03%20at%2017.29.49.png?alt=media&amp;token=86437f74-6d54-4cae-8e04-ff319e4769a6" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
修正したファイルをアップロードして、地図として表示しましょう。 [無料で始める](https://app.geopard.tech/auth/sign-up?utm_source=docs\&utm_medium=cta\&utm_campaign=qgis-change-string-to-number-values-in-the-shapefile)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.geopard.tech/geopard-tutorials/jpn/giskuikkuhinto/qgis-change-string-to-number-values-in-the-shapefile.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
