|
MobilityDB 1.3
|
A simple program that reads from a CSV file obtained from geonames https://download.geonames.org/export/dump/US.zip and applies the PostGIS function ST_DBSCAN to the entire file.
More...
#include <ctype.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <meos.h>#include <meos_geo.h>Macros | |
| #define | MAX_LEN_LINE 2048 |
| #define | MAX_NUM_ADMIN1 64 |
| #define | MAX_NUM_FIELDS 24 |
| #define | MAX_ROWS 250000 |
| #define | MAX_ROWS_WIN 15000 |
| #define | NUM_INSTS_BATCH 10000 |
Functions | |
| int | get_admin1_no (char *admin1, char *admin1_list[]) |
| int | main (void) |
| int | parse_csv_line (char *line, char **fields) |
| char * | trim (char *str) |
A simple program that reads from a CSV file obtained from geonames https://download.geonames.org/export/dump/US.zip and applies the PostGIS function ST_DBSCAN to the entire file.
This file simply reproduces in MEOS Paul Ramsey's blog https://www.crunchydata.com/blog/postgis-clustering-with-k-means Therefore, the program corresponds to the following SQL query
The program can be build as follows
The program expects that the file data/US.txt extracted from the ZIP file above is located in the subdirecttory ‘data’.