Giter VIP home page Giter VIP logo

Comments (7)

dfellis avatar dfellis commented on May 22, 2024

degsToRads is not the function you think it is. It converts degrees to radians, not (lat, lng) coordinates + resolution to hexagon IDs. You want geoToH3 instead.

As for the error you're running into, I'm not sure if that's because the signature doesn't match (degsToRads only takes one double, not two doubles and an int) or if your .so file cannot be loaded because you're on a Mac (I think the standard there is .dylib; .so is the Linux file and .dll for Windows)

from h3.

isaacbrodsky avatar isaacbrodsky commented on May 22, 2024

@neatlife could you post the following?

  • output of uname -a
  • output of file path_to_your_h3.so
  • output of nm path_to_your_h3.so (if you're using Mac OSX)

Other than the naming issue @dfellis mentioned above, my guess is that this is happening because PHP is not loading the built H3 library, only your extension (which needs to statically include H3 or needs to find H3 dynamically) You could try using make install after building the Uber H3 library and see if that helps.

from h3.

neatlife avatar neatlife commented on May 22, 2024

@dfellis Yes, you are right, i already fix nameing error: neatlife/php-h3@fcc9324

from h3.

neatlife avatar neatlife commented on May 22, 2024

@isaacbrodsky Yes, of course

image

before write php extension, I already execute cmake and make and sudo make install command in h3 project

from h3.

isaacbrodsky avatar isaacbrodsky commented on May 22, 2024

One other thing I forgot to mention is running otool -L your_path_to_h3.so

Is the H3 library installed at /usr/local/lib/libh3.1.a (static library - this is the default) or at /usr/local/lib/libh3.1.dylib (dynamic library)?

If it's the first (.a), please try rebuilding and reinstalling H3 as a shared library:

cmake -DBUILD_SHARED_LIBS=ON .
make
sudo make install

You might need to rebuild your extension before retrying.

If that doesn't help, do you know if there's a way to set your extension to statically link to H3? This is what we do in the Java bindings and it avoids this issue.

from h3.

neatlife avatar neatlife commented on May 22, 2024

@isaacbrodsky
otool output:

image

I run the below command, and recompile php extension, but error still exists

cmake -DBUILD_SHARED_LIBS=ON .
make
sudo make install

image

image

I search some article, but not find a way to link to h3 library in php extension.

from h3.

neatlife avatar neatlife commented on May 22, 2024

@isaacbrodsky @dfellis I already fix this error, just pull the latest h3 code, and add link to h3 library neatlife/php-h3@6cedacd, thank you.

from h3.

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.