Giter VIP home page Giter VIP logo

Comments (11)

brandonreavis avatar brandonreavis commented on August 10, 2024

Interesting...

It seems like creating the coordinate transformation silently failed. It should be (but it's not yet) throwing an error in the CoordinateTransformation constructor if that happens.

https://github.com/naturalatlas/node-gdal/blob/master/src/gdal_coordinate_transformation.cpp#L60

I think the new CoordinateTransformation() is failing due to something like this (link) where proj4.dll isn't found on Travis. I'll need to look into it more, but if you call gdal.verbose() before maybe this error will show up?

ERROR 6: Unable to load PROJ.4 library (proj.dll), creation of OGRCoordinateTransformation failed.

from node-gdal.

brandonreavis avatar brandonreavis commented on August 10, 2024

This has got to be the issue... @brianreavis is looking into statically linking the proj4 library now.

from node-gdal.

GretaCB avatar GretaCB commented on August 10, 2024

I gave it a try by adding gdal.verbose(); before the line that is throwing the error, but nothing. Same output in Travis. Trying to figure out how to install proj.4 into Travis to see if that wipes the error.

from node-gdal.

brandonreavis avatar brandonreavis commented on August 10, 2024

Weird. Hold off a bit on that... we should be building proj.4 into node-gdal so that you shouldn't have to go out and install it.

from node-gdal.

brandonreavis avatar brandonreavis commented on August 10, 2024

That proj.4 error is showing up in travis here:
https://travis-ci.org/mapbox/mapnik-omnivore/builds/28452441#L9357

With the latest commits it will be a properly thrown error.

I was also able to reproduce the error by removing /usr/lib/libproj.so from my system. Tonight we should have node-gdal modified so that it doesn't need to go out and look for that library.

from node-gdal.

springmeyer avatar springmeyer commented on August 10, 2024

@brandonreavis nice work - my sense is the same - that you'll need to both statically link libproj.a and define -DPROJ_STATIC in the gyp files. After that you'll also need to set PROJ_LIB to point at projs' epsg files to support the +init=epsg:... syntax.

from node-gdal.

GretaCB avatar GretaCB commented on August 10, 2024

Woot! Error averted in Travis with the new commit.

from node-gdal.

brianreavis avatar brianreavis commented on August 10, 2024

Noice!

@springmeyer I haven't set PROJ_LIB to the folder containing the EPSG files yet. Do you have any thoughts on how we can make a test that fails before trying to set PROJ_LIB at runtime? The current coordinate transform tests are here, and they include some +init=epsg: transforms (which seem to work, strangely).

from node-gdal.

springmeyer avatar springmeyer commented on August 10, 2024

Try setting PROJ_LIB to something bogus and they should fail. I presume they are passing for you because the default PROJ_LIB path is burned into the binaries when you build and nothing has moved. Another test would be to move your working directory to some different path and then run the tests again. If things still pass is may be because the proj files are actually getting picked up from /usr/local/share/proj/epsg of something.

from node-gdal.

brianreavis avatar brianreavis commented on August 10, 2024

I just did some investigating on the PROJ_LIB situation. The weird thing is: no matter what I try, I can't get the test to break (awesome, but not awesome). What I've tried:

  1. Uninstalled Proj.4 from my machine.
  2. Compiled with -DPROJ_LIB=""
  3. Set the PROJ_LIB environment variable to something bogus.
    export PROJ_LIB=~ && node_modules/.bin/mocha test
  4. Modified pj_open_lib to always return NULL.
  5. Ran the tests from another directory.

Am I missing something here? Is there something off about the +init=epsg: transform test?

from node-gdal.

brianreavis avatar brianreavis commented on August 10, 2024

Closing this. We can re-open if we manage to repro it, but for now I'm going to assume it's a non-issue.

from node-gdal.

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.