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

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -