rtree/insertZipcode.c
static RDM_RETCODE insertZipCode (RDM_DB db)
{
POINTSOFINTEREST poi = {0};
/* Set the zip, city, and state column values */
poi.zip = 83686;
strcpy (poi.city, "Nampa");
strcpy (poi.state, "ID");
/* Set the location values (xmin, ymin), (xmax, ymax) */
poi.location[0] = -116.577610; /* Longitude is the 'x' value */
poi.location[1] = 43.529812; /* Latitude is the 'y' value */
poi.location[2] = -116.577610; /* Longitude is the 'x' value */
poi.location[3] = 43.529812; /* Latitude is the 'y' value */
/* Start an update transaction */
rc = rdm_dbStartUpdate (db, RDM_LOCK_ALL, 0, NULL, 0, NULL);
if (rc == sOKAY)
{
/* Insert the row */
db, TABLE_POINTSOFINTEREST, &poi, sizeof (POINTSOFINTEREST), NULL);
if (rc == sOKAY)
{
/* Commit the successful transaction */
rc = rdm_dbEnd (db);
}
else
{
/* Rollback the failed transaction */
(void) rdm_dbEndRollback (db);
}
}
return rc;
}