-
-
Save tyrasd/7167203 to your computer and use it in GitHub Desktop.
pbf output cgi-bin script for overpass-api
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
#!/usr/bin/env bash | |
# Copyright 2008, 2009, 2010, 2011, 2012 Roland Olbricht | |
# | |
# This file is (not yet) part of Overpass_API | |
# | |
# Overpass_API is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Affero General Public License as | |
# published by the Free Software Foundation, either version 3 of the | |
# License, or (at your option) any later version. | |
# | |
# Overpass_API 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 Affero General Public License | |
# along with Overpass_API. If not, see <http://www.gnu.org/licenses/>. | |
EXEC_DIR="`dirname $0`/" | |
if [[ ! ${EXEC_DIR:0:1} == "/" ]]; then | |
{ | |
EXEC_DIR="`pwd`/$EXEC_DIR" | |
}; | |
fi | |
BIN_DIR="$EXEC_DIR/../bin" | |
echo "Content-Type: application/octet-stream" | |
echo | |
# see https://github.com/drolbr/Overpass-API/issues/37#issuecomment-24020046 | |
echo "$QUERY_STRING" | ../bin/osm3s_query --quiet | $BIN_DIR/osmconvert - --out-pbf | |
EXITCODE=$? | |
if [[ $EXITCODE -ne 0 ]]; then | |
echo "Content-Type: text/plain; charset=utf-8" | |
echo "Status: 400 Bad Request" | |
echo | |
echo "Error in ...:" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment