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 ...
What is blockchain and how does it work? You may have heard the term "blockchain" before, but if you're not quite sure what it is or how it works, don't worry. In this article, we'll give you a brief overview of what blockchain is, how it works, and some potential applications for this revolutionary technology. Blockchain is a digital ledger technology that allows multiple parties to securely and transparently exchange data without the need for intermediaries or trusted third parties. The data in a blockchain is stored in a series of blocks, each of which contains a set of transactions that have been verified by a network of computers called nodes. Once a block is added to the blockchain, it cannot be altered or deleted, making it a highly secure and immutable form of data storage. So how does blockchain work in practice? Let's take the example of a cryptocurrency like Bitcoin. When someone wants to send Bitcoin to another person, they initiate a transactio...
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.