SQL

Id Coordinate Source

The sql implementation of id coordinate source uses PostgreSql with the addon PostGis. PostGis is used to improve the querying of geographical data. The Coordinate attribute is stored as a Geography with the type Point and the default SRID 4326.

Export

To export weather and coordinate tables to CSV, use the following queries:

COPY (
SELECT
	to_char(time, 'YYYY-MM-DD"T"HH24:MI:SS"Z"') AS time,
	coordinate_id,
	aswdifd_s,
	aswdir_s,
	t2m,
	u131m,
	v131m
FROM weathervalue
) TO '/tmp/weather.csv' CSV HEADER
COPY (
SELECT
	id,
	ST_X (coordinate::geometry) AS longitude,
	ST_Y (coordinate::geometry) AS latitude,
	'ICON' as coordinate_type
FROM coordinate
) to '/tmp/coordinates.csv' CSV HEADER