Comments (7)
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 double
s 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.
@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.
@dfellis Yes, you are right, i already fix nameing error: neatlife/php-h3@fcc9324
from h3.
@isaacbrodsky Yes, of course
before write php extension, I already execute cmake and make and sudo make install command in h3 project
from h3.
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.
@isaacbrodsky
otool output:
I run the below command, and recompile php extension, but error still exists
cmake -DBUILD_SHARED_LIBS=ON .
make
sudo make install
I search some article, but not find a way to link to h3 library in php extension.
from h3.
@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)
- About RFC: Polyfill modes release plan HOT 1
- replace `sprintf` with `snprintf` HOT 1
- Add additional modes for polygonToCells HOT 12
- Hex (cell) ID validation HOT 3
- Fuzzer timeout on fuzzerIj: gridPathCells
- Broken Link to website docs in contributing.md
- Broken link to website in contributing docs
- Uber CLA Contact HOT 1
- Has cell_to_vertex been implemented? HOT 2
- Replace empty function parameters with `void` HOT 1
- cell_to_child_pos() version 4 of the Python API client HOT 3
- polygonToCells: validity of polygons HOT 3
- Missing library stubs MYPY HOT 2
- polygonToCells not returning all H3Cells for the bounding box containing both USA and Russia HOT 1
- Confirmation of grid algorithm HOT 3
- cellToChildren error HOT 2
- Add function for returning the H3 indices of each endpoint of a directed edge HOT 5
- Expose cellToChildrenSize in bindings HOT 1
- Getting unexpected results when converting coordinates in either direction HOT 4
- Meta: blog post has broken images HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from h3.