Specify double coordinate sets can't be mapped to DarwinCore

Some of our locality entries have double coordinates, which Specify supports, especially in combination with the Latitude/Longitude Type field. However, in DarwinCore there is only one set of coordinates fields (http://rs.tdwg.org/dwc/terms/decimalLatitude , http://rs.tdwg.org/dwc/terms/decimalLongitude )

There are, of course, alternative options in DarwinCore like e.g. (http://rs.tdwg.org/dwc/terms/footprintWKT), but it is not at all clear how I would be able to manipulate the export to fit with that. Also, I would rather prefer to transfer the coordinates themselves, unless it was in a separate, and parallel set of fields. I cannot really see any optimal solution to this.

Version: Specify 7.9.6

@fedoras How many sets of coordinates does your institution ‘want’ to assert for a record? Am I correct in assuming that you are talking about your databases recording verbatim coordinates in degrees, minutes, seconds, and also the conversion of those coordinates into decimal degrees?
IMO, this is a DWC problem, not a Specify problem. Specify can hold any kind of data, but DarwinCore only cares about the data you’re asserting as “true” or correct.

If you really want to keep the old coordinates, you could include the verbatim coordinates as text string in dwc:georeferenceRemarks, which people generally seem to map Specify term GeoRefRemarks in the GeoCoordDetail table to. I do this in some instances where there was an original georeference for a record that was incorrect, but incorrect in a way that I think would be confusing to future users (such as when the verbatim coordinates on the label are incorrect).

If I’m misunderstanding, and you’re talking about “double coordinates” meaning records which have the locality as a transect where you have a starting point indicated by lat1, long1 and an ending point indicated by a lat2, long2, that is a trickier situation. I record everything in our collection as “Point-Radius” to avoid this situation, as it’s messy to indicate start and stop points in dwc format. I generally just put the point at the midpoint of the transect and set the uncertainty to include both start and stop termini.

The footprintWKT term is really for more complex geometries, but you can definitely use it for lines. The WKT syntax for a line with two points is LINESTRING (lat1 long1,lat2 long2). I think you could probably set that up by using a conditional format or aggregator rule.

1 Like

Hi @fedoras and @nfshoobs,

I agree with Nate, it would be nice if Darwin Core had fields explicitly for this purpose rather than requiring the data to be mapped to well-known text (WKT). @nfshoobs– thank you so much for your write up and input about tracking coordinates as “Point-Radius”!

To try and address your question Fedor, I created a conditional table format for Locality that represents the data the best I could within the Query Builder framework.

For exclusively export queries, you can explicitly choose a custom table format using the :gear_: icon next to the (formatted) query line (introduced in v7.9.6, so you should have access):

Here’s the XML snippet for the Record Formatters (DataObjFormatters) app resource. Note that I used a custom display format (format="%s)") to add a static suffix to the end of the table format, which can only be done via the XML, not the UI at this time (#6066).

<format name="dwc:footprintWKT" title="dwc:footprintWKT" class="edu.ku.brc.specify.datamodel.Locality" default="">
	<switch single="false" field="latLongType">
		<!-- POINT -->
		<fields value="Point">
			<field sep="POINT (">longitude1</field>
			<field sep=" " format="%s)">latitude1</field>
		</fields>
		<!-- LINESTRING -->
		<fields value="Line">
			<field sep="LINESTRING (">longitude1</field>
			<field sep=" ">latitude1</field>
			<field sep=", ">longitude2</field>
			<field sep=" " format="%s)">latitude2</field>
		</fields>
		<!-- RECTANGLE -->
		<fields value="Rectangle">
			<field sep="POLYGON ((">longitude1</field>
			<field sep=" ">latitude1</field>
			<field sep=", ">longitude2</field>
			<field sep=" ">latitude1</field>
			<field sep=", ">longitude2</field>
			<field sep=" ">latitude2</field>
			<field sep=", ">longitude1</field>
			<field sep=" ">latitude2</field>
			<field sep=", ">longitude1</field>
			<field sep=" " format="%s))">latitude1</field>
		</fields>
	</switch>
</format>

This produces the output I was hoping for, where the type of coordinates dictates how the WKT string is constructed. The formatted Locality record can be mapped then to dwc:footprintWKT term in an export mapping if desired. Definitely make sure to test the output with https://wktmap.com/ before publishing. :slight_smile:

Does something like this seem reasonable?

Hi @fedoras , @nfshoobs and @Grant.

I don’t think DarwinCore should change or add any support for other kind of notation. For georeferencing best practices, please refer to
Zermoglio PF, Chapman AD, Wieczorek JR, Luna MC & Bloom DA (2020) Georeferencing Quick Reference Guide. Copenhagen: GBIF Secretariat. https://doi.org/10.35035/e09p-h128
Chapman AD & Wieczorek JR (2020) Georeferencing Best Practices. Copenhagen: GBIF Secretariat. https://doi.org/10.15468/doc-gg7h-s853

Regarding @fedoras question, when we have more than a LatLon pair in Specify (transect or square), it should be converted to a point radius notation, which is mathematically easy to do - I can give some hints on how to calculate this if needed. Recording these coordinate tranformation can be done as @nfshoobs suggested (i.e. recording the result in Specify), or every time after export in the resulting DarwinCore archive.

Let me add that regarding export, my approach is to use a custom script to query the database and build my DarwinCore making all the necessary transformations (including coordinates) as it goes, rather than using Specify DataExporter. The main reason is the automation of all the process, so it can be triggered by a CronJob, place the export in a web server and published by the GBIF IPT using this URL, all without human intervention whatsoever.

1 Like

Hi everyone,

I have just seen your feedback now and already had solved in a somewhat similar way.

I have simply calculated the mid point of the rectangle and saved that single coordinate set in fields lat1text and long1text, and the calculated radius I put in “coordinateUncertaintyInMeters”. At the same time, I created the polygon string that I put in footprintWKT, offering GBIF both options.

<field term="http://rs.tdwg.org/dwc/terms/footprintWKT"          isNot="false" isRelFld="false" oper="8" stringId="1,10,2.locality.text3" value=""/>
<field term="http://rs.tdwg.org/dwc/terms/decimalLatitude"       isNot="false" isRelFld="false" oper="8" stringId="1,10,2.locality.lat1text" value=""/>
<field term="http://rs.tdwg.org/dwc/terms/decimalLongitude"      isNot="false" isRelFld="false" oper="8" stringId="1,10,2.locality.long1text" value="" />
<field term="http://rs.tdwg.org/dwc/terms/coordinateUncertaintyInMeters" isNot="false" isRelFld="false" oper="8" stringId="1,10,2.locality.latLongAccuracy" value=""/>

And it appears to be working fine:

Thank you for chipping in with your thoughts and suggestions nevertheless.

1 Like

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