MobilityDB 1.3
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions | Variables
ways_cache.c File Reference

Network-based static point and segment types. More...

#include "npoint/tnpoint.h"
#include <assert.h>
#include <float.h>
#include <limits.h>
#include <postgres.h>
#include <libpq/pqformat.h>
#include <executor/spi.h>
#include <utils/memutils.h>
#include <liblwgeom.h>
#include <meos.h>
#include "geo/tgeo_spatialfuncs.h"

Data Structures

struct  struct_WaysCache
 The ways cache holds a fixed number of ways records read from the ways table or CSV file. More...
 
struct  struct_WaysCacheItem
 
struct  ways_record
 Structure to represent a record in the ways CSV file. More...
 

Macros

#define MAX_LENGTH_GEOM   100001
 
#define SQL_MAXLEN   1024
 
#define SQL_ROUTE_MAXLEN   64
 
#define WAYS_CACHE_ITEMS   128
 
#define WAYS_CSV   "/usr/local/share/ways.csv"
 

Typedefs

typedef struct struct_WaysCache WaysCache
 The ways cache holds a fixed number of ways records read from the ways table or CSV file. More...
 
typedef struct struct_WaysCacheItem WaysCacheItem
 

Functions

static WaysCacheItemAddRouteToWaysCache (WaysCache *ways_cache, ways_record *rec)
 Add a Route to the Ways cache. More...
 
static void DeleteRouteFromWaysCache (WaysCache *ways_cache, uint32_t position)
 Remove an entry to the Ways cache. More...
 
void DestroyWaysCache (void *cache)
 Destroy all the malloc'ed route records stored in the Ways cache and clear the cash. More...
 
Npointgeompoint_to_npoint (const GSERIALIZED *gs)
 Transform a geometry into a network point. More...
 
int32_t get_srid_ways ()
 Return the SRID of the routes in the ways table. More...
 
bool get_ways_record (int64 rid, ways_record *rec)
 Access the ways table or CSV file to get the route geometry and length of a route identifier. More...
 
static WaysCacheItemGetRouteFromWaysCache (WaysCache *ways_cache, bool any_gid, int64 gid)
 Get a Ways cache item structure from the Ways cache. More...
 
WaysCacheGetWaysCache ()
 Get the Ways cache entry from the global variable if one exists. More...
 
bool route_exists (int64 rid)
 Return true if the edge table contains a route with the route identifier. More...
 
GSERIALIZEDroute_geom (int64 rid)
 Access the edge table to get the route geometry from corresponding route identifier. More...
 
double route_length (int64 rid)
 Access the edge table to return the route length from the corresponding route identifier. More...
 
bool route_lookup (int64 gid, bool any_gid, ways_record *rec)
 Return true if a Ways structure was read from the Ways cache, return 0 otherwise. More...
 

Variables

WaysCacheMEOS_WAYS_CACHE = NULL
 

Detailed Description

Network-based static point and segment types.