Skip to content

Commit 3b13f56

Browse files
authored
Merge pull request #186 from pgRouting/develop
version 2.3
2 parents 837adff + 4b60250 commit 3b13f56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+3853
-1967
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Sample/*
44
build
55
osm2pgrouting
66
tools/vagrant/packaging.sh
7+
fix_typos
78
*.o
89
*.out
910
*.osm

.travis.yml

+6-16
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,31 @@ compiler:
2222
# email:
2323
# on_failure: [email protected]
2424

25-
env: POSTGRESQL_VERSION=9.6 PG_USER=postgres
25+
env: POSTGRESQL_VERSION=9.6 PG_USER=postgres DIST=precise
2626

2727
matrix:
2828
include:
2929

30-
- os: linux
31-
sudo: required
32-
dist: precise
33-
env: POSTGRESQL_VERSION=9.5 PG_USER=postgres
34-
35-
36-
- os: linux
37-
sudo: required
38-
dist: precise
39-
env: POSTGRESQL_VERSION=9.4 PG_USER=postgres
40-
4130

4231
- os: linux
4332
sudo: required
4433
dist: trusty
4534
group: edge
46-
env: POSTGRESQL_VERSION=9.6 PG_USER=postgres
35+
env: POSTGRESQL_VERSION=9.6 PG_USER=postgres DIST=trusty
4736

4837

4938
- os: linux
5039
sudo: required
5140
dist: trusty
5241
group: edge
53-
env: POSTGRESQL_VERSION=9.5 PG_USER=postgres
42+
env: POSTGRESQL_VERSION=9.5 PG_USER=postgres DIST=trusty
5443

5544

5645
- os: linux
5746
sudo: required
5847
dist: trusty
5948
group: edge
60-
env: POSTGRESQL_VERSION=9.4 PG_USER=postgres
49+
env: POSTGRESQL_VERSION=9.4 PG_USER=postgres DIST=trusty
6150

6251

6352

@@ -80,7 +69,8 @@ before_install:
8069
- sudo sudo apt-get install -y libboost-program-options-dev
8170

8271
install:
83-
- sudo ./ci/travis/install-postgres.sh $POSTGRESQL_VERSION $PG_USER
72+
#- sudo ./ci/travis/install-postgres.sh $POSTGRESQL_VERSION $PG_USER
73+
- sudo ./ci/travis/install-libpqxx.sh $DIST
8474

8575
before_script:
8676

AUTHORS.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
## Other contributors:
1111

12+
* Aakash Sharma
1213
* Adrien Pavie
1314
* Anton Patrushev
1415
* Daniel Wendt (Initial author)

CMakeLists.txt

+26-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
55
set (SHARE_DIR "/usr/share/osm2pgrouting")
66

77
FIND_PACKAGE(PostgreSQL REQUIRED)
8+
find_package(LibPQXX REQUIRED)
89
FIND_PACKAGE(EXPAT REQUIRED)
910

1011
FIND_PACKAGE(Boost)
@@ -16,35 +17,53 @@ endif(Boost_INCLUDE_DIRS)
1617

1718
FIND_PACKAGE(Boost COMPONENTS program_options REQUIRED)
1819

19-
FILE(GLOB SRC "${CMAKE_SOURCE_DIR}/src/*.cpp" "${CMAKE_SOURCE_DIR}/src/*.h")
20+
FILE(GLOB osm2pgrouting_lib_SOURCES "${CMAKE_SOURCE_DIR}/src/*/*.cpp")
2021

2122
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FILE_OFFSET_BITS=64 -std=c++0x")
22-
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wconversion -pedantic -Wextra -frounding-math -Wno-deprecated")
23-
23+
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wconversion -pedantic -Wextra -frounding-math -Wno-deprecated -fmax-errors=10")
2424

2525

26+
set (OSM2PGROUTING_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/include")
27+
message(STATUS "LIBPQXX_INCLUDE_DIRS: ${LIBPQXX_INCLUDE_DIRS}")
2628
message(STATUS "POSTGRESQL_INCLUDE_DIR: ${POSTGRESQL_INCLUDE_DIR}")
2729
message(STATUS "EXPAT_INCLUDE_DIRS: ${EXPAT_INCLUDE_DIRS}")
2830
message(STATUS "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
2931
message(STATUS "POSTGRESQL_LIBRARIES: ${POSTGRESQL_LIBRARIES}")
3032
message(STATUS "Boost_LIBRARIES: ${boost_LIBRARIES}")
33+
message(STATUS "LIBPQXX_LIBRARIES: ${LIBPQXX_LIBRARIES}")
34+
35+
INCLUDE_DIRECTORIES(src
36+
${LIBPQXX_INCLUDE_DIRS}
37+
${POSTGRESQL_INCLUDE_DIR}
38+
${EXPAT_INCLUDE_DIRS}
39+
${Boost_INCLUDE_DIRS}
40+
${OSM2PGROUTING_INCLUDE_DIRS}
41+
)
3142

32-
INCLUDE_DIRECTORIES(src ${POSTGRESQL_INCLUDE_DIR} ${EXPAT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
33-
34-
ADD_EXECUTABLE(osm2pgrouting ${SRC})
43+
ADD_EXECUTABLE(osm2pgrouting ${osm2pgrouting_lib_SOURCES})
3544

36-
TARGET_LINK_LIBRARIES(osm2pgrouting ${POSTGRESQL_LIBRARIES} ${EXPAT_LIBRARIES} ${Boost_LIBRARIES} )
45+
TARGET_LINK_LIBRARIES(osm2pgrouting
46+
${LIBPQXX_LIBRARIES}
47+
${POSTGRESQL_LIBRARIES}
48+
${EXPAT_LIBRARIES}
49+
${Boost_LIBRARIES}
50+
)
3751

3852
INSTALL(TARGETS osm2pgrouting
3953
RUNTIME DESTINATION "/usr/bin"
4054
)
4155

56+
if(WIN32)
57+
target_link_libraries(osm2pgrouting wsock32 ws2_32)
58+
endif()
59+
4260
INSTALL(FILES
4361
"${CMAKE_SOURCE_DIR}/COPYING"
4462
"${CMAKE_SOURCE_DIR}/Readme.md"
4563
"${CMAKE_SOURCE_DIR}/mapconfig.xml"
4664
"${CMAKE_SOURCE_DIR}/mapconfig_for_cars.xml"
4765
"${CMAKE_SOURCE_DIR}/mapconfig_for_bicycles.xml"
66+
"${CMAKE_SOURCE_DIR}/mapconfig_for_pedestrian.xml"
4867
DESTINATION "${SHARE_DIR}")
4968

5069

NEWS

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
osm2pgRouting 2.3.0 develop
2+
3+
* Cost should not return the same value
4+
* Added a points of Interest table
5+
* Some default one_way values are taken into consideration
6+
* Relations are also condsidered
7+
* Can be forked
8+
* TODO remove install postGIS, that should be taken care of the user
9+
* New mapconfig_for_pedestrian.xml
10+
11+
112
osm2pgRouting 2.2.0
213

314
* Adding foreign keys to the tables.

Readme.md

+19-10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Before you can use this tool for importing Openstreetmap data you need to instal
1111
3. pgrouting
1212
4. boost
1313
5. expat
14+
5. libpqxx
1415
6. cmake
1516

1617
and to prepare a database.
@@ -38,6 +39,9 @@ Install some prerqeuisites
3839
```
3940
sudo apt-get install expat
4041
sudo apt-get install libexpat1-dev
42+
sudo apt-get install libboost-dev
43+
sudo apt-get install libboost-program-options-dev
44+
sudo apt install libpqxx-dev
4145
```
4246

4347
CMAKE options:
@@ -82,9 +86,7 @@ osm2pgrouting --f next-OSM-XML-File.osm --conf mapconfig.xml --dbname routing --
8286
A complete list of arguments are:
8387

8488
```
85-
Allowed options:
86-
87-
89+
osm2pgrouting --help
8890
Allowed options:
8991
9092
Help:
@@ -103,15 +105,22 @@ General:
103105
table names.
104106
--suffix arg Suffix added at the end of the table
105107
names.
106-
--addnodes Import the osm_nodes table.
108+
--postgis Install postgis if not found.
109+
--addnodes Import the osm_nodes, osm_ways &
110+
osm_relations tables.
111+
--attributes Include attributes information.
112+
--tags Include tag information.
113+
--chunk arg (=20000) Exporting chunk size.
107114
--clean Drop previously created tables.
115+
--no-index Do not create indexes (Use when indexes
116+
are already created)
108117
109118
Database options:
110-
-d [ --dbname ] arg Name of your database (Required).
111-
-U [ --username ] arg (=postgres) Name of the user, which have write access
112-
to the database.
113-
-h [ --host ] arg (=localhost) Host of your postgresql database.
114-
-p [ --port ] arg (=5432) db_port of your database.
115-
-W [ --password ] arg Password for database access.
119+
-d [ --dbname ] arg Name of your database (Required).
120+
-U [ --username ] arg Name of the user, which have write access to
121+
the database.
122+
-h [ --host ] arg (=localhost) Host of your postgresql database.
123+
-p [ --port ] arg (=5432) db_port of your database.
124+
-W [ --password ] arg Password for database access.
116125
117126
```

ci/travis/install-libpqxx.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
# ------------------------------------------------------------------------------
3+
# Travis CI scripts
4+
# Copyright(c) pgRouting Contributors
5+
#
6+
# Install osm2pgrouting prerequesits
7+
# ------------------------------------------------------------------------------
8+
9+
set -e
10+
11+
12+
DISTRIBUTION="$1"
13+
14+
if [[ -z "$DISTRIBUTION=" ]] ; then
15+
exit 1
16+
fi
17+
18+
19+
if [[ "$DISTRIBUTION" = "precise" ]] ; then
20+
sudo apt-get install -y libpqxx3-dev
21+
elif [[ "$DISTRIBUTION" = "trusty" ]] ; then
22+
sudo sudo sudo apt-get install -y libpqxx-dev
23+
else
24+
exit 1
25+
fi
26+

ci/travis/osm2pgrouting_build.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
# exit script on error
1010
set -e
1111

12-
# build pgRouting
13-
cmake -DPOSTGRESQL_VERSION=$POSTGRESQL_VERSION
12+
# build osm2pgrouting
13+
mkdir build
14+
cd build
15+
cmake ..
1416
make
1517
sudo make install
16-
18+
cd ..

cmake/FindLibPQXX.cmake

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# - Find libpqxx
2+
# Find the libpqxx includes and client library
3+
# This module defines
4+
# PQXX_INCLUDE_DIRS
5+
# PQXX_LIBRARIES
6+
# PQXX_FOUND
7+
8+
include (FindPackageHandleStandardArgs)
9+
10+
#
11+
# Look for an installation.
12+
#
13+
find_path(LIBPQXX_INCLUDE_DIR NAMES /include/pqxx/connection.hxx PATH_SUFFIXES ${SUFFIX_FOR_INCLUDE_PATH} PATHS
14+
15+
# Look in other places.
16+
${LIBPQXX_DIR_SEARCH}
17+
18+
# Help the user find it if we cannot.
19+
DOC "The ${LIBPQXX_INCLUDE_DIR_MESSAGE}"
20+
)
21+
22+
# Now try to get the include and library path.
23+
if(LIBPQXX_INCLUDE_DIR)
24+
25+
if(EXISTS "${LIBPQXX_INCLUDE_DIR}")
26+
set(LIBPQXX_INCLUDE_DIRS
27+
${LIBPQXX_INCLUDE_DIR}/include
28+
)
29+
endif()
30+
endif()
31+
32+
find_library (LIBPQXX_LIBRARIES
33+
NAMES
34+
pqxx
35+
)
36+
37+
FIND_PACKAGE_HANDLE_STANDARD_ARGS("PQXX"
38+
"libpqxx couldn't be found"
39+
LIBPQXX_LIBRARIES
40+
LIBPQXX_INCLUDE_DIRS
41+
)
42+
43+
mark_as_advanced (PQXX_INCLUDE_DIR PQXX_LIBRARY)

0 commit comments

Comments
 (0)