You might ask why we hide an error, 'cause it should be fixed right? Anyway, there are instances that we just need to hide it. Let's say for example, "undefined index" error/warning in this case: I have this table with unique attribute names in every "input" elements: ID Name 1 Eds 2 Matt We don't know how many value that the user will input, so I assume that he/she will always input eight(8) values. I must fetch the value from that table by assigning them to a variable. If the user will input less than eight(8), a warning or error will show "undefined index..". In this case, I just hide it.
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 ...