Git Product home page Git Product logo

Comments (2)

kovar-ursa avatar kovar-ursa commented on August 22, 2024

I am running into the same problem on OSX (Unix based.)

Where would your suggested code be inserted?

I manually performed the proposed changes and then ran:

docker run -t -i -v $(pwd)/data:/code/data openelevation/open-elevation /code/create-tiles.sh SRTM_NE_250m.TIF 10 10

And it produced the same error.

I changed the file extension from .tif to .TIF and then ran:

docker run -t -i -v $(pwd)/data:/code/data openelevation/open-elevation /code/create-tiles.sh data/SRTM_NE_250m.TIF 10 10

and it worked.

So, two problems I think. 1) File is in a subdirectory and 2) file has a lowercase extension.

from open-elevation.

Manodiestra avatar Manodiestra commented on August 22, 2024

Thanks for the followup question. I put the code in create-dataset.sh right after download-srtm-data.sh is called.

The code I suggested might also not be targeting the correct directory for running within the docker image. It may need to be targeting ../ like so:

# Move tif files out of their folders
mv ../SRTM_NE_250m_TIF/SRTM_NE_250m.tif ../ && \
mv ../SRTM_SE_250m_TIF/SRTM_SE_250m.tif ../ && \
mv ../SRTM_W_250m_TIF/SRTM_W_250m.tif ../
# Delete the folders that used to contain them
rm -r ../SRTM_NE_250m_TIF ../SRTM_SE_250m_TIF ../SRTM_W_250m_TIF

So this would be the entire create-dataset.sh file:

#!/usr/bin/env bash

OUTDIR="/code/data"
if [ ! -e $OUTDIR ] ; then
    echo $OUTDIR does not exist!
fi

CUR_DIR=$(pwd)

set -eu

cd $OUTDIR
../download-srtm-data.sh

# Move tif files out of their folders
mv ../SRTM_NE_250m_TIF/SRTM_NE_250m.tif ../ && \
mv ../SRTM_SE_250m_TIF/SRTM_SE_250m.tif ../ && \
mv ../SRTM_W_250m_TIF/SRTM_W_250m.tif ../
# Delete the folders that used to contain them
rm -r ../SRTM_NE_250m_TIF ../SRTM_SE_250m_TIF ../SRTM_W_250m_TIF

../create-tiles.sh SRTM_NE_250m.tif 10 10
../create-tiles.sh SRTM_SE_250m.tif 10 10
../create-tiles.sh SRTM_W_250m.tif 10 20
rm -rf SRTM_NE_250m.tif SRTM_SE_250m.tif SRTM_W_250m.tif *.rar

cd $CUR_DIR

@kovar-ursa As for why you needed upper case .TIF instead of lower case .tif, I'm not sure. Is it possible that when you ran mv you specified the name of the file in the destination? The mv command will move the file, but it can also rename it. For example, SRTM_NE_250m_TIF/SRTM_NE_250m.tif ./SRMT_NE_250m.TIF would move the file out of the folder, and rename it with an upper case extension.

from open-elevation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.