


Parse the GeoJSON with the Exasol native function json_extract to produce a table with one row for each country (see JSON_EXTRACT for more details).
DBEAVER IMPORT CSV FULL
Load the full GeoJSON string into a VARCHAR(2000000) column in a table (mind that this does not work if the GeoJSON is larger than two million characters).When you generate a custom JSON file on this site, the file consists of one JSON object, a so-called FeatureCollection, which contains multiple polygons and multi-polygons, one for each country.
DBEAVER IMPORT CSV DOWNLOAD
On, you can download countries as geodata. GeoJSON is an often-used format for storing and exchanging geodata. Select st_distance(ST_Transform(a.geo, 2163), ST_Transform(b.geo, 2163))įrom airports a, airports b where a.name = 'Berlin-Tegel Airport' and b.name = 'Berlin Hauptbahnhof' Importing data from GeoJSON The first two fields of the file are the id and the name of the airport in columns 7 and 8, we find its latitude and longitude coordinates: We are using the extended version of this file, which consists of more than 12,000 international airports and train stations. On, you can download a CSV file containing international airport data. Often, geodata is present in CSV files or in columns of tables that are imported from different database systems in the form of latitude and longitude values. GEOMETRY columns can be filled with strings using the well-known text representation (WKT), for example, 'POINT (13.36963 52.52493)'. ST_Transform(b.geo, 2163)) FROM cities a, cities b SELECT a.name, b.name, st_distance(ST_Transform(a.geo, 2163), SELECT a.name, b.name, st_distance(a.geo, b.geo) FROM cities a, cities b Later, in the SELECT query, we transform the geodata into SRID 2163 to see the distance between the two cities in meters:ĬREATE TABLE cities(name VARCHAR( 200), geo GEOMETRY( 4326)) We are using GEOMETRY(4326) because the coordinates provided are in degrees.
DBEAVER IMPORT CSV HOW TO
The following example shows you how to create a table with a geometry column, how to insert and query data.

You can use the ST_TRANSFORM function for this. Often, conversions are necessary between different coordinate systems. The SRID 4326 is using degrees as a unit, and the SRID 2163 uses meters. We will use the two SRIDs - 43 in our example. These reference systems are there to define points on the earth, but they have different strengths, accuracies, and properties, for example, the SRID 31466 can only reference locations within Germany. In the system table SYS.EXA_SPATIAL_REF_SYS, you will find more than 3000 different spatial reference systems which you can use for the GEOMETRY datatype. This topic provides you with some examples of how to import geospatial data from a CSV and a GeoJSON file, and use SQL functions to perform analytics and geo joins. Geospatial Data can be stored and analyzed in the Exasol database using the GEOMETRY datatype. Import Geospatial Data from CSV and GeoJSON File
