How hard is it to modify the Django Models?

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-03-30T21:13:20Z Indexed on 2010/04/10 15:53 UTC
Read the original article Hit count: 412

Filed under:
|
|
|
|

I am doing geolocation, and Django does not have a PointField. So, I am forced to writing in RAW SQL. GeoDjango, the Django library, does not support the following query for MYSQL databases (can someone verify that for me?)

 cursor.execute("SELECT id FROM l_tag WHERE\
               (GLength(LineStringFromWKB(LineString(asbinary(utm),asbinary(PointFromWKB(point(%s, %s)))))) < %s + accuracy + %s)\

I don't nkow why GeoDjango library cannot do this in MYSQL database. I hate writing RAW SQL for calculating distances between two points. Is there a way I can create my own library for Django that can handle this? If so, how hard is it?

© Stack Overflow or respective owner

Related posts about geodjango

Related posts about django