sql - Syntax error while using centroid function within the RotateCoords function in Spatialite Query -


create table rotated_bus select ao_id, rotatecoords(st_centroid(geometry) substation, 45.00) geometry busbar; 

i trying rotate line geometry (busbar) passing centroid of polygon geometry (substation) inside rotatecoords function. after running above query, getting error “near syntax error”. wrong query?

you join 2 tables:

create table rotated_bus select busbar.ao_id,        rotatecoords(st_centroid(substation.geometry), 45) geometry busbar join substation on busbar.ao_id = substation.substn_id 

alternatively, use correlated subquery (subqueries must complete queries inside pair of parentheses):

create table rotated_bus select ao_id,        (select rotatecoords(st_centroid(geometry), 45)         substation         substn_id = busbar.ao_id        ) geometry busbar 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -