Giter VIP home page Giter VIP logo

bindings-gdal's People

Contributors

albertov avatar ghorn avatar guibou avatar silky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bindings-gdal's Issues

undefined reference to `GDALCreateOverviewDataset(GDALDataset*, int, int)'

$ gdal-config --version
2.2.1

$ stack build --flag bindings-gdal:examples
bindings-gdal-2.1.1.1: build (lib + exe)
Preprocessing library bindings-gdal-2.1.1.1...
Preprocessing executable 'ogrinfo-hs' for bindings-gdal-2.1.1.1...
Preprocessing executable 'rasterstats-hs' for bindings-gdal-2.1.1.1...
Linking .stack-work/dist/x86_64-linux-nopie/Cabal-1.24.2.0/build/rasterstats-hs/rasterstats-hs ...
/home/greghorn/hslibs/bindings-gdal/.stack-work/dist/x86_64-linux-nopie/Cabal-1.24.2.0/build/libHSbindings-gdal-2.1.1.1-4fDT7HjJSKi7IYJavM3faa.a(overviews.o): In function `hs_gdal_create_overview_dataset':

/home/greghorn/hslibs/bindings-gdal/cbits/overviews.cpp:41:0: error:
     undefined reference to `GDALCreateOverviewDataset(GDALDataset*, int, int)'
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)

--  While building package bindings-gdal-2.1.1.1 using:
      /home/greghorn/hslibs/bindings-gdal/.stack-work/dist/x86_64-linux-nopie/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-nopie/Cabal-1.24.2.0 build lib:bindings-gdal exe:ogrinfo-hs exe:rasterstats-hs --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1

Any clue why this is happening? An older version of bindings-gdal works fine for me.

Failure with gdal >= 2.3.1

Based on this pull request: #18, I setup the following patch: https://github.com/guibou/bindings-gdal/tree/gdal_2_3_1_failure. Theses commands are failing (segmentation fault apparently):

  • nix-build -A bindings-gdal_2_3_1
  • nix-build -A bindings-gdal_2_4_0

However nix-build -A bindings-gdal_1_11 and nix-build -A bindings-gdal (without the patch) are building and tests are passing correctly.

I suspect a change in gdal-2.3.1 is responsible for the failure.

Upload a version on hackage

Could you upload a version on hackage? It will ease the use of bindings-gdal with tools such as cabal, stack or nix.

Doesn't appear to build on OS X

For some reason I can't get this to build on OS X, the issue seems to be with cbits/errorhandler.h, but I can't see (or find out) why. It doesn't appear to be a problem with finding the gdal libs and headers (I've tried explicitly setting them with --extra-{include, lib}-dirs=, both with my gdal install from homebrew and using the version installed with the install_gdal.sh script. stack-output.txt is the output from running stack build -v. Happy to help debug this if you have any ideas.

ExecuteSQL issues

Hello, I'm trying to do some SQL requests against a shapefile, but I'm not sure how to do it.

main :: IO ()
main = do
    withGDAL $ runGDAL_ $ do
      ds <- OGR.openReadOnly "ne_10m_admin_0_countries.shp"
      let src = sourceLayer_ $ executeSQL DefaultDialect "SELECT * FROM fondo" Nothing ds
      (fs :: [Feature]) <- runOGR (src $$ CL.consume)

This throws me a compilation error:

    Couldn't match type ‘l0’ with ‘l’
      because type variable ‘l’ would escape its scope
    This (rigid, skolem) type variable is bound by
      a type expected by the context: OGR s l [Feature]
      at app/Main.hs:45:28-53
    Expected type: Source (OGR s l) Feature
      Actual type: OGRSource s l0 Feature
    Relevant bindings include
      src :: OGRSource s l0 Feature (bound at app/Main.hs:44:11)
    In the first argument of ‘($$)’, namely ‘src’
    In the first argument of ‘runOGR’, namely ‘(src $$ CL.consume)’

I'm probably doing something wrong.

Cannot build examples using Cabal

I have been trying to build the lib with Cabal, with the following specifications:

cabal-install: 3.8.1.0
ghc: 9.2.4 (also tried with 8.6.5)

By pulling the commit 331a6e2 (master) I have ran

cabal configure -f examples

and then

cabal build

and ran on the following problem:

exe/OGRInfo.hs:21:3: error:
    • No instance for (MonadFail (GDAL s))
        arising from a do statement
        with the failable pattern ‘[fname, nameStr]’
    • In a stmt of a 'do' block: [fname, nameStr] <- liftIO getArgs
      In the second argument of ‘($)’, namely
        ‘do [fname, nameStr] <- liftIO getArgs
            let name = T.pack nameStr
            ds <- OGR.openReadOnly fname
            l <- OGR.getLayerByName name ds
            ....’
      In the second argument of ‘($)’, namely
        ‘runGDAL_
           $ do [fname, nameStr] <- liftIO getArgs
                let name = T.pack nameStr
                ds <- OGR.openReadOnly fname
                l <- OGR.getLayerByName name ds
                ....’
   |
21 |   [fname, nameStr] <- liftIO getArgs
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I think this is easy to fix this but I am not yet proficient with Haskell. I couldn't find the correct pattern.

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.