Dear Developers,
I recently installed the latest Django version (github)
'1.11.dev20160703135514'
To use the spatial lookup API . Specially the GeoQuery.filter(__intersects,
something) function.
I've found that the method hangs while executing.
I'm using a very big dataset. If I use a small raster it works without
problems.
In any case, there is a function (ST_Polygon) in between that is making a
lot of troubles. Seems that everything is faster without it.
Let me show you:
t0.biomeGeometry is a Polygon Field from geodjango model base
DemMexLow is the ModelBase of a raster table.
aa = DemMexLow.objects.filter(rast__intersects=t0.biomeGeometry)
If I retrieve the data it almost never ends. Takes a lot of time.
Examining the raw query I got this:
SELECT "demmex120"."rid", "demmex120"."rast" FROM "demmex120" WHERE
ST_Intersects(ST_Polygon("demmex120"."rast"),
ST_GeomFromEWKB('\001\003\000\000
\346\020\000\000\001\000\000\000\005\000\000\000\000\000\000\000\000@[\300\000\000\000\000\000\000;@\000\000\000\000\0004[\300\000\000\000\000\000\000;@\000\000\000\000\0004[\300\000\000\000\000\0000;@\000\000\000\000\000@[\300\000\000\000\000\0000;@\000\000\000\000\000@[\300\000\000\000\000\000\000;@'::bytea))
where: demmex120 is the name of the table.
The substring in yellow : ST_Polygon("demmex120"."rast" is the problem.
If I run the raw sql without the ST_Polygon the query is fast.
What is the purpose of this?
Thank you very much and best wishes
Juan
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/1be483fa-a95a-4d5e-98e6-0161b9e58159%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.