Alfonso,

I ran into similar types of issues when I was importing data into my
project.  I ended up just converting all MultiLine and MultiPolygon
fields into Regular Line and Polygon fields using through a GeoDjango
script (using the 1st Line and Polygon of each feature as the input
for creating new lines and polygons) and putting them into newly
created tables [and renaming everything back...].  None of my imported
data utilized the multi feature, so no data was lost.

The script took a while to run but was quick to write and very simple.

Greg

On Feb 19, 5:42 am, Alfonso <allanhender...@gmail.com> wrote:
> I'm getting an error - "PostGIS spherical operations are only valid on
> PointFields." when I try to do a distance search on a MultiPointField
> in the db.  I kind of understand why but wonder if it's possible to do
> such a query at all on MultiPointFields?
>
> All I'm looking for is:
>
> england_pnt = fromstr('POINT(-1.464854 52.561928)', srid=4326)
> object_list = Activity.objects.filter(coords__distance_lte=
> (england_pnt,D(mi=50)))
>
> At the moment, the MultiPointField in question only contains one x and
> y value, it was set as MultuiPoint in case there were imports of such
> fields so my next question would be can I convert that MultiPointField
> to PointField in my models and DB without messing everything up?
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to