Skip to content

Instantly share code, notes, and snippets.

@hjanetzek
Created May 5, 2013 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hjanetzek/5521755 to your computer and use it in GitHub Desktop.
Save hjanetzek/5521755 to your computer and use it in GitHub Desktop.
Overpass API interpreter-to-pbf output
#!/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
echo "$QUERY_STRING" | ./interpreter | sed '1,3d' | $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