# Beware this footprintWKT bug

**URL:** <https://discourse.gbif.org/t/beware-this-footprintwkt-bug/3858>\
**Category:** Data Publishing\
**Created:** [February 24, 2023, 3:34am UTC](https://discourse.gbif.org/t/beware-this-footprintwkt-bug/3858 "2023-02-24T03:34:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![datafixer](https://sea1.discourse-cdn.com/gbif1/user_avatar/discourse.gbif.org/datafixer/32/956_2.png) [@datafixer](https://discourse.gbif.org/u/datafixer)\
**Post date:** [February 24, 2023, 3:34am UTC](https://discourse.gbif.org/t/beware-this-footprintwkt-bug/3858/1 "2023-02-24T03:34:51Z")

</div>

WKT (Well-Known Text) is a great way to represent points, lines and polygons. It treats them as points, strings-of-points and strings-of-points-in-a-loop, respectively.

The rules for building WKT representations are simple. Points are longitude first, latitude second. There is a single space between numbers, and a single comma between points. There are parentheses around points and linestrings, and parentheses around each individual polygon as well. The last point in a polygon is the same as the first point. The following three examples of WKT geometry from a well-known location in Copenhagen are illustrated [here](https://www.datafix.com.au/BASHing/2021-11-17.html).

POINT (12.559220 55.702230)

LINESTRING (12.559245 55.702060,12.559479 55.702275,12.559272 55.702346,12.559031 55.702122)

POLYGON ((12.559245 55.702060,12.559479 55.702275,12.559272 55.702346,12.559031 55.702122,12.559245 55.702060))

In my data auditing for Pensoft Publishers, I’ve recently seen what seems to be a fault in software used to generate WKT data for Darwin Core tables. Here’s an example:

_decimalLatitude_ = 43.32552  
_decimalLongitude_ = 6.35002  
_footprintWKT_ = POINT(6.350019999900324 **43** )

I don’t know what program was used to build the WKT, but it has rounded or truncated the decimal latitude to a whole number of degrees, which is a serious error. (It may also have expanded the original decimal longitude - see [this community forum post](https://discourse.gbif.org/t/a-bird-at-55-33236879409907-10-798312272550604-4-068529808544554-meters/3855) - but that isn’t a mistake.)

Please check for this latitude problem if you are using the _footprintWKT_ field in your Darwin Core tables.

Because the WKT format is simple, you might consider building your own WKT from latitude/longitude data. In a spreadsheet, a point WKT is easily built from latitude and longitude entries using a formula. Linestring and polygon WKT can also be built in a spreadsheet, but might be more easily constructed on the command line.

Suppose I have these 5 latitude/longitude points from a marine transect in the North Atlantic Ocean:

28.557196,-52.785557  
25.883987,-56.079968  
26.586877,-60.893646  
29.785980,-61.437383  
31.900281,-59.566286

Saving the points as the file “transect.txt”, I would use AWK and sed to build the linestring WKT:

![2](https://global.discourse-cdn.com/gbif1/original/1X/8cf6f9249fcb5174d7274e92b9e558cbddbc1388.png)

For checking WKT representations on a map, I highly recommend Clyde D’Cruz’s [_OpenStreetMap WKT Playground_](https://clydedacruz.github.io/openstreetmap-wkt-playground/), which displays my 5-point transect this way:

 ![1](https://global.discourse-cdn.com/gbif1/original/1X/1c0294a198d9a57163538a414d52e5a9b65e1123.png)

* * *

_Robert Mesibov (“datafixer”); [robert.mesibov@gmail.com](mailto:robert.mesibov@gmail.com)_

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/gbif1/original/1X/d2525d53d815eb0c992cc44730ed8a6a1be1dbb5.png) [@system](https://discourse.gbif.org/u/system)\
**Post date:** [March 26, 2023, 1:35pm UTC](https://discourse.gbif.org/t/beware-this-footprintwkt-bug/3858/2 "2023-03-26T13:35:02Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
