forked from pgRouting/pgrouting
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
591 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/*PGR-GNU***************************************************************** | ||
File: isochrones_driver.h | ||
Copyright (c) 2020 Vjeran Crnjak | ||
[email protected] | ||
------ | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
********************************************************************PGR-GNU*/ | ||
|
||
#ifndef INCLUDE_DRIVERS_ISOCHRONES_MANY_TO_ISOCHRONES_H_ | ||
#define INCLUDE_DRIVERS_ISOCHRONES_MANY_TO_ISOCHRONES_H_ | ||
|
||
/* for size_t */ | ||
#ifdef __cplusplus | ||
#include <cstddef> | ||
#else | ||
#include <stddef.h> | ||
#endif | ||
|
||
#include "c_types/general_path_element_t.h" | ||
#include "c_types/pgr_edge_t.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void do_pgr_many_to_isochrones(pgr_edge_t *edges, size_t total_edges, | ||
int64_t *start_vertex, size_t s_len, | ||
double distance, bool directed, bool equicost, | ||
General_path_element_t **return_tuples, | ||
size_t *return_count, char **log_msg, | ||
char **notice_msg, char **err_msg); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // INCLUDE_DRIVERS_ISOCHRONES_MANY_TO_ISOCHRONES_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
SET(LOCAL_FILES | ||
isochrones.sql | ||
) | ||
|
||
foreach (f ${LOCAL_FILES}) | ||
configure_file(${f} ${f}) | ||
list(APPEND PACKAGE_SQL_FILES ${CMAKE_CURRENT_BINARY_DIR}/${f}) | ||
endforeach() | ||
|
||
set(PgRouting_SQL_FILES ${PgRouting_SQL_FILES} ${PACKAGE_SQL_FILES} PARENT_SCOPE) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/*PGR-GNU***************************************************************** | ||
Copyright (c) 2020 Vjeran Crnjak | ||
Mail: [email protected] | ||
------ | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
********************************************************************PGR-GNU*/ | ||
|
||
CREATE OR REPLACE FUNCTION pgr_isochrones( | ||
edges_sql text, | ||
start_vids anyarray, | ||
distance FLOAT, | ||
directed BOOLEAN DEFAULT TRUE, | ||
equicost BOOLEAN DEFAULT FALSE, | ||
OUT seq integer, | ||
OUT from_v bigint, | ||
OUT node bigint, | ||
OUT edge bigint, | ||
OUT cost FLOAT, | ||
OUT agg_cost FLOAT) | ||
RETURNS SETOF RECORD AS | ||
'${MODULE_PATHNAME}', 'many_to_isochrones' | ||
LANGUAGE c VOLATILE STRICT; | ||
|
||
|
||
CREATE OR REPLACE FUNCTION pgr_isochrones( | ||
edges_sql text, | ||
start_vid bigint, | ||
distance FLOAT8, | ||
directed BOOLEAN DEFAULT TRUE, | ||
OUT seq integer, | ||
OUT node bigint, | ||
OUT edge bigint, | ||
OUT cost FLOAT, | ||
OUT agg_cost FLOAT) | ||
RETURNS SETOF RECORD AS | ||
$BODY$ | ||
SELECT a.seq, a.node, a.edge, a.cost, a.agg_cost | ||
FROM pgr_isochrones($1, ARRAY[$2]::BIGINT[], $3, $4, false) a; | ||
$BODY$ | ||
LANGUAGE SQL VOLATILE STRICT | ||
COST 100 | ||
ROWS 1000; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ADD_LIBRARY(isochrones OBJECT | ||
many_to_isochrones.c | ||
isochrones_driver.cpp | ||
) |
Oops, something went wrong.