Skip to content

Commit ef63fd0

Browse files
jbo-adstbonfort
authored andcommitted
Mapcache detail (#193)
* Create contrib/mapcache_export_prep * Initial version of mapcache_export_prep * Borrow option syntax from mapcache_seed * Set output format to JSON * Minor changes * Minor presentation changes * First step to add OGR/GEOS support * Use cJSON to make report * Add OGR command line options borrowed from mapcache_seed * Output JSON shows GeoJSON geometry * Count tiles in arbitrary geometry * Presentation adjustments in JSON output * Add copyright * Handle empty & mono-SQLite caches, prepare for composite caches * Handle composite caches * Add --short-output option for not reporting missing files * Make OGR/GEOS optional * Fix bug * Another bug fix * Remove reference to a cmake variable absent from v2.6 * Exclude maxx and maxy from region bounding box * Set region to grid extent when no region has been provided * Make some error messages more explicit * Take {inv_...} in templates into account * Rename mapcache_export_prep to mapcache_detail * mapcache_detail: add report on missing tiles * Update mapcache_detail.c to match evolution in dimension handling * Improve handling of mapcache_detail dependencies * Fix compilation issue on Windows * Windows fix * Fix travis wrt. mapcache_detail dependencies * Windows fix * Make ezxml functions available from outside DLL * Make mapcache functions available from outside DLL
1 parent 0e74456 commit ef63fd0

File tree

7 files changed

+1786
-30
lines changed

7 files changed

+1786
-30
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ before_install:
3838
script:
3939
- mkdir build
4040
- cd build
41-
- if test "$BUILD_TYPE" = "maximum"; then cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DWITH_TIFF=ON -DWITH_GEOTIFF=ON -DWITH_TIFF_WRITE_SUPPORT=ON -DWITH_PCRE=ON -DWITH_SQLITE=ON -DWITH_BERKELEY_DB=ON; else cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DWITH_TIFF=OFF -DWITH_GEOTIFF=OFF -DWITH_TIFF_WRITE_SUPPORT=OFF -DWITH_PCRE=OFF -DWITH_SQLITE=OFF -DWITH_BERKELEY_DB=OFF -DWITH_GDAL=OFF -DWITH_GEOS=OFF -DWITH_FCGI=OFF -DWITH_CGI=OFF -DWITH_APACHE=OFF -DWITH_OGR=OFF -DWITH_MAPSERVER=OFF; fi
41+
- if test "$BUILD_TYPE" = "maximum"; then cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DWITH_TIFF=ON -DWITH_GEOTIFF=ON -DWITH_TIFF_WRITE_SUPPORT=ON -DWITH_PCRE=ON -DWITH_SQLITE=ON -DWITH_BERKELEY_DB=ON; else cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DWITH_TIFF=OFF -DWITH_GEOTIFF=OFF -DWITH_TIFF_WRITE_SUPPORT=OFF -DWITH_PCRE=OFF -DWITH_SQLITE=OFF -DWITH_BERKELEY_DB=OFF -DWITH_GDAL=OFF -DWITH_GEOS=OFF -DWITH_FCGI=OFF -DWITH_CGI=OFF -DWITH_APACHE=OFF -DWITH_OGR=OFF -DWITH_MAPSERVER=OFF -DWITH_MAPCACHE_DETAIL=OFF; fi
4242
- make -j3
4343
- sudo make install
4444
# Only test with Apache 2.4

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ option(WITH_PCRE "Use PCRE for regex tests" OFF)
9696
option(WITH_MAPSERVER "Enable (experimental) support for the mapserver library" OFF)
9797
option(WITH_RIAK "Use Riak as a cache backend" OFF)
9898
option(WITH_GDAL "Choose if GDAL raster support should be built in" ON)
99+
option(WITH_MAPCACHE_DETAIL "Build coverage analysis tool for SQLite caches" ON)
99100

100101
find_package(PNG)
101102
if(PNG_FOUND)
@@ -301,7 +302,7 @@ macro(status_optional_component component enabled libpath)
301302
endif()
302303
endmacro()
303304
macro(status_optional_feature feature enabled)
304-
if("${enabled}" EQUAL "1")
305+
if("${enabled}" EQUAL "1" OR "${enabled}" STREQUAL "ON")
305306
message(STATUS " * ${feature}: ENABLED")
306307
else()
307308
message(STATUS " * ${feature}: disabled")
@@ -327,10 +328,16 @@ status_optional_component("PCRE" "${USE_PCRE}" "${PCRE_LIBRARY}")
327328
status_optional_component("Experimental mapserver support" "${USE_MAPSERVER}" "${MAPSERVER_LIBRARY}")
328329
status_optional_component("RIAK" "${USE_RIAK}" "${RIAK_LIBRARY}")
329330
status_optional_component("GDAL" "${USE_GDAL}" "${GDAL_LIBRARY}")
331+
message(STATUS " * Optional features")
332+
status_optional_feature("MAPCACHE_DETAIL" "${WITH_MAPCACHE_DETAIL}")
330333

331334
INSTALL(TARGETS mapcache DESTINATION ${CMAKE_INSTALL_LIBDIR})
332335

333336
add_subdirectory(util)
334337
add_subdirectory(cgi)
335338
add_subdirectory(apache)
336339
add_subdirectory(nginx)
340+
341+
if (WITH_MAPCACHE_DETAIL)
342+
add_subdirectory(contrib/mapcache_detail)
343+
endif (WITH_MAPCACHE_DETAIL)
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
option(WITH_GEOS
2+
"Choose if GEOS geometry operations support should be built in" ON)
3+
option(WITH_OGR
4+
"Choose if OGR/GDAL input vector support should be built in" ON)
5+
6+
add_executable(mapcache_detail mapcache_detail.c)
7+
target_link_libraries(mapcache_detail mapcache)
8+
9+
if (WITH_SQLITE)
10+
find_package(SQLITE)
11+
if(SQLITE_FOUND)
12+
include_directories(${SQLITE_INCLUDE_DIR})
13+
target_link_libraries(mapcache_detail ${SQLITE_LIBRARY})
14+
else(SQLITE_FOUND)
15+
report_mandatory_not_found(SQLITE)
16+
endif(SQLITE_FOUND)
17+
else (WITH_SQLITE)
18+
report_dependency_error(MAPCACHE_DETAIL SQLITE)
19+
endif (WITH_SQLITE)
20+
21+
if (WITH_OGR)
22+
find_package(GDAL)
23+
if (GDAL_FOUND)
24+
include_directories(${GDAL_INCLUDE_DIR})
25+
target_link_libraries(mapcache_detail ${GDAL_LIBRARY})
26+
set (USE_OGR 1)
27+
else (GDAL_FOUND)
28+
report_optional_not_found(GDAL)
29+
endif (GDAL_FOUND)
30+
endif (WITH_OGR)
31+
32+
if (WITH_GEOS)
33+
find_package(GEOS)
34+
if (GEOS_FOUND)
35+
include_directories(${GEOS_INCLUDE_DIR})
36+
target_link_libraries(mapcache_detail ${GEOS_LIBRARY})
37+
set (USE_GEOS 1)
38+
else (GEOS_FOUND)
39+
report_optional_not_found(GEOS)
40+
endif (GEOS_FOUND)
41+
endif (WITH_GEOS)
42+
43+
44+
set (CURRENT_BINARY_DIR "${PROJECT_BINARY_DIR}/contrib/mapcache_detail/")
45+
include_directories("${CURRENT_BINARY_DIR}")
46+
47+
configure_file (
48+
"${CMAKE_CURRENT_SOURCE_DIR}/mapcache_detail_config.h.in"
49+
"${CURRENT_BINARY_DIR}/mapcache_detail_config.h"
50+
)
51+
52+
message(STATUS "* mapcache_detail Configuration Options:")
53+
message(STATUS " * Mandatory components")
54+
message(STATUS " * SQLite: ${SQLITE_LIBRARY}")
55+
message(STATUS " * Optional components")
56+
status_optional_component("GEOS" "${USE_GEOS}" "${GEOS_LIBRARY}")
57+
status_optional_component("OGR" "${USE_OGR}" "${GDAL_LIBRARY}")
58+
59+
INSTALL(TARGETS mapcache_detail
60+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

0 commit comments

Comments
 (0)