Skip to content

Instantly share code, notes, and snippets.

@bubbobne
Created November 14, 2018 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bubbobne/6f21dc8ae7b15d64de3b538796fb417f to your computer and use it in GitHub Desktop.
Save bubbobne/6f21dc8ae7b15d64de3b538796fb417f to your computer and use it in GitHub Desktop.
export data in shp and use it with qgis timeManager
/*Export to shp file with select. Create a start and end date (weekly)*/
pgsql2shp -f "./test.shp" -h localhost -p 5432 -u **** -P ******* myDataBase "select table2.gid,table2.geom,data.* from (select id,survey_date,extract('week'from date) as dow ,date_trunc('week', date) as start_week,(date_trunc('week', date)+ '7 days'::interval) as end_week, value from table1) as data left join table2 on data.gid=table1.gid;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment