Pregunta

I need to implement a GeoPointField with Doctrine2.

It seems that Zend and Doctrine don't support it natively...

Is there a best practice for validating such an input? In the database I'd use a simple string field, right?

¿Fue útil?

Solución

/^(\-?\d+(?:\.\d+)?),?\s*(\-?\d+(?:\.\d+)?)$/

This regexp validates and captures GEO input:

  • Latitude, Longitude
  • Latitude Longitude
  • Coords copied directly from GoogleMaps
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top