Re: Dump LineString GEOM to Point GEOM (One Model To Another)

2013-05-31 Thread Jani Tiainen
On Wed, 29 May 2013 07:13:04 -0700 (PDT)
kpurdon  wrote:

> Is it possible, outside of using a raw SQL query (PostGIS/PostgreSQL) to do 
> a GEOM dump.
> 
> I have a table (model) where 1 row is 1 LineString and I need to dump that 
> table into another table (model) where 1 row is 1 point from the LineString.
> 
> Raw SQL would be something like:
> 
> SELECT geom AS points FROM ST_DumpPoints((SELECT fl_line FROM 
> greenland.line_paths WHERE ...));
> 
> In this case line_paths is the LineString table and fl_line the LineString 
> GEOM.
> 
> How can I do this within GeoDjango w/o using rawSQL and bypassing the 
> models?

Linestrings do have coord_seq property that you can iterate over and generate 
point geometries form that and save to another table.

-- 

Jani Tiainen

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Dump LineString GEOM to Point GEOM (One Model To Another)

2013-05-29 Thread kpurdon
Is it possible, outside of using a raw SQL query (PostGIS/PostgreSQL) to do 
a GEOM dump.

I have a table (model) where 1 row is 1 LineString and I need to dump that 
table into another table (model) where 1 row is 1 point from the LineString.

Raw SQL would be something like:

SELECT geom AS points FROM ST_DumpPoints((SELECT fl_line FROM 
greenland.line_paths WHERE ...));

In this case line_paths is the LineString table and fl_line the LineString 
GEOM.

How can I do this within GeoDjango w/o using rawSQL and bypassing the 
models?

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.