I’m working on an application integrating mapquest maps and using the mapquest API.
At this moment I want to achieve the following: the registered user has to input latitude and longitude information, and in the database this information has to be stored as geometry type field. Conversely, a user looking at their account should see the latitude and longitude information that was entered.
In an earlier simplified codebase I achieved this directly in the MySQL query, by using the MySQL functions AsText and GeomFromText. But now I’m on CodeIgniter and need to do the conversion in PHP
Is there anything equivalent in PHP to MySQL's AsText and GeomFromText functions?
I, too, am trying to extract geometry field data.I am using the
MySQLiclass to retrieve rows of data and display it according to field type.While I haven't yet figured out how to decode the geometry field data, I can view it by using the
bin2hexfunction. A point stored usingGeomFromText('POINT(-73.91353 42.80611)')usingbin2hexgives me a 50 character string value ofA partial list of field type numbers can be found here.
I hope that this helps you! If I discover more, I'll pass it on here.