So, I've been playing this game for almost 1 week and it's fun. I'm happy with my yard coz my defensive tower can cover all the area of my yard. Glad I didn't expand it too much. LOL
GeoDjango is a Django module that turns it into a web-GIS app. It is powerful as it uses geospatial engines such as GDAL, GEOS and PostGIS. In this post, we'll be creating heat map using leaflet plugin https://github.com/Leaflet/Leaflet.heat . From our views.py , we need to create a function that can return JSON object with this format: [[ 50.5 , 30.5 , 0.2 ] , // lat, lng, intensity [ 50.6 , 30.4 , 0.5 ] , ] Below is an example: Basically, the proposed_roads query uses the Centroid function of GeoDjango, also intensity is obtain by getting the sum (change this depending on your specification or needs) based on the subquery. The output of this query is intensity and the Point object derived from Centroid which is named as "cent". To turn it into the desired format, we need to convert it into list and append the intensity (which is the 3rd value). The function returns a JSON data similar to the required format of leaflet heatmap. You can then use AJAX in ...
Heroku is a platform as a service (PaaS) that enables developers to build, run, and operate applications entirely in the cloud. If you have a simple Django app that doesn't require huge storage or database, Heroku is the best choice . Their free service will suffice your need. Your app will be available almost 24/7 (~23 days up time in a month). You are given 550 hours per month and if you have a credit card, an additional of 450 hours will be rewarded. Enough to make your app to be available always. The server also sleeps after 30 mins of inactivity. This enables you to save uptime hours. In deploying Django in Heroku you just need to have this ff. files: .gitignore runtime.txt requirements.txt Procfile Django App All file must reside in the project directory as shown below: .gitignore is a text file containing the type of files within the directories that wont be included in the deployment of app runtime.txt is a text file containing the version o...
Comments
Post a Comment
Feel free to ask, suggest and comment regarding this post/blog. You can also contact me through e-mail, just always use the contact page. Thank you for visiting this blog.