Changes between Version 2 and Version 3 of django_gheat


Ignore:
Timestamp:
Apr 13, 2011, 8:21:52 PM (14 years ago)
Author:
dennisw
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • django_gheat

    v2 v3  
    4545Once you've entered the correct settings, you will be able to start Django.
    4646{{{
    47 $ cd django_gheat/samples/persisted
     47# 'cd' to project root
     48# The following command will add some standard Django tables and the tables defined in django_gheat/gheat/models.py to the database
     49$ ./manage.py syncdb
    4850
    49 # The following command will add some standard Django tables and the tables defined in django_gheat/gheat/models.py to the database
    50 $ python manage.py syncdb
    51 
    52 $ python manage.py runserver
     51# if using sample page, first 'cd samples/persisted', will get fixed soon
     52$ ./manage.py runserver
    5353}}}
    5454Something like this should return:
     
    7575CREATE TABLE `gheat_gebruiker` (
    7676    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    77     `gebruiker` varchar(64) NOT NULL,
    78     `apparatuur` varchar(64) NOT NULL
     77    `naam` varchar(64) NOT NULL,
     78    `email` varchar(64) NOT NULL
    7979)
    8080;
     81CREATE TABLE `gheat_apparatuur` (
     82    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
     83    `antenne` varchar(64) NOT NULL,
     84    `kaart` varchar(64) NOT NULL
     85)
     86;
     87CREATE TABLE `gheat_meetrondje` (
     88    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
     89    `datum` datetime NOT NULL,
     90    `naam` varchar(60) NOT NULL,
     91    `gebruiker_id` integer NOT NULL,
     92    `apparatuur_id` integer NOT NULL
     93)
     94;
     95ALTER TABLE `gheat_meetrondje` ADD CONSTRAINT `apparatuur_id_refs_id_5e2d317` FOREIGN KEY (`apparatuur_id`) REFERENCES `gheat_apparatuur` (`id`);
     96ALTER TABLE `gheat_meetrondje` ADD CONSTRAINT `gebruiker_id_refs_id_3b558609` FOREIGN KEY (`gebruiker_id`) REFERENCES `gheat_gebruiker` (`id`);
    8197CREATE TABLE `gheat_meting` (
    8298    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
     99    `meetrondje_id` integer NOT NULL,
    83100    `accespoint_id` integer NOT NULL,
    84     `gebruiker_id` integer NOT NULL,
    85101    `lat` double precision NOT NULL,
    86102    `lng` double precision NOT NULL,
    87     `signaal` integer NOT NULL,
    88     `datum` datetime NOT NULL
     103    `signaal` integer NOT NULL
    89104)
    90105;
    91 ALTER TABLE `gheat_meting` ADD CONSTRAINT `gebruiker_id_refs_id_56605efc` FOREIGN KEY (`gebruiker_id`) REFERENCES `gheat_gebruiker` (`id`);
    92106ALTER TABLE `gheat_meting` ADD CONSTRAINT `accespoint_id_refs_id_49f1ad5c` FOREIGN KEY (`accespoint_id`) REFERENCES `gheat_accespoint` (`id`);
     107ALTER TABLE `gheat_meting` ADD CONSTRAINT `meetrondje_id_refs_id_6c4042fe` FOREIGN KEY (`meetrondje_id`) REFERENCES `gheat_meetrondje` (`id`);
    93108COMMIT;
     109
    94110}}}
    95111Note that on this moment only the gheat_meting(lat, lng, signaal) are used for generating heatmaps, so make sure you atleast put some data in those columns.
     
    98114You can prerender a heatmap with the following command:
    99115{{{
    100 $ cd django_gheat/samples/persisted
    101 $ python manage.py gen_tiles
     116# 'cd' to project root
     117$ ./manage.py gen_tiles
    102118}}}
    103119This will prerender a heatmap with the default boundingbox specified in django_gheat/gheat/management/commands/gen_tiles.py
     
    109125# -b = view used for creating tiles, default should be fine
    110126
    111 $ python manage.py gen_tiles -s 60,6 -e 66,8 -c firetrans -b serve_tile
     127$ ./manage.py gen_tiles -s 60,6 -e 66,8 -c firetrans -b serve_tile
    112128}}}
    113129