aboutsummaryrefslogtreecommitdiff
path: root/src/apps
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-01-27 20:38:40 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-01-27 20:38:40 +0100
commit15814256e2fbbc2702422fd3d09d3a0f6be60006 (patch)
tree93b2016db24e875ccebb43abcd2de43a41d1f698 /src/apps
parentea6245ea32f0b0ee414c22951b1f5dc4048782de (diff)
downloadPROJ-15814256e2fbbc2702422fd3d09d3a0f6be60006.tar.gz
PROJ-15814256e2fbbc2702422fd3d09d3a0f6be60006.zip
projinfo: add --remote-data switch
Diffstat (limited to 'src/apps')
-rw-r--r--src/apps/projinfo.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/apps/projinfo.cpp b/src/apps/projinfo.cpp
index 360aafc4..9cd9b2ee 100644
--- a/src/apps/projinfo.cpp
+++ b/src/apps/projinfo.cpp
@@ -98,9 +98,9 @@ static void usage() {
<< std::endl
<< " [--identify] [--3d]" << std::endl
<< " [--c-ify] [--single-line]" << std::endl
- << " --searchpaths | {object_definition} | (-s "
- "{srs_def} -t {srs_def})"
- << std::endl;
+ << " --searchpaths | --remote-data | "
+ "{object_definition} |"
+ << " (-s {srs_def} -t {srs_def})" << std::endl;
std::cerr << std::endl;
std::cerr << "-o: formats is a comma separated combination of: "
"all,default,PROJ,WKT_ALL,WKT2:2015,WKT2:2019,WKT1:GDAL,"
@@ -1069,6 +1069,23 @@ int main(int argc, char **argv) {
std::cout << path << std::endl;
}
std::exit(0);
+ } else if (ci_equal(arg, "--remote-data")) {
+#ifdef CURL_ENABLED
+ if (pj_context_is_network_enabled(nullptr)) {
+ std::cout << "Status: enabled" << std::endl;
+ std::cout << "URL: " << pj_context_get_url_endpoint(nullptr)
+ << std::endl;
+ } else {
+ std::cout << "Status: disabled" << std::endl;
+ std::cout << "Reason: not enabled in proj.ini or "
+ "PROJ_NETWORK=ON not specified"
+ << std::endl;
+ }
+#else
+ std::cout << "Status: disabled" << std::endl;
+ std::cout << "Reason: build without Curl support" << std::endl;
+#endif
+ std::exit(0);
} else if (arg == "-?" || arg == "--help") {
usage();
} else if (arg[0] == '-') {