Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
33 views64 pages

Geo Crime Mapper Report

Uploaded by

my689013
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views64 pages

Geo Crime Mapper Report

Uploaded by

my689013
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 64

Tribhuvan University

Faculty of Humanities and Social Science

Geo-Crime Mapper

A PROJECT REPORT

Submitted to

Department of Computer Application

St. Lawrance college

In partial fulfillment of the requirements for the Bachelors in Computer Application

Submitted by

Ishan Shrestha (T.U. Reg. No. 6-2-788-45-2020)

November 2024

Under the Supervision of

Parash Mishra
Tribhuvan University

Faculty of Humanities and Social Science

St. Lawrance College

Supervisor’s Recommendation

I hereby recommend that this project prepared under my supervision by Ishan Shrestha
entitled “Geo-Crime Mapper” in partial fulfillment of the requirements for the degree of
Bachelor of Computer Application is recommended for the final evaluation.

___________________

Parash Mishra

BCA Department

St. Lawrence College

Chabahil-7, Kathmandu 44600

i
Tribhuvan University

Faculty of Humanities and Social Science

St. Lawrance College

LETTER OF APPROVAL

This is to certify that this project prepared by Ishan Shrestha entitled “Geo Crime
Mapper” in partial fulfillment of the requirements for the degree of Bachelors in
Computer Application has been evaluated. In our opinion it is satisfactory in scope and
quality as a project for the required degree.

…………………………….. …………………………………

SIGNATURE of Supervisor SIGNATURE of HOD/ Coordinator

Parash Mishra Basanta Gyawali

BCA Department Program Coordinator

St. Lawrence College St. Lawrence College

Chabahil-7, Kathmandu 44600 Chabahil-7, Kathmandu 44600

…………………………….. ……………………………..

SIGNATURE of Internal Examiner SIGNATURE of External Examiner


Internal Examiner External Examiner

ii
Abstract

Geo-Crime Mapper is a web-based system designed to facilitate crime analysis and


visualization. The tool leverages Geographic Information Systems (GIS) and the
DBSCAN (Density-Based Spatial Clustering of Applications with Noise) clustering
algorithm to detect and visualize crime hotspots based on spatial patterns. By using
DBSCAN, the system groups crime incidents that occur in proximity to one another,
allowing users to identify areas with high crime density and analyze spatial trends without
requiring predefined parameters. It aims to improve the effectiveness of crime analysis by
offering an intuitive, data-driven approach to crime visualization, enabling authorities to
make informed decisions on crime prevention and intervention strategies. The tool also
provides scalability for future updates, allowing for the inclusion of additional features
and geographic areas.

Keywords: HTML, CSS, JAVASCRIPT, POSTGRES, DOCKER, PYTHON, POSTGIS,


GIS, DBSCAN

iii
ACKNOWLEDGEMENT

This project is prepared in partial fulfilment of the requirement of 4th Semester Project-I.
The satisfaction and success of completion of this task would be incomplete without
heartfelt thanks to people whose constant guidance, support, and encouragement made
this work successful. In doing this undergraduate project we have been fortunate to have
help, support, and encouragement from many people. We would like to acknowledge
them for their cooperation.

We would like to thank St. Lawrence College for providing us a huge platform to gain
knowledge about different aspects of Computer Science and Information Technology.

We would like to thank our Supervisor Mr. Parash Mishra who persuaded and
continuously guided us during the whole course of our project. We would also like to
thank him for providing us with the necessary content and classes regarding the project.
We are also grateful to Mr. Raj Kumar Shrestha for acting as our supervisor and showing
immense patience and understanding throughout the project and provided suggestions.

Last, but not least, we also take this opportunity to thank our friends and colleagues for
their support and feedback throughout this project.

With Regards,

ISHAN SHRESTHA (Exam Roll No. 78802011, T.U. Reg. No. 6-2-788-45-2020)

iv
Table of Contents

Supervisor’s Recommendation.............................................................................................i

LETTER OF APPROVAL...................................................................................................ii

Abstract...............................................................................................................................iii

ACKNOWLEDGEMENT..................................................................................................iv

Table of Contents.................................................................................................................v

List of Abbreviations........................................................................................................viii

List of Figures.....................................................................................................................ix

List of Tables.......................................................................................................................xi

Chapter 1: Introduction........................................................................................................1

1.1 Introduction................................................................................................................1

1.2 Problem Statement.....................................................................................................2

1.3 Objectives...................................................................................................................2

1.4 Scope and Limitations................................................................................................2

1.4.1 Scope...................................................................................................................2

1.4.2 Limitations..........................................................................................................3

1.5 Development Methodology........................................................................................3

1.6 Report Organization...................................................................................................4

Chapter 2: Background Study and Literature Review.........................................................6

2.1 Background Study......................................................................................................6

2.2 Literature Review.......................................................................................................7

v
Chapter 3: System Analysis and Literature Review.............................................................9

3.1 System Analysis.........................................................................................................9

3.1.1 Requirement Analysis.........................................................................................9

3.1.2 Feasibility Analysis...........................................................................................11

3.1.3 Data Modelling: Entity Relationship (ER) Diagram.........................................13

3.1.4 Process Modelling: Data Flow Diagram (DFD)...............................................14

3.2 System Design..........................................................................................................15

3.2.1 Architecture Design...........................................................................................15

3.2.2 Database Schema Design..................................................................................17

3.2.3 Interface Design (User Interface (UI)/User Experience (UX)).........................19

3.2.4. Physical DFD...................................................................................................22

3.3 Algorithm Details.....................................................................................................23

Chapter 4: Implementation and Testing.............................................................................26

4.1 Implementation........................................................................................................26

4.1.1 Tools Used.........................................................................................................26

4.1.2 Implementation Details of Modules..................................................................28

4.2 Testing......................................................................................................................29

4.2.1 Test Cases for Unit Testing...............................................................................29

4.2.2 Test Cases for System Testing...........................................................................36

Chapter 5: Conclusion and Future Recommendation........................................................40

5.1 Conclusion................................................................................................................40

vi
5.2 Learning Outcomes..................................................................................................40

5.3 Future Recommendations.........................................................................................41

Appendices.........................................................................................................................43

Screenshot......................................................................................................................43

References..........................................................................................................................53

vii
List of Abbreviations

HTML: HyperText Markup Language

CSS: Cascading Style Sheet

UI: User Interface

UX: User Experience

KYC: Know Your Customer

CRUD: Create, Read, Update, Delete

ERD: Entity Relationship Diagram

DFD: Data Flow Diagram

GIS: Geographic Information System

DBSCAN: Density Based Spatial Clustering of Applications with Noise

CPU: Central Processing UNIT

GUI: Graphical User Interface

viii
List of Figures
Figure 1.5: Waterfall Model 3
Figure 3.1.1: Use Case Diagram 10
Figure 3.1.3: ER Diagram 13
Figure 3.1.4: DFD Level 0 14
Figure 3.1.4: DFD Level 1 15
Figure 3.2.1: Architecture Design 16
Figure 3.2.2: Database Schema Design part 1 17
Figure 3.2.2: Database Schema Design Part 2 18
Figure 3.2.2: Database Schema Design Part 3 19
Figure 3.2.3: UI Design Login 20
Figure 3.2.3:UI Design Register 20
Figure 3.2.3: UI Design Admin Page 21
Figure 3.2.3: UI Design Profile 21
Figure 3.2.4: Physical DFD User 22
Figure 3.2.4: Physical DFD Admin 23
Figure 16: Login Page43
Figure 17: User Registration Page 43
Figure 18: Forget Password 44
Figure 19: Dashboard 44
Figure 20: Crime List Page 45
Figure 21: Crime Detail page 46
Figure 22: Analysis List 46
Figure 23: Create New Analysis 47
Figure 24: View Analysis 47
Figure 25: Create DBSCAN Config 48
Figure 26: DBSCAN Configuration Lists 48
Figure 27: DBSCAN Result Visualization 49
Figure 28: View/Update Profile, Change password 50
Figure 29: Admin Dashboard 51
Figure 30: Admin User List 52
Figure 31: Admin Crime Report List 52

ix
List of Tables
Table 4.2.1: Test Case for User Registration Module 30
Table 4.2.1: Test Case for User Authentication Module 30
Table 4.2.1: Test Case for Forget Password Module 31
Table 4.2.1: Test Case for Admin Crime Module 32
Table 4.2.1: Test Case for Analysis Module 32
Table 4.2.1: Test Case for DBSCAN Analysis Module 34
Table 4.2.2: System Testing for User Authentication and Registration 36
Table 4.2.2: System Testing for Admin Crime Module 37
Table 4.2.2: System Testing for DBSAN analysis 38

x
Chapter 1: Introduction

1.1 Introduction

Crime is an intentional act that breaks the law, can be prosecuted and punished by the law.
It ranges from minor offenses, like stealing small items, to serious acts, like harming
another person. Minor offenses include actions such as trespassing, vandalism,
shoplifting, threats and so on. These typically results in lighter punishment, community
service and fines. On the other end, serious offenses include assault, robbery, burglary,
murder, rape and so on. Unlike minor offenses, these offences carry severe punishment,
including, life imprisonment, hefty fines and even death penalty. The severity of crime
often determines the intensity level of the legal consequences, aiming to both punish the
offender and deter others from engaging in similar unlawful behavior.

There are many definitions of crime from different perspectives. Edwin H. Sutherland, a
renowned criminologist, defined crime as "a behavior which is prohibited by the state as
an injury to the state and against which the state may react, at least as a last resort, by
punishment" [1].

In recent years, with the advancement in technology and data science, crime data analysis
and visualization have changed the way societies, states, or government respond to, and
prevent crime. It has empowered policymakers, lawmakers, law enforcement agencies,
researchers and other stakeholders to get involved deeper into crime data, extracting
meaningful insights that were previously inaccessible. With analytical tools and
visualization techniques, such as Geographic Information System (GIS), machine
learning algorithms, and interactive dashboards, stakeholders can uncover patterns,
trends, correlations and much more with vast datasets.

Historically, crime analysis primarily relied on manual methods and statistical analysis.
The advent of technology such as big data and computational techniques has increased
the complexity and scope of crime analysis. For example, predictive model algorithms
can forecast crime hotspots based on historical data, enabling efficient and rapid
deployment of resources and interventions. Moreover, machine learning algorithms like
DBSCAN (Density-Based Spatial Clustering of Applications with Noise) and GIS tools,

1
aiding in identification of high-risk hotspots, anomaly detection, pattern recognition and
the evaluation of implemented strategies.

Comparing past and present shows a significant impact of technological advancements. In


the past, crime mapping was limited to static charts and manual pin mapping. Today, real-
time data feeds and dynamic visualization provide instantaneous updates and actionable
intelligence. This evolution not only has accelerated response times, but also facilitated
crime prevention strategies through data-driven insights.

1.2 Problem Statement

In context of Nepal, there are no crime analysis and visualization tools. The problems are
as follows: -

i. Tools like ArcGIS, QGIS, and so on provide features but need technical expert to
use them.
ii. Open-Source software/web applications provide mapping features but do not
provide advanced features like Machine Learning Algorithms.

1.3 Objectives

The objectives of this system are as follows: -

i. To provide comprehensive crime dashboard to the user.


ii. To implement Density Based Spatial Clustering of Applications with Noise
(DBSCAN) algorithm so that user can detect and visualize areas with high crime
density and anomalies.

1.4 Scope and Limitations

1.4.1 Scope

Geo-Crime Mapper, a crime data and analysis and visualization system encompass
several key areas. It aims to empower law enforcement agencies, policy makers, and
community stakeholders by offering tools to analyze crime incidents geographically and
over time. It will enable users to visually identify and map crime hotspots, trends and
patterns. User-friendly design and robust security measures will be prioritized to enhance

2
accessibility and safeguard sensitive information. Continuous refinement based on user
feedback and emerging crime trends will ensure that Geo-Crime Mapper remains a
valuable tool for enhancing public safety and community well-being.

1.4.2 Limitations

There are some criteria that may not be fulfilled by our application. Some of the
limitations of our project are mentioned below:

i. Insights rely on accurate and complete crime data; poor data quality can lead to
misleading conclusions.
ii. Predictive analytics, like DBSCAN, require careful tuning for reliable results.
iii. Sensitive data needs strong protection to maintain trust and legal compliance.
iv. May be less effective in areas with sparse data or inconsistent geospatial
boundaries, impacting the accuracy of spatial analyses.
v. Advanced analytics, especially for large datasets or complex models, require
significant computing power, which may be costly or unavailable in some settings.
vi. Regular updates are essential to keep algorithms, data sources, and security
measures current, which requires ongoing resource investment.

1.5 Development Methodology

The Waterfall model is a linear and sequential approach to software development. It is


simple, easy to use, and often suitable for projects with well-defined requirements. It’s
one of the earliest and simplest methodologies, known for its structured, step-by-step
process.

Design Deployme
Requirements Integration
and Implementation nt and
Gathering and Testing
Analysis Maintaince

Figure 1.5: Waterfall Model

3
The sequential phases in Waterfall model are as follows: -

i. Requirements Gathering: It involves clearly defining the project’s requirements,


including the types of crime data to be visualized, expected GIS features, machine
learning algorithms like DBSCAN for clustering, user roles, and privacy needs.
ii. Design: Develop the architectural and detailed design of the Geo-Crime Mapper
based on gathered requirements.
iii. Implementation: Develop the application by coding each module according to the
design specifications.
iv. Integration and Testing: Integrate all modules and conduct thorough testing to
ensure system functionality and compliance with requirements.
v. Deployment and Maintenance: Deploy the Geo-Crime Mapper to the intended
environment. For example, a secure server for law enforcement use. Adress any
issues, keep the system up to date post-deployment, bug fixes, and user support.

1.6 Report Organization

This document presents the organization of the report for the Geo-Crime Mapper project.
It includes various charts, diagrams, and schemas that illustrate the system's architecture
and design, as well as information on the tools and technologies used in the system’s
development. The report is structured as follows across five chapters:

i. Chapter 1: Introduction: This chapter provides a brief overview of the project,


including the inspiration and purpose behind the Geo-Crime Mapper. It defines the
problem statement, project objectives, scope, limitations, and background study to
contextualize the project.
ii. Chapter 2: This chapter offers a literature review, summarizing relevant papers
and articles reviewed for the project. It also includes a use case diagram to define
the functional requirements, a feasibility study covering the system’s economic,
technical, and operational feasibility, and a Gantt chart outlining the timeline for
various project tasks.
iii. Chapter 3: System Analysis and Design: This chapter provides a detailed analysis
of the system, covering interface design, input/output design, and process design.
It also includes a System Interface Diagram to visually represent the system’s
components and interactions.

4
iv. Chapter 4: Implementation and Testing: This chapter discusses the tools used for
implementing the system and the various types of testing conducted. It also
presents test cases that were developed to verify and validate the system’s
functionality and performance.

v. Chapter 5: Conclusion and Future Recommendation: The final chapter


summarizes the project and highlights key learnings. It also outlines potential
future enhancements to the system, offering recommendations for additional
features and improvements.

5
Chapter 2: Background Study and Literature Review

2.1 Background Study

The Geo-Crime Mapper is an advanced geospatial tool developed to support the


visualization and analysis of crime data, primarily focused on identifying patterns and
crime hotspots across Nepal. By integrating Geographic Information Systems (GIS),
spatial analysis algorithms like DBSCAN (Density-Based Spatial Clustering of
Applications with Noise), and effective data visualization techniques, this tool aims to
identify crime trends, assess risks in particular regions, and strategize on how to best
allocate resources to prevent crime effectively.

GIS plays a central role in the Geo-Crime Mapper by allowing users to visualize data on a
map, revealing spatial relationships and crime patterns that may not be apparent through
tabular data alone. It comprises essential components such as hardware (computers and
servers), software (mapping and analytical tools), data (geographic and tabular
information), methods for processing spatial data, and the people who interact with the
system. In crime analysis, GIS is instrumental in pinpointing locations with high crime
concentrations and observing trends over time, which supports law enforcement agencies
in strategic decision-making and timely interventions.

A critical aspect of Geo-Crime Mapper is its reliance on spatial data (information


representing the physical location and attributes of crime events) and geospatial data
(which links descriptive information to geographic locations). For this project, spatial and
geospatial data include specifics of crime incidents, such as their exact locations, time,
and nature of the crime. By using this data in combination with geographic boundaries
(like districts or regions), analysts can understand where crimes are occurring and assess
patterns that can guide law enforcement’s proactive responses.

Spatial analysis is another cornerstone of the Geo-Crime Mapper, enabling a deeper


exploration of geographic patterns in crime data. By examining spatial distributions,
analysts can identify regions with high crime frequency, which are pivotal in directing
law enforcement efforts to high-risk zones. Techniques such as DBSCAN, and so on are
frequently used to assess and interpret these spatial distributions. DBSCAN, for example,
is particularly effective in crime analysis since it can identify clusters of crime events
6
without pre-specifying the number of clusters and can handle irregularities in data
distribution by recognizing outliers. This makes it ideal for discovering natural groupings
in crime data, even when incidents occur sporadically across an area.

Data privacy is also a crucial concern, as crime-related data often contains sensitive
information about victims and locations; therefore, managing privacy while balancing
accessibility is vital. Additionally, user roles and permissions allow for secure access
control, ensuring that only authorized personnel can access or modify certain information.

Data visualization techniques are another integral part of Geo-Crime Mapper, allowing
stakeholders to interpret complex crime data effectively. Maps and charts are used to
make the data more accessible to users, especially non-technical stakeholders. Maps are
the primary method for viewing spatial distributions, charts and graphs provide insights
into crime trends and patterns over time.

2.2 Literature Review

The literature on crime mapping and analysis provides a strong foundation for developing
tools like Geo-Crime Mapper. As it provides several projects, ideas, and theories
contributing valuable insights. Many studies have demonstrated the effectiveness of
Geographic Information Systems (GIS) in mapping crime and analyzing spatial data,
enabling law enforcement to identify crime patterns and allocating resources effectively.
For instance, one of the projects in crime mapping was the Chicago Crime Mapping
Project, which used GIS to reveal patterns in crime data across the city, leading to
targeted policing efforts. This project underscored the potential of GIS in aiding decision-
making, especially in urban settings where spatial patterns of crime are complex and
varied.

Another tool, CompStat (short for Computer Statistics), was developed in the 1990s by
the New York Police Department (NYPD). CompStat combined GIS with statistical
analysis used to track and manage crime data, creating weekly reports that helped identify
trends and hotspots in near real-time. This approach allowed law enforcement to make
strategic interventions based on data. CompStat’s success popularized the use of spatial
analysis in law enforcement and highlighted the value of timely, accurate crime data in
supporting effective policing [2].

7
On the theoretical side, clustering algorithms have gained attention for their ability to
analyze spatial distributions and detect patterns in crime data. DBSCAN (Density-Based
Spatial Clustering of Applications with Noise), for example, is widely applied in spatial
analysis to identify natural clusters in crime data without requiring pre-set parameters.
DBSCAN's effectiveness in recognizing clusters based on density, rather than distance. It
is particularly valuable for crime analysis, where incidents are often distributed unevenly
across geographic areas. For example, studies applying DBSCAN to urban crime data
have shown how it can effectively group crime events and help visualize where law
enforcement might focus their efforts.

Overall, by leveraging proven techniques such as GIS, clustering algorithms like


DBSCAN, and user-centered data visualization, Geo-Crime Mapper can build on
established methods to support crime analysis and hotspot detection in Nepal.

8
Chapter 3: System Analysis and Literature Review

3.1 System Analysis

System analysis is a process of understanding the requirement, components and


interactions of the system, to ensure it effectively addresses the needs of its user, law
enforcement agencies and other stakeholders.

3.1.1 Requirement Analysis

The requirements are very important for any software before any kind of development. It
is the collection of features that the user wants in the software. There are two types of
requirements. They are functional and non-functional requirements. Both are discussed
below:

9
3.1.1.1 Functional Requirements

Figure 3.1.1: Use Case Diagram

3.1.1.2 Non-Functional Requirements

The non-functional requirements of Geo-Crime Mapper are as follows:

i. Performance Requirements: The system processes large datasets efficiently,


particularly when handling extensive crime data. It provides real-time or near-real-
time responses for map visualizations and clustering results.
ii. Scalability: The system scales horizontally by adding more CPU cores if needed.
iii. Security: It has user authentication and authorization mechanisms to ensure only
authorized personnel can upload, analyze, or view certain types of data.

10
3.1.2 Feasibility Analysis

The feasibility analysis for Geo-Crime Mapper explores various aspects to determine
whether the proposed system can effectively address the needs of stakeholders and be
implemented successfully. This analysis considers technical, operational, economic, and
legal aspects to ensure the solution is viable, sustainable, and compliant with relevant
standards and regulations.

3.1.2.1 Technical Feasibility

Technical feasibility evaluates the technology required to develop and implement the
Geo-Crime Mapper system and whether it is feasible within the available resources and
constraints. The system is technically feasible with the available tools and technologies.
Its performance and scalability will be ensured using optimized geospatial data storage
and visualization techniques. For this feasibility study, we studied complete functionality
to be provided in the system, as described in the System Requirement Specification
(SRS), and checked if everything was possible using different types of front-end and
back-end platform.

3.1.2.2 Operational Feasibility

Operational feasibility assesses whether the proposed system can function effectively
within its intended operational environment, ensuring ease of use for the stakeholders
involved. The system has a graphical user interface (GUI) that is intuitive and easy to use
for both technical and non-technical users. Besides, proper training has been conducted to
related stakeholders.

3.1.2.3 Economic Feasibility

Economic feasibility examines the financial implications of the system, including the
costs associated with its development, deployment, and ongoing maintenance, and the
expected benefits. All the programming languages, tools and resources required are free
and open source. No additional hardware and software required after the completion of
the system. Thus, this system is economically feasible and cost-effective.

11
3.1.2.4 Legal Feasibility

Legal feasibility involves ensuring that the system complies with all relevant legal and
regulatory requirements, especially in terms of data privacy, security, and user rights. We
have ensured that our platform complies with all relevant laws and regulations related to
data privacy and protection, so it is legally feasible.

12
3.1.3 Data Modelling: Entity Relationship (ER) Diagram

Figure 2.1.3: ER Diagram

13
3.1.4 Process Modelling: Data Flow Diagram (DFD)

DFD of Book Geo-Crime Mapper consists of one level DFD and two level DFD. Both
diagrams show how the data flows inside the system

Figure 3.1.4: DFD Level 0

14
Figure 3.1.4: DFD Level 1

3.2 System Design

3.2.1 Architecture Design

Three Tier Architecture design is used to create this system. This system includes a user
interface (Presentation Layer), a web server (Application Layer), and a database (Data
Layer).

15
Figure 3.2.1: Architecture Design

16
3.2.2 Database Schema Design

Figure 3.2.2: Database Schema Design part 1

17
Figure 3.2.2: Database Schema Design Part 2

18
Figure 3.2.2: Database Schema Design Part 3

3.2.3 Interface Design (User Interface (UI)/User Experience (UX))

Interface Design is the design of how this system Geo-Crime Mapper looks like:

19
Figure 3.2.3: UI Design Login

Figure 3.2.3:UI Design Register

20
Figure 3.2.3: UI Design Admin Page

Figure 3.2.3: UI Design Profile

21
3.2.4. Physical DFD

A physical data flow diagram is a visual representation that shows how data flows
between the system components. For this system, the physical data flow diagram is
illustrated below:

Figure 3.2.4: Physical DFD User

22
Figure 3.2.4: Physical DFD Admin

3.3 Algorithm Details

DBSCAN algorithm is used in this system. DBSCAN is a clustering algorithm that


groups data points based on density. It identifies core points in dense regions and expands
clusters from them, effectively handling spatial data with varying densities and
distinguishing between core points, border points, and noise (outliers). Unlike other
clustering algorithms, DBSCAN does not require a predefined number of clusters, an
important feature for crime analysis where cluster counts are not always known in
advance. Instead, DBSCAN identifies clusters based on the density of data points in an

23
area, distinguishing between core points, which form the cluster’s core, border points,
which lie on the cluster edges, and noise, which represent isolated or less relevant points.
This flexibility in cluster formation is advantageous when analyzing crime patterns, as
crime data can vary greatly in density across different regions.

In the Geo-Crime Mapper, DBSCAN serves as a primary tool for identifying crime
“hotspots” by clustering incidents based on spatial proximity and, optionally, temporal
constraints. This clustering reveals patterns of high-crime zones where incidents
frequently occur within a particular radius and time frame. Such insights are valuable for
law enforcement agencies and policymakers, as they can guide resource allocation to
areas of heightened risk. DBSCAN’s relevance to Geo-Crime Mapper lies in its ability to
analyze and visualize crime data effectively, enabling users to detect spatial patterns
without prior assumptions about the number or shape of clusters.

DBSCAN requires two key parameters: Epsilon (ε) and Minimum Points. The Epsilon
parameter defines the maximum radius for searching neighboring points, effectively
setting the spatial reach for cluster formation. In the context of Geo-Crime Mapper,
Epsilon is carefully calibrated to capture crime incidents within a reasonable spatial range
—such as within a neighborhood or city block. Minimum Points is the minimum number
of neighboring points required to consider a point as a core point, ensuring that clusters
form only in areas with sufficient data density. This parameter helps filter out isolated
incidents, which are often less relevant for identifying significant patterns [3].

The pseudocode for this algorithm is as follows:

DBSCAN(D, ε, MinPts)

for each unvisited point p in dataset D

mark p as visited

neighbors = regionQuery(p, ε)

if size(neighbors) < MinPts

mark p as noise

else

24
create new cluster C

expandCluster(C, p, neighbors, ε, MinPts)

expandCluster(C, p, neighbors, ε, MinPts)

add p to cluster C

for each point n in neighbors

if n is not visited

mark n as visited

new_neighbors = regionQuery(n, ε)

if size(new_neighbors) >= MinPts

neighbors = neighbors + new_neighbors

if n is not yet a member of any cluster

add n to cluster C

25
Chapter 4: Implementation and Testing

4.1 Implementation

The tools and techniques used to implement the system and the implementation details of
various modules of Geo-Crime Mapper are as follows:

4.1.1 Tools Used

The tools used in the process of creating this system are as follows:

i. Front-End Tools
a. HyperText Markup Language (HTML)
In Book Review Platform, HTML is used for creating the skeleton of
different web pages and sites. It is used to create sections, headings, links,
paragraphs, image sections and so on.
b. Cascading Style Sheet (CSS)
CSS is used to design different tags and elements of HTML. By using
CSS, we can control the font style, font size, text color, space between
characters, image properties, and so on.
c. JavaScript
In Geo-Crime Mapper, JavaScript is used for making dynamic, interactive,
and responsive web pages.
d. OpenLayers
OpenLayers is a powerful JavaScript library utilized in Geo-Crime Mapper
to provide dynamic and interactive mapping functionalities. It serves as the
backbone for rendering geographic data, enabling users to visualize crime
locations, clusters, and patterns on an intuitive map interface.
e. Chart.js
Chart.js is a lightweight and versatile JavaScript library used in Geo-Crime
Mapper for creating interactive and visually appealing data visualizations.
It plays a key role in presenting crime statistics and analytical results
through various chart types, including bar charts, line charts, pie charts,
and scatter plots.
ii. Back-End Tools
26
a. Python Programming Language
In Geo-Crime Mapper, Python is used as a server-side language. It is a
high level, general-purpose programming language. The Django
framework, built on Python, provides a robust structure for developing the
application’s backend, including models, APIs, and business logic.
Additionally, Python’s GeoDjango module and libraries such as shapely
and geopandas enhance the system’s geospatial processing capabilities.
iii. Server
a. NGINX
In this system, serves as the reverse proxy and web server, handling client
requests and efficiently routing them to the application server. It improves
performance through load balancing, caching, and static file serving. Its
lightweight design and high scalability make it well-suited for the
deployment of this project, ensuring reliable performance under varying
loads.
iv. Database
a. PostgreSQL
PostgreSQL is the database management system used for storing and
managing the system’s structured data. Its robustness, scalability, and
support for advanced features make it ideal for the backend of Geo-Crime
Mapper. To handle geospatial data, PostGIS, an extension of PostgreSQL,
is employed. PostGIS provides spatial types like points, polygons, and
lines, enabling precise storage and querying of geographical data. It also
supports advanced spatial queries, which are crucial for identifying crime
hotspots, filtering data by geographic regions, and performing clustering
analyses. The combination of PostgreSQL and PostGIS ensures that the
application can efficiently handle both relational and spatial data.
v. Documentation Tools
a. Draw.io
It is an online system design tool. It is used to create architectural design,
Entity-Relation Diagram, User Case Designs and so on.
b. Dbdiagram.io
It is an online database schema design tool and is used to create database
schema for Geo-Crime Mapper.
27
c. Figma
It is an online UI/UX design tool to design the Graphical User Interface
(GUI) of this system

4.1.2 Implementation Details of Modules

The Geo-Crime Mapper system is modularized into various components, each serving a
specific functionality. Details of different modules of this system are described below:

a. Admin User Modules


This module allows administrators to manage system users, including creating,
updating, and deleting user accounts. It also facilitates assigning roles and
permissions to users to regulate access to specific functionalities of the
application.
b. Admin Crime Report Modules
Administrators can view, edit, or delete submitted crime reports. This module also
enables filtering and searching reports based on criteria such as location, crime
type, and date, ensuring streamlined management of data
c. Admin Crime Location Modules
This module manages crime locations, allowing administrators to update
geographic data like coordinates, regions, and boundaries. It integrates seamlessly
with the mapping system to ensure accurate visualization of crime hotspots
d. Admin Crime Types Modules

Administrators can define, update, and manage various crime types within the
system. This module ensures a consistent taxonomy for classifying and analyzing
crime data, which is crucial for reports and clustering analyses
e. Admin Crime Types Modules
Administrators can define, update, and manage various crime premises within the
system. This module ensures a consistent taxonomy for classifying and analyzing
crime data, which is crucial for reports and clustering analyses
f. DBSCAN Analysis Module
This specialized module implements the DBSCAN algorithm for clustering spatial
crime data. It identifies crime hotspots and noise, helping administrators and
analysts focus on high-crime areas for actionable insights.

28
g. User DBSCAN Result Visualization Module
The DBSCAN Result Visualization Module is designed to present the outcomes of
the DBSCAN clustering algorithm in an intuitive and interactive format. After the
clustering process, this module maps the identified clusters and noise points onto
the application’s interface, using tools like OpenLayers. Clusters are visualized
with distinct colors and markers, while noise points are highlighted differently for
clarity.
h. User Registration Module
This module facilitates user sign-up, allowing individuals to register their
accounts. Validation processes ensure secure account creation while capturing
essential user details.
i. User Authentication Module
The authentication module manages secure user login and logout. It includes
mechanisms like password encryption and session management, ensuring the
integrity and security of user access.
j. Forget Password Module
This module provides a secure mechanism for users to reset forgotten passwords.
It employs email verification and a secure token generation to protect against
unauthorized access.
k. Crime Dashboard Module
The dashboard module is the central interface for administrators and users,
displaying summarized crime data through interactive charts, maps, and tables. It
provides real-time insights and quick access to key functionalities.

4.2 Testing

Testing refers to the process of evaluating the system or a software application to identify
the bugs, defects, and vulnerabilities to ensure that it meets the specified requirements
and verify it is working correctly. Its primary goal is to ensure the quality and reliability
of the software before it is deployed for production. The testing is carried out over and
over in the development phase.

29
4.2.1 Test Cases for Unit Testing

The unit testing for this system is as follows:


i. Test Case of User Registration Modules
Table 4.2.1: Test Case for User Registration Module

S.N. Test Name Test Test Steps


Expected Actual Status
Description Result Result
1 User Test user 1. Open The user As Pass
Registration registration the account is expected,
with valid registration successfully user
inputs. page. created, and account
2. Enter the user is was
valid redirected successfully
details to the login created, and
(username, page user was
email, redirected
password, to login
etc.). page
3. Click
"Register".
2 User Test user 1. Open Appropriate Error Pass
Registration registration the error messages
Module with registration messages were
invalid page. are displayed
inputs. 2. Enter displayed, correctly.
invalid and
details registration
(e.g., does not
invalid proceed.
email
format or
weak
password).
3. Click
"Register".

ii. Test Case for User Authentication Module


Table 4.2.1: Test Case for User Authentication Module

S.N. Test Name Test Test Steps Expected Actual Status


Description Result Result
1 User Test login 1. Open User is User was Pass
Authenticatio with valid the login successfully logged in
n Module credentials. page. logged in successfully
2. Enter and , receiving
valid redirected success
username to the message

30
and dashboard. and was
password. redirected to
3. Click the
"Login". dashboard
2 User is 1. Open Error The error Pass
successfully Test login the login message message
logged in and with page. "Login "Logn
redirected to 2. Enter Failed" is Failed" was
the dashboard. invalid invalid displayed, displayed,
credentials. username and login is and login
or prevented. was
password. prevented.
3. Click
"Login"

iii. Test Case for Forget Password Module


Table 4.2.1: Test Case for Forget Password Module

S.N. Test Test Test Steps Expected Actual Status


Name Description Result Result
1 Forget Test Password Password Pass
Password password 1. Open the reset link reset link
Module reset with a "Forget is sent to was
valid the successfully
email. Password" provided sent to the
page. email. provided
email.

2. Enter a
registered
email.

3. Submit
the form.
4. Check
the email
inbox for
the reset
link.
2 Forget Test Error The error Pass
Password password 1. Open the message " message "
Module reset with "Forget An An account
an invalid account with this
email. Password" with this email does
page. email not exist"
does not was
exist" is displayed,
31
displayed, and no reset
2. Enter an and no link was
unregistered reset link sent
is sent.
email.
3. Submit
the form.

iv. Test Case for Admin Crime Module


Table 4.2.1: Test Case for Admin Crime Module

S.N. Test Test Test Steps Expected Actual Status


Name Description Result Result
1 Admin Test adding 1. Log in The new The new Pass
Crime a new as an crime crime
Report crime admin. report is report was
Module report. 2. Open successfully successfully
the "Add added and added and
Crime visible in was visible
Report" the report’s in the
page. list. report’s list.
3. Fill in
the details.
4. Click
"Submit".
2 Admin Test editing 1. Log in The report The report Pass
Crime an existing as an is updated was
Report crime admin. with the updated
Module report. 2. Open new details. with the
the "Edit new details.
Crime
Report"
page for a
specific
report.
3. Modify
details.
4. Click
"Save".
3 Admin Test adding 1. Log in The The Pass
Crime crime as an location is location
Location location admin. successfully was
Module with valid 2. Open added and successfully
coordinates the "Add visible on added and
. Crime the map. visible on
Location" the map.
page.
3. Enter

32
valid
coordinates
and details.
4. Click
"Submit".

v. Test Case for Analysis Module


Table 4.2.1: Test Case for Analysis Module

S.N. Test Test Test Steps Expected Actual Status


Name Description Result Result
1 Admin Test adding 1. Log in The new The new Pass
Crime a new as an crime crime
Report crime admin. report is report was
Module report. 2. Open successfully successfully
the "Add added and added and
Crime visible in was visible
Report" the report’s in the
page. list. report’s list.
3. Fill in
the details.
4. Click
"Submit".
2 Admin Test editing 1. Log in The report The report Pass
Crime an existing as an is updated was
Report crime admin. with the updated
Module report. 2. Open new details. with the
the "Edit new details.
Crime
Report"
page for a
specific
report.
3. Modify
details.
4. Click
"Save".
3 Admin Test adding 1. Log in The The Pass
Crime crime as an location is location
Location location admin. successfully was
Module with valid 2. Open added and successfully
coordinates the "Add visible on added and
. Crime the map. visible on
Location" the map.
page.
3. Enter
valid
coordinates
and details.

33
4. Click
"Submit".
4 Create Test Analysis is Analysis Pass
Analysis creating an 1. Open created was created
analysis analysis with the with the
section correction correction
page. location location
2. Add area. area.
details,
select
analysis
type, and
draw a
location
area to
perform
analysis

vi. Test Case for DBSCAN Analysis Module


Table 4.2.1: Test Case for DBSCAN Analysis Module

S.N Test Name Test Test Expected Actual Statu


. Description Steps Result Result s

1 DBSCAN Create 1. Go to DBSCAN DBSCAN


Configuration DBSCAN analysis config is config is
s configuratio and created and created and
n needed for create visible visible
running DBSCA inside the inside the
DBSCAN N analysis. analysis.
analysis analysis.

2. Add
radius
and
minimum
samples.

3. Click
on Save.

34
2 Run DBSCAN Run a 1. Go to Message Message Pass
analysis DBSCAN analysis, “Task “Task
analysis select an Started” is Started” was
analysis, displayed, displayed,
then and “Task and “Task
select a Completed” Completed”
DBSCA after some after some
N config. time. time.

2. Hit the
Play icon

3 DBSCAN Test 1. Open Clusters and Clusters and Pass


Result clustering the noise points noise points
Visualization visualization DBSCA are were
for a valid N displayed displayed
dataset. analysis correctly on correctly on
page. the map the map
2. Run with distinct with distinct
clustering markers and markers and
analysis. colors. colors.
3. View
the
results on
the map.

4 DBSCAN Test 1. Open Message Message Pass


Result clustering the "No Result "No Result
Visualization visualization DBSCA Found" is Found" was
for empty N displayed, displayed,
result analysis and no and no
page. visualizatio visualizatio
n is n was
2. View
generated. generated.
the
35
results
without
running
it.

5 DBSCAN Test 1. Open Just a base Just a base Pass


Result clustering the layer map is layer map is
Visualization visualization DBSCA displayed. displayed.
for an empty N
dataset. analysis
page.
2. Run
clustering
analysis
on an
empty
dataset.
3. View
the
results.

4.2.2 Test Cases for System Testing

The unit testing for this system is as follows:


i. System Testing for User Authentication and Registration
Table 4.2.2: System Testing for User Authentication and Registration

S.N. Test Name Test Test Steps Expected Actual Status


Description Result Result
1 User Test the 1. Open User User was Pass
Registration & complete the successfully successfully
Authenticatio user registration registers registered
n registration page. and logs in, and logged
and login 2. Enter redirected in after
workflow. valid to the login with
details dashboard. credentials

36
(username, and was
email, redirected
password, to
etc.). dashboard
3. Register.
4. Log in
with the
same
credentials.
2 User Test the 1. Open Error The error Pass
Registration & behavior the message message
Authenticatio when the registration "Email "Email
n user tries to page. already already
register 2. Enter a exists" is exists" was
with an registered shown, and displayed,
existing email and registration and
email. valid does not registration
details. proceed. was
3. Click cancelled.
"Register".
3 Forget Test 1. Open A reset link A reset link Pass
Password password the "Forget is sent to was sent to
Module recovery Password" the email, the email,
for a page. and the user and the user
registered 2. Enter a can log in logged in
user. valid with the with the
email. new new
3. Reset password. password.
the
password
and log in
with the
new
credentials.

ii. System Testing for Admin Crime Module


Table 4.2.2: System Testing for Admin Crime Module

S.N. Test Test Test Steps Expected Actual Status


Name Descriptio Result Result
n
1 Admin Test adding 1. Log in as The crime The crime Pass
Crime and editing admin. report is report was
Report crime 2. Add a added added
Module reports new crime successfully successfully,
from the report with , then then was
admin valid updated updated
panel. details. with the with the
3. Edit the correct correct

37
report. changes and changes and
4. Save the visible in was visible
changes. the report in the report
list. list.
2 Admin Test adding 1. Log in as The crime Pass
Crime and editing admin. The crime location was
Location crime 2. Add a location is added
Module locations crime successfully,
from the location added then
admin with valid successfully updated
panel. coordinates. with the
3. Edit the , then correct
location. updated changes and
4. Save the was visible
changes. with the on the map.
correct
changes and
visible on
the map.

iii. System Testing for DBSCAN analysis


Table 4.2.21: System Testing for DBSAN analysis

S.N. Test Name Test Test Steps Expected Actual Status


Description Result Result

1 DBSCAN Test 1. Upload The The Pass


Analysis DBSCAN crime data clustering clustering
Module clustering with time process process was
with spatial and completes completed
data and location without without
time factor. details. errors, errors,
2. Run clusters are clusters
DBSCAN formed, and were
clustering. results are formed, and
3. Visualize visualized results were
the results on the map. visualized
on the map. on the map.

38
2 DBSCAN Test the 1. Run Clusters are Clusters Pass
Result proper DBSCAN displayed were
Visualization visualization clustering. with distinct displayed
of 2. View the markers, with distinct
DBSCAN clusters on markers
results with the map. colors
crime 3. Hover
clusters. over
clusters for
details.
4. Zoom
in/out.

3 Crime Detail Test the 1. Open the The map The map Pass
Map functionality crime zooms and zooms and
of the crime detail. pans pans
detail’s map 2. Zoom smoothly smoothly
view and in/out on while while
interactivity. the map. displaying displaying
3. View accurate accurate
crime data crime data crime data
point. point. point.

39
Chapter 5: Conclusion and Future Recommendation

5.1 Conclusion

The Geo-Crime Mapper project successfully integrates advanced geographic information


system (GIS) capabilities with crime data analysis to provide a comprehensive tool for
crime reporting and spatial analysis. The system effectively combines crime report
management, location tracking, and spatial clustering using DBSCAN to detect patterns
in crime distribution. With a user-friendly interface, it allows both regular users and
administrators to interact with the data seamlessly, from viewing crime data on the map to
performing advanced spatial analysis. The system’s implementation of PostGIS for spatial
data management and integration with NGINX for optimized performance demonstrates a
scalable and efficient architecture capable of handling both large and small-scale datasets.
The crime report dashboard, crime location management, and DBSCAN results
visualization all contribute to a more detailed understanding of crime patterns, which can
be vital for law enforcement and policymakers in making data-driven decisions. The
application was built using modern technologies such as Python, Django, PostgreSQL,
and PostGIS, ensuring robustness and scalability. Additionally, integration with
OpenLayers and Chart.js for visualization makes the system both functional and visually
appealing.

5.2 Learning Outcomes

The development and implementation of the Geo-Crime Mapper system provided several
valuable lessons, experience, achievement and insights across various aspects of software
development, system design and geospatial analysis. One of the most significant learning
experiences was understanding and working with geospatial data. We learned how to
efficiently store, query, and manipulate spatial data such as crime locations using
geographic coordinates and other geometry types, which is a challenging but essential
aspect of any GIS-based application. Open Layers played a key role in visualizing this
data on interactive maps, which required careful integration to ensure smooth rendering
and dynamic updates.

40
Another key takeaway from the project was the implementation of DBSCAN for spatial
clustering. DBSCAN is a powerful algorithm for identifying clusters in spatial data,
especially when dealing with noise.

A critical aspect of the project was user experience design. The system was designed to be
accessible to both technical and non-technical users, which required a careful balance
between functionality and ease of use. The integration of frameworks like TailwindCSS
for responsive design and Chart.js for visualizing crime data trends allowed us to create a
clean and intuitive interface. This experience highlighted the importance of UX/UI design
in ensuring that users can interact with complex systems in an intuitive and engaging
manner, without needing deep technical knowledge.

Overall, the Geo-Crime Mapper project not only deepened our technical expertise in areas
such as geospatial analysis and system design but also provided valuable lessons in user-
centered development, security practices, and system scalability.

5.3 Future Recommendations

In future, we recommend expanding the Geo-Crime Mapper by adding several


enhancements and features to improve its capabilities and extend its scope:

i. Expand User Roles and Permissions


Adding more user roles with varied levels of permissions could help extend the
system's applicability. For example, allowing different types of law enforcement
personnel to access different layers of data could improve collaboration and
decision-making
ii. Advanced Analytical Features
Future versions of the system could incorporate additional clustering algorithms
like K-means or hierarchical clustering to compare results with DBSCAN.
Additionally, advanced analytics such as predictive crime modeling could be
implemented to forecast crime hotspots based on historical data.
iii. Machine Learning and AI Integrations
Introducing machine learning models to analyze crime patterns and predict future
crime trends could take the system to the next level. By leveraging techniques like

41
decision trees, neural networks, or reinforcement learning, the system could
provide actionable insights for crime prevention.
iv. User Customization
Allowing users to customize the dashboard with their preferred crime categories,
time ranges, and display options could improve the overall user experience.
Personalizing the interface would make it easier for users to focus on the data that
matters most to them.

42
Appendices

Screenshot

Figure 3: Login Page

Figure 4: User Registration Page

43
Figure 5: Forget Password

Figure 6: Dashboard

44
Figure 7: Crime List Page

45
Figure 8: Crime Detail page

Figure 9: Analysis List

46
Figure 10: Create New Analysis

Figure 11: View Analysis

47
Figure 12: Create DBSCAN Config

Figure 13: DBSCAN Configuration Lists

48
Figure 14: DBSCAN Result Visualization

49
Figure 15: View/Update Profile, Change password

50
Figure 16: Admin Dashboard

51
Figure 17: Admin User List

Figure 18: Admin Crime Report List

52
References

[1] H. E. Sutherland and R. D. Cressey, Criminology, New York: J.B. Lippincott


Company, 1978.

[2] D. E. Amiri, "IMPLEMENTATION OF COMPSTAT IN POLICE


ORGANIZATIONS," The Journal of International Social Research, vol. 7, no. 35, p.
779.

[3] D. Dingsheng, "DBSCAN Clustering Algorithm Based on Density," in 7th


International Forum on Electrical Engineering and Automation (IFEEA), 2020.

[4] Django Software Foundation, "Django Software Documentation," Django


Foundation, 1 06 2024. [Online]. Available: https://docs.djangoproject.com/en/5.1/.
[Accessed 2 6 2024].

53

You might also like