Hello all, I'm having an issue taking geofield data and manipulating it with the geophp library. I originally posted a question over in the geofield queue, but I think it would be more appropriate here.
Basically, I cannot take data I have stored in a geofield and load it with geoPHP:load($data,'wkt'). When I do a manual db query to get the geometry, the data loads but geophp kicks back an error: something about cannot load object of stdClass. I know that is related to the type of variable I'm using to store the query data.
I can also grab the data using node_load, but when I load the geom data into geophp usingt that, I get this error:
Undefined offset: 1
Cannot construct Point. x and y should be numeric in 23 of /modules/geophp/geoPHP/lib/geometry/Point.class.php
SOOOoooo, I guess my question is: is there a preferred way to get data from drupal and load it into geoPHP for manipulation? I'm attempting to write a custom module and geoPHP seems to be exactly what I need, but I just can't get past this roadblock.
Any help or push in the right direction is greatly appreciated. Even a reference to a module that is doing this same thing would be helpful. I've dug into the code of several modules already, but I'm still coming up empty.
Comments
Comment #1
apt94jesse CreditAttribution: apt94jesse commentedIf anyone is interested, I did solve the issue, although I'm sure there's a geofield function I could have used, too. Code is below in case it can help anyone.
Comment #2
apt94jesse CreditAttribution: apt94jesse commentedIf anyone is interested, I did solve the issue, although I'm sure there's a geofield function I could have used, too. Code is below in case it can help anyone.