If I have a 'geopoint' column, but I access it using SQL with something like SELECT ST_AsEWKT(coords) as coords and I will get the EWKT text, how can I parese it to a Point() object?
I came up with something like below, but I am guessing this is not the right way?:
$sql = "SELECT st.id,st.name,ST_AsEWKT(coords) as coords FROM store st LIMIT 1";
$conn = $this->getEntityManager()->getConnection();
$stmt = $conn->prepare($sql);
$stmt->execute();
$result = $stmt->fetchAll();
$parser = new PostgreSql();
$point = $parser->convertStringToPHPValue(AbstractSpatialType::getType('geopoint'),$result[0]['coords']);
If I have a 'geopoint' column, but I access it using SQL with something like
SELECT ST_AsEWKT(coords) as coords
and I will get the EWKT text, how can I parese it to a Point() object?I came up with something like below, but I am guessing this is not the right way?: