diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index d9a81a09395..3d657381baf 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,8 +1,8 @@ -Contributors to pgRouting are expected to act respectfully toward others in accordance with the http://www.osgeo.org/code_of_conduct. +Contributors to pgRouting are expected to act respectfully toward others in +accordance with the [OSGeo's Code of Conduct](http://www.osgeo.org/code_of_conduct) Full transcription: - # OSGeo Code of Conduct Version: 1.0 @@ -11,62 +11,130 @@ Date: May 2015 ## Introduction -This code of conduct governs how we behave in any OSGeo forum or event and whenever we will be judged by our actions. We expect it to be honored by everyone who participates in the OSGeo community formally or informally, or claims any affiliation with the OSGeo Foundation. +This code of conduct governs how we behave in any OSGeo forum or event and +whenever we will be judged by our actions. We expect it to be honored by +everyone who participates in the OSGeo community formally or informally, or +claims any affiliation with the OSGeo Foundation. -It applies to in-person events (such as conferences and related social events), IRC, public and private mailing lists, the issue tracker, the wiki, blogs, Twitter, and any other forums which the community uses for communication and interactions. +It applies to in-person events (such as conferences and related social events), +IRC, public and private mailing lists, the issue tracker, the wiki, blogs, +Twitter, and any other forums which the community uses for communication and +interactions. -This code is not exhaustive or complete. It serves to distill our common understanding of a collaborative, shared environment and goals. We expect it to be followed in spirit as much as in the letter, so that it can enrich all of us and the technical communities in which we participate. +This code is not exhaustive or complete. It serves to distill our common +understanding of a collaborative, shared environment and goals. We expect it to +be followed in spirit as much as in the letter, so that it can enrich all of us +and the technical communities in which we participate. ## Diversity Statement -OSGeo welcomes and encourages participation by everyone. We are committed to being a community that everyone feels good about joining, and we will always work to treat everyone well. No matter how you identify yourself or how others perceive you: we welcome you. +OSGeo welcomes and encourages participation by everyone. We are committed to +being a community that everyone feels good about joining, and we will always +work to treat everyone well. No matter how you identify yourself or how others +perceive you: we welcome you. Specific Guidelines We strive to: - Be open. - We invite anyone to participate in our community. We preferably use public methods of communication for project-related messages, unless discussing something sensitive. This applies to messages for help or project-related support, too; not only is a public support request much more likely to result in an answer to a question, it also makes sure that any inadvertent mistakes made by people answering will be more easily detected and corrected. + + We invite anyone to participate in our community. We preferably use public + methods of communication for project-related messages, unless discussing + something sensitive. This applies to messages for help or project-related + support, too; not only is a public support request much more likely to result + in an answer to a question, it also makes sure that any inadvertent mistakes + made by people answering will be more easily detected and corrected. - Be empathetic, welcoming, friendly, and patient. - We work together to resolve conflict, assume good intentions, and do our best to act in an empathetic fashion. We may all experience some frustration from time to time, but we do not allow frustration to turn into a personal attack. A community where people feel uncomfortable or threatened is not a productive one. Note that we have a multi-cultural, multi-lingual community and some of us are non-native speakers. We should be respectful when dealing with other community members as well as with people outside our community. + + We work together to resolve conflict, assume good intentions, and do our best + to act in an empathetic fashion. We may all experience some frustration from + time to time, but we do not allow frustration to turn into a personal attack. + A community where people feel uncomfortable or threatened is not a productive + one. Note that we have a multi-cultural, multi-lingual community and some of us + are non-native speakers. We should be respectful when dealing with other + community members as well as with people outside our community. - Be collaborative. - Our work will be used by other people, and in turn we will depend on the work of others. When we make something for the benefit of OSGeo, we are willing to explain to others how it works, so that they can build on the work to make it even better. Any decision we make will affect users and colleagues, and we take those consequences seriously when making decisions. + + Our work will be used by other people, and in turn we will depend on the + work of others. When we make something for the benefit of OSGeo, we are willing + to explain to others how it works, so that they can build on the work to make + it even better. Any decision we make will affect users and colleagues, and we + take those consequences seriously when making decisions. - Be inquisitive. - Nobody knows everything! Asking questions early avoids many problems later, so questions are encouraged, though they may be directed to the appropriate forum. Those who are asked should be responsive and helpful, within the context of our shared goal of improving OSGeo. + + Nobody knows everything! Asking questions early avoids many problems later, + so questions are encouraged, though they may be directed to the appropriate + forum. Those who are asked should be responsive and helpful, within the context + of our shared goal of improving OSGeo. - Be careful in the words that we choose. - Whether we are participating as professionals or volunteers, we value professionalism in all interactions, and take responsibility for our own speech. Be kind to others. Do not insult or put down other participants. + + Whether we are participating as professionals or volunteers, we value + professionalism in all interactions, and take responsibility for our own + speech. Be kind to others. Do not insult or put down other participants. - Be concise - Keep in mind that what you write once will be read by hundreds of persons. Writing a short email means people can understand the conversation as efficiently as possible. Short emails should always strive to be empathetic, welcoming, friendly and patient. When a long explanation is necessary, consider adding a summary. - Try to bring new ideas to a conversation so that each mail adds something unique to the thread, keeping in mind that the rest of the thread still contains the other messages with arguments that have already been made. + Keep in mind that what you write once will be read by hundreds of persons. + Writing a short email means people can understand the conversation as + efficiently as possible. Short emails should always strive to be empathetic, + welcoming, friendly and patient. When a long explanation is necessary, consider + adding a summary. - Try to stay on topic, especially in discussions that are already fairly large. + Try to bring new ideas to a conversation so that each mail adds something + unique to the thread, keeping in mind that the rest of the thread still + contains the other messages with arguments that have already been made. + + Try to stay on topic, especially in discussions that are already fairly large. - Step down considerately. - Members of every project come and go. When somebody leaves or disengages from the project they should tell people they are leaving and take the proper steps to ensure that others can pick up where they left off. In doing so, they should remain respectful of those who continue to participate in the project and should not misrepresent the project's goals or achievements. Likewise, community members should respect any individual's choice to leave the project. + + Members of every project come and go. When somebody leaves or disengages + from the project they should tell people they are leaving and take the proper + steps to ensure that others can pick up where they left off. In doing so, they + should remain respectful of those who continue to participate in the project and + should not misrepresent the project's goals or achievements. Likewise, community + members should respect any individual's choice to leave the project. ## Anti-Harassment -Harassment and other exclusionary behaviour are not acceptable. This includes, but is not limited to: +Harassment and other exclusionary behaviour are not acceptable. This includes, +but is not limited to: -- Personal insults or discriminatory jokes and language, especially those using racist or sexist terms. -- Offensive comments, excessive or unnecessary profanity. -- Intimidation, violent threats or demands. -- Sustained disruption of sessions or events. -- Stalking, harassing photography or recording. -- Unwelcome physical contact or sexual attention. -- Repeated harassment of others. In general, if someone asks you to stop, then stop. -- Posting (or threatening to post) other people's personally identifying information ("doxing"). -- Sharing private content, such as emails sent privately or non-publicly, or unlogged forums such as IRC channel history. -- Advocating for, or encouraging, any of the above behaviour. +- Personal insults or discriminatory jokes and language, especially those using + racist or sexist terms. -## Reporting Guidelines +- Offensive comments, excessive or unnecessary profanity. + +- Intimidation, violent threats or demands. + +- Sustained disruption of sessions or events. + +- Stalking, harassing photography or recording. -If you believe someone is breaking this code of conduct, you may reply to them, and point to this code of conduct. Such messages may be in public or in private, whatever is most appropriate. Assume good faith; it is more likely that participants are unaware of their bad behaviour than that they intentionally try to degrade the quality of the discussion. Should there be difficulties in dealing with the situation, you may report your concerns to event staff, a forum leader or the OSGeo Board. Serious or persistent offenders may be expelled from the event or forum by event organizers or forum leaders. +- Unwelcome physical contact or sexual attention. +- Repeated harassment of others. In general, if someone asks you to stop, then + stop. +- Posting (or threatening to post) other people's personally identifying + information ("doxing"). + +- Sharing private content, such as emails sent privately or non-publicly, or + unlogged forums such as IRC channel history. + +- Advocating for, or encouraging, any of the above behaviour. + +## Reporting Guidelines +If you believe someone is breaking this code of conduct, you may reply to them, +and point to this code of conduct. Such messages may be in public or in private, +whatever is most appropriate. Assume good faith; it is more likely that +participants are unaware of their bad behaviour than that they intentionally try +to degrade the quality of the discussion. Should there be difficulties in +dealing with the situation, you may report your concerns to event staff, a forum +leader or the OSGeo Board. Serious or persistent offenders may be expelled from +the event or forum by event organizers or forum leaders. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 820a4dd4ae4..1a3987f7b0b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,42 +1,63 @@ # How to contribute -We are really glad you are reading this because we need volunteer developers to help with this project. +We are really glad you are reading this because we need volunteer developers to +help with this project. -If you have not already, come find us on [![Join the chat at https://gitter.im/pgRouting/pgrouting](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pgRouting/pgrouting?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) or contact us via [mailing list](http://lists.osgeo.org/mailman/listinfo/pgrouting-dev). We want you to work on things you're excited about. Drop a message and if someone can assist you, will contact you back ASAP. +If you have not already, come find us on [![Join the chat at +https://gitter.im/pgRouting/pgrouting](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pgRouting/pgrouting?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +or contact us via [mailing +list](http://lists.osgeo.org/mailman/listinfo/pgrouting-dev). We want you to +work on things you're excited about. Drop a message and if someone can assist +you, will contact you back ASAP. Here are some important resources: - * [pgRouting for Developers](http://docs.pgrouting.org/doxy/2.4/index.html) has the internals C/C++ code information, - * [Wish list on the wiki](https://github.com/pgRouting/pgrouting/wiki/GSoC-Ideas) is the foot view of what we think the community needs. - * [Additional wish lst](https://github.com/pgRouting/pgrouting/issues?q=is%3Aopen+is%3Aissue+label%3A%22Functionality+Request%22). (TODO to move the information to the wiki wish list) - * Participate in the [discussions](https://github.com/pgRouting/pgrouting/issues?q=is%3Aopen+is%3Aissue+label%3ADiscussion). - * Participate in fixing [Documentation](https://github.com/pgRouting/pgrouting/issues?q=is%3Aopen+is%3Aissue+label%3ADocumentation). - * Find a bug? [Let us know](https://github.com/pgRouting/pgrouting/issues). +* [pgRouting for Developers](https://docs.pgrouting.org/doxygen) has the + internals C/C++ code information, + +* [Wish list on the wiki](https://github.com/pgRouting/pgrouting/wiki/GSoC-Ideas) + is the foot view of what we think the community needs. + +* [Additional wish + lst](https://github.com/pgRouting/pgrouting/issues?q=is%3Aopen+is%3Aissue+label%3A%22Functionality+Request%22). + (TODO to move the information to the wiki wish list) + +* Participate in the + [discussions](https://github.com/pgRouting/pgrouting/discussions). + +* Participate in fixing + [Documentation](https://github.com/pgRouting/pgrouting/issues?q=is%3Aopen+is%3Aissue+label%3ADocumentation). + +* Find a bug? [Let us know](https://github.com/pgRouting/pgrouting/issues). ## Contribution agreement Any kind of contribution will automatically fall to the following Licences: -- Code contribution: GNU General Public License v2.0 or later, - - Directly by making an explicit pull request. - - Indirectly by posting code on issues/wiki/gitter/mailng lists -- Documentation contribution: - - Creative Commons Attribution-Share Alike 3.0 +* Code contribution: GNU General Public License v2.0 or later, + * Directly by making an explicit pull request. + * Indirectly by posting code on issues/wiki/gitter/mailng lists + +* Documentation contribution: + * Creative Commons Attribution-Share Alike 3.0 ## Submitting changes +Write a clear log message for your commits. One-line messages are fine for small +changes, but bigger changes should have more information. -Write a clear log message for your commits. One-line messages are fine for small changes, but bigger changes should have more information. Fill in the commit message template. ## Coding conventions -Start reading our code and you'll get the hang of it. We optimize for readability. -This is open source software. Consider the people who will read your code, and make it look nice for them. +Start reading our code and you'll get the hang of it. We optimize for +readability. - * We indent using four spaces (soft tabs) - * We use cpplint for linting C/C++ code. +This is open source software. Consider the people who will read your code, and +make it look nice for them. + +* We indent using four spaces (soft tabs) +* We use cpplint for linting C/C++ code. Thanks, pgRouting team - diff --git a/README.md b/README.md index ce202369758..7bb06769347 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,7 @@ [![Join the chat at https://gitter.im/pgRouting/pgrouting](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pgRouting/pgrouting?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -## STATUS - -### Branches +## Branches * The *master* branch has the development of the next micro release * The *develop* branch has the development of the next minor/major release @@ -12,7 +10,6 @@ For the complete list of releases go to: https://github.com/pgRouting/pgrouting/releases - ## LINKS * https://pgrouting.org/ @@ -30,14 +27,21 @@ pgRouting extends the PostGIS/PostgreSQL geospatial database to provide geospati This library contains the following features: * All Pairs Shortest Path Algorithms + * A-star algorithm + * Bi-directional algorithms + * A variety of applications of Dijkstra algorithms + * Cost functions * With points + * Driving Distance * With points + * Yen's algorithm + * Traveling Sales Person (TSP) and many more. @@ -46,20 +50,23 @@ The latest documentation: http://docs.pgrouting.org/latest ## REQUIREMENTS -Building requirements --------------------- -* Perl +### Building requirements + +* perl + * C and C++ compilers * Compiling with Boost 1.56 up to Boost 1.74 requires C++ Compiler with C++03 or C++11 standard support * Compiling with Boost 1.75 requires C++ Compiler with C++14 standard support + * Postgresql = Supported version by PostgreSQL + * The Boost Graph Library (BGL) >= 1.56 + * CMake >= 3.2 -* Sphinx >= 4.0.0 +* Sphinx >= 4.0.0 -User's requirements --------------------- +### User's requirements * PostGIS @@ -101,5 +108,3 @@ See online documentation: http://docs.pgrouting.org/latest/en/index.html * Most features are available under [GPL-2.0-or-later](https://spdx.org/licenses/GPL-2.0-or-later.html) * Some Boost extensions are available under Boost license (see LICENSE_1_0.txt) * Some code contributed by iMaptools.com is available under MIT-X license. - - diff --git a/include/c_common/README.md b/include/c_common/README.md index e85097189fc..fe22526a1ea 100644 --- a/include/c_common/README.md +++ b/include/c_common/README.md @@ -2,18 +2,18 @@ Purpose of this directory ---------------------------------- - Directory having files included exclusively by the `*.c` files + - forbidden to be used on c++ code - this prohibition is not enforced but will be in the future - Convention: - files must end with `_input` - Example ---------------------------------- in `foo.c` file - +```C #include "c_common/edges_input.h" #include "c_common/arrays_input.h" - +``` diff --git a/include/c_common/postgres_connection.h b/include/c_common/postgres_connection.h index 177d283dc0e..2f67cc5415a 100644 --- a/include/c_common/postgres_connection.h +++ b/include/c_common/postgres_connection.h @@ -39,6 +39,5 @@ void pgr_SPI_finish(void); void pgr_SPI_connect(void); SPIPlanPtr pgr_SPI_prepare(char* sql); Portal pgr_SPI_cursor_open(SPIPlanPtr SPIplan); -char* pgr_cstring2char(const char *inStr); #endif // INCLUDE_C_COMMON_POSTGRES_CONNECTION_H_ diff --git a/include/cpp_common/pgr_bidirectional.hpp b/include/cpp_common/pgr_bidirectional.hpp index 9b07110ee7c..f8f40fda487 100644 --- a/include/cpp_common/pgr_bidirectional.hpp +++ b/include/cpp_common/pgr_bidirectional.hpp @@ -224,7 +224,6 @@ class Pgr_bidirectional { double INF; //!< infinity double best_cost; - bool cost_only; mutable std::ostringstream m_log; Priority_queue forward_queue; diff --git a/include/spanningTree/pgr_randomSpanningTree.hpp b/include/spanningTree/pgr_randomSpanningTree.hpp index d88c6e18cf1..0358c326103 100644 --- a/include/spanningTree/pgr_randomSpanningTree.hpp +++ b/include/spanningTree/pgr_randomSpanningTree.hpp @@ -94,6 +94,7 @@ class Pgr_randomSpanningTree { std::vector< SpanTree_rt > resul; return resul; +#if 0 std::vector< SpanTree_rt > results; double totalcost = 0; SpanTree_rt tmp; @@ -130,6 +131,7 @@ class Pgr_randomSpanningTree { } return results; } +#endif }; template < class G > diff --git a/include/yen/pgr_ksp.hpp b/include/yen/pgr_ksp.hpp index f3752325137..5fd970dda1c 100644 --- a/include/yen/pgr_ksp.hpp +++ b/include/yen/pgr_ksp.hpp @@ -50,6 +50,8 @@ class Pgr_ksp : public Pgr_messages { public: Pgr_ksp() : + m_start(0), + m_end(0), m_K(0), m_heap_paths(false) { m_vis = new Visitor; diff --git a/locale/README.md b/locale/README.md index aff0e966c31..ef6679a041c 100644 --- a/locale/README.md +++ b/locale/README.md @@ -1,152 +1,106 @@ - - # Locale -Currently the setup is for `es` `ru` `ja` `it` `de` `fr` +Currently the setup is for `es` -## Building the LOCALE: +## Building the LOCALE -Use this when the English documentation changed. +This task needs to be done when the English changes. -``` -cd build -#rm -rf * #BE VERY CAREFULL -cmake -D LOCALE=ON .. -make locale -cd .. -sphinx-intl update -d locale -``` +Although it is automatically done in the github action from time to time it +might be desirable to build the locale locally. -When there is a new resource -``` -sphinx-intl update-txconfig-resources --locale-dir locale --pot-dir locale/pot --transifex-project-name pgrouting +```bash +tools/transifex/update_locale.sh ``` +Only files that changed need to be added to the commit. Sometimes the change is +only a timestamp those files are not to be commited. -review -``` -for f in locale/pot/*; do echo $f; grep $f .tx/config; done -for f in `grep '\.pot' .tx/config | sed 's/^.*pot\/\(.*\)$/\1/' | grep '\.pot'` ; do echo $f; ls locale/pot/* | grep $f ; done -``` - -commit changes and push +Note: This is done automatically on the action. -## Cleanup unused messages - -Hint -``` -for f in ${FILE} -do - echo one ${f} - grep '#~' ${f} - msgattrib --output-file=${f} --no-obsolete ${f} - echo two - grep '#~' ${f} -done +```bash +for line in `cat build/doc/locale_changes_po_pot.txt`; do git add "$line"; done ``` +After the files are added and before the commit, restore the files that only +have changes on timestamps -## MANAGERS: Interaction with transifex: - -### Push the resource to transifex - -Push a New or changed resource: - -* New resource - -Add the resource to the `.tx/config` located at the root of the repository -(Use as example the other resources) - -``` -vim ../.tx/config +```bash +git restore . ``` -* Push the new resource -``` -tx push --source -r pgrouting.pgr_createVerticesTable +## MANAGERS: Interaction with transifex -``` -Note: Do not put the file extension - -NOTE: INFORM: A documentation frezze to let translators translate +Resources are updated on transifex automatically from the develop branch. ### Pull the resources from transifex -Be patient takes time (I like the `-d` flag just to know what is being downloaded) +Be patient takes time (I like the `-d` flag just to know what is being +downloaded) * this pulls all the translations -``` + +```bash tx -d pull -f ``` * this pulls the Spanish translations -``` + +```bash tx -d pull -f -l es ``` - - ## TRANSLATORS -For this example the translator is translating `pgr_createVerticesTable` to `Spanish` +For this example the translator is translating `pgr_createVerticesTable` to +`Spanish` -* Step 1: Build a local documentation +**Step 1:** Build a local documentation -``` +```bash cd build rm -rf * cmake -D HTML=ON -D ES=ON .. make html-es ``` -* Step 2: Navigate to the page you are translating: +**Step 2:** Navigate to the page you are translating: On the Browser go to: -``` +```bash file:///path/to/build/doc/_build/html/es/pgr_createVerticesTable.html ``` -* Step 3: Pull the translation & build the documentation & refresh browser +**Step 3:** Pull the translation & build the documentation & refresh browser -``` +```bash tx pull -r pgrouting.pgr_createVerticesTable -l es make html-es ``` + `Refresh browser` -## Building the documentation: +## Building the documentation NOTE: in any case English is always build -* Building all languages +### Building all languages -``` +```bash cmake -D HTML=ON -D WITH_ALL_LANG=ON .. make doc ``` -* Building a a particular language +### Building a particular language This example shows Spanish: -``` -cmake -D HTML=ON -D ES=ON .. -make html -``` - -* Building a particular language - -This example shows Spanish: - -``` -make -D HTML=ON -D SINGLEHTML=OM -D ES=ON .. +```bash +cmake -DWITH_DOC=ON -DES=ON .. make html -make singlehtml -# OR to build both: -make doc ``` -# References +## References * https://pypi.python.org/pypi/sphinx-intl * https://docs.transifex.com/client/introduction diff --git a/src/common/basic_vertex.cpp b/src/common/basic_vertex.cpp index 8dd3dcb605f..1259069cbb6 100644 --- a/src/common/basic_vertex.cpp +++ b/src/common/basic_vertex.cpp @@ -58,7 +58,7 @@ namespace pgrouting { std::vector < Basic_vertex > extract_vertices( std::vector < Basic_vertex > vertices, - const std::vector data_edges) { + std::vector data_edges) { if (data_edges.empty()) return vertices; vertices.reserve(vertices.size() + data_edges.size() * 2); diff --git a/src/common/e_report.c b/src/common/e_report.c index c88831b4a95..53728df6aa5 100644 --- a/src/common/e_report.c +++ b/src/common/e_report.c @@ -61,13 +61,6 @@ void pgr_error(char* err) { PGR_DBG("Returned error message = %s", err); -#if 0 - char *error = NULL; - if (*err_msg) { - error = pgr_cstring2char(*err_msg); - free(*err_msg); - } -#endif if (err) { ereport(ERROR, (errmsg_internal("Unexpected"), diff --git a/src/common/postgres_connection.c b/src/common/postgres_connection.c index 1b521688d03..eb220cd6913 100644 --- a/src/common/postgres_connection.c +++ b/src/common/postgres_connection.c @@ -49,22 +49,6 @@ pgr_send_error(int errcode) { } -char* -pgr_cstring2char(const char *inStr) { - if (!inStr) return NULL; - - char *outStr; - outStr = palloc(strlen(inStr)); - if (!outStr) return NULL; - - memcpy(outStr, inStr, strlen(inStr)); - - outStr[strlen(inStr)] = '\0'; - - return outStr; -} - - // http://www.postgresql.org/docs/9.4/static/spi-spi-finish.html void diff --git a/src/pickDeliver/fleet.cpp b/src/pickDeliver/fleet.cpp index 783bfa344e7..ea97e839070 100644 --- a/src/pickDeliver/fleet.cpp +++ b/src/pickDeliver/fleet.cpp @@ -85,7 +85,7 @@ Fleet::get_truck(size_t order) { msg().log << "Available vehicles: " << m_un_used << "\n"; msg().log << "NOT Available vehicles: " << m_used << "\n"; #endif - auto idx = m_un_used.front(); + size_t idx{0}; for (const auto &i : m_un_used) { if (m_trucks[i].feasable_orders().has(order)) { diff --git a/src/trsp/trsp.c b/src/trsp/trsp.c index 5131b682ed8..7f9397acb0c 100644 --- a/src/trsp/trsp.c +++ b/src/trsp/trsp.c @@ -150,9 +150,6 @@ static int compute_trsp( SPIPlanPtr SPIplan; Portal SPIportal; - bool moredata = true; - uint32_t TUPLIMIT = 1000; - uint32_t ntuples; Edge_t *edges = NULL; size_t total_tuples = 0; @@ -222,7 +219,7 @@ static int compute_trsp( PGR_DBG("Fetching restriction tuples\n"); restrict_t *restricts = NULL; - uint32_t total_restrict_tuples = 0; + uint64_t total_restrict_tuples = 0; restrict_columns_t restrict_columns = {.target_id = -1, .via_path = -1, .to_cost = -1}; @@ -232,6 +229,8 @@ static int compute_trsp( if (restrict_sql == NULL) { PGR_DBG("Sql for restrictions is null."); } else { + uint32_t TUPLIMIT = 1000; + SPIplan = SPI_prepare(restrict_sql, 0, NULL); if (SPIplan == NULL) { elog(ERROR, "turn_restrict_shortest_path: " @@ -246,7 +245,7 @@ static int compute_trsp( return -1; } - moredata = true; + bool moredata = true; while (moredata == true) { SPI_cursor_fetch(SPIportal, true, TUPLIMIT); @@ -260,10 +259,7 @@ static int compute_trsp( } /* Suppress the -Wconversion warning temporarily */ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wconversion" - ntuples = SPI_processed; - #pragma GCC diagnostic pop + uint64_t ntuples = SPI_processed; total_restrict_tuples += ntuples; @@ -297,7 +293,7 @@ static int compute_trsp( SPI_cursor_close(SPIportal); } - PGR_DBG("Total %i restriction tuples", total_restrict_tuples); + PGR_DBG("Total %ld restriction tuples", total_restrict_tuples); PGR_DBG("Calling trsp_edge_wrapper\n"); ret = trsp_edge_wrapper(edges, total_tuples, @@ -383,8 +379,6 @@ _pgr_trsp(PG_FUNCTION_ARGS) { sql = NULL; } else { sql = text_to_cstring(PG_GETARG_TEXT_P(7)); - if (strlen(sql) == 0) - sql = NULL; } PGR_DBG("Calling compute_trsp"); diff --git a/tools/developer/README.md b/tools/developer/README.md index de3b34cd74f..85ccab31429 100644 --- a/tools/developer/README.md +++ b/tools/developer/README.md @@ -6,13 +6,13 @@ All the documentation files have a history of older versions. When a new mayor or minor is created the top lines need to change For example: the one in parenthesis is the latest version which is 3.2 -``` +```md (`3.2 `__) `3.1 `__ ... ``` And needs to be 3.3: -``` +```md (`3.3 `__) `3.2 `__ `3.1 `__ @@ -20,7 +20,7 @@ And needs to be 3.3: ``` To achive the change: from the root of the repository: -``` +```bash ./tools/developer/addNewVersionLink.sh "3\.2" "3\.3"' ``` @@ -32,14 +32,14 @@ Some times legwork is done on a directory, for example when using the And for reviewing the pull request it is easier to do it by directory From the root of the repository: -``` -./tools/developer/commitByDirectory.sh doc "Updating linls" +```bash +./tools/developer/commitByDirectory.sh doc "Updating links" ``` sub-directories without changes will be ignored It will create a series of commits on sub-direcotries that were changed for example the following commit messages will be created: -``` +```bash [doc/allpairs] Updating links [doc/alpha_shape] Updating links [doc/astar] Updating links diff --git a/tools/licences/README.md b/tools/licences/README.md index 1b1d3dbb07a..a0de055a5b2 100644 --- a/tools/licences/README.md +++ b/tools/licences/README.md @@ -1,9 +1,8 @@ - Add licences to a directory files ------------------------------------ From this directory execute the command -``` +```bash add-licenses dir [exclude.txt] ```