# WKB or WKT in a database

<table data-header-hidden><thead><tr><th width="193.5"></th><th></th></tr></thead><tbody><tr><td>Read</td><td>Yes</td></tr><tr><td>Write</td><td>Yes</td></tr></tbody></table>

JMap Server can connect to databases containing geometries that have been coded according to WKB and WKT standards (<http://en.wikipedia.org/wiki/Well-known_text>).

In addition to the column containing the geometry, you must have a number column with unique integer values used as element identifiers. There must also be 4 columns containing the values of minimum bounding rectangles (MBR).

An SQL query must be provided. The query will be launched to read the data and it can access more than one table at a time.

The connection to the database must already be configured. Refer to the section [Creating Databases](/en2/administrator/jmap-server-administrator-manual/databases/creating-databases.md) for more information on this topic.

<table data-header-hidden><thead><tr><th width="187.5"></th><th></th></tr></thead><tbody><tr><td><strong>Parameters</strong></td><td> </td></tr><tr><td>Database</td><td>Select the database from which the data must be read. This database must already be configured in JMap Admin.</td></tr><tr><td>SQL query</td><td>Enter the SQL query used to extract geometries and attributes from the database.</td></tr><tr><td>Geometry table</td><td>Select the physical table containing the geometries. Clicking on <strong>Load</strong> displays the list of fields returned by the query. This action is required to proceed with the configuration.</td></tr><tr><td>Geometry field</td><td>Select the field containing the geometries.</td></tr><tr><td>Geometry type</td><td>Select the format of the data to read, either WKB or WKT.</td></tr><tr><td>Encoding (for WKB only)</td><td>If the data format is WKB, you must indicate the type of coding used by the data: Little Endian or Big Endian.</td></tr><tr><td>MBR X1</td><td>Minimum X value of the minimum bounding rectangle (MBR) in the geometry.</td></tr><tr><td>MBR Y1</td><td>Minimum Y value of the minimum bounding rectangle (MBR) in the geometry.</td></tr><tr><td>MBR X2</td><td>Maximum X value of the minimum bounding rectangle (MBR) in the geometry.</td></tr><tr><td>MBR Y2</td><td>Maximum Y value of the minimum bounding rectangle (MBR) in the geometry.</td></tr><tr><td>Id field</td><td>Select a field that contains unique identifiers. Only the fields containing whole numbers are listed.</td></tr><tr><td>Creation time field</td><td>(Optional) If you want this data source to be editable by JMap, this field will show the creation date of each object. If no field is selected, the data can still be edited, but this information will not be maintained.</td></tr><tr><td>Modification date field</td><td>(Optional) If you want this data source to be editable by JMap, this field will contain the date each object was last modified. If no field is selected, the data can still be edited, but this information will not be maintained.</td></tr><tr><td>Author field</td><td>(Optional) If you want this data source to be editable by JMap, this field will either contain the name of the user who created each object or the name of the user who made the last change. If no field is selected, the data can still be edited, but this information will not be maintained.</td></tr></tbody></table>


---

# 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://docs.k2geospatial.com/en2/administrator/jmap-server-administrator-manual/spatial-data-sources/vector-data-sources/wkb-or-wkt-in-a-database.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.
