Slide 1

Slide 1 text

Stefano Bovio Simone Giannecchini GeoSolutions Developing with MapStore; creating a custom dashboard to map crime data

Slide 2

Slide 2 text

GeoSolutions ● Offices in Italy & US, Worldwide clients ● 30+ collaborators, 25+ Engineers ● Our products ● Our Offer Enterprise Support Services Deployment Subscription Professional Training Customized Solutions GeoNode

Slide 3

Slide 3 text

Affiliations We strongly support Open Source, it Is in our core We actively participate in OGC working groups and get funded to advance new open standards We support standards critical to GEOINT

Slide 4

Slide 4 text

Design Process

Slide 5

Slide 5 text

• Crime Location Data • Point geometry • Type property • Date property • Visualization in a Web Application • Map visualization • Charts and table visualizations • Possibility to count and filter data based on type/date/precinct Initial Requirements

Slide 6

Slide 6 text

• Interaction with GeoServer OGC Services • WFS + SQL Views -> GeoJSON layer • WPS -> Chart/Table data • WMS -> Background layer Initial Test and Experimentations

Slide 7

Slide 7 text

• MapStore Framework • Map component (OpenLayers, Leaflet and Cesium) • Configurable plugins container architecture User Interface https://github.com/geosolutions-it/mapstore-covid-us

Slide 8

Slide 8 text

User Interface Design

Slide 9

Slide 9 text

User Interface Design

Slide 10

Slide 10 text

• Docker Setup • PostgreSQL/PostGIS -> Database • GeoServer -> Spatial data provider • MapStore -> Single page web application Infrastructure

Slide 11

Slide 11 text

Data Preparation

Slide 12

Slide 12 text

• Event • it has an identifier • it is categorized by different types • it has a date time information • it is associated with a region with identifier (eg. precinct) • it is a point geometry • Region • it has an identifier • it is a polygon geometry • it could be included in an higher administrative level • it could be associated with a population count Event and Region Data

Slide 13

Slide 13 text

• Access to an Open Data Portal (eg. NYC) • Search a dataset (eg. NYPD-Complaint-Data-Historic) • Filter data by categories and time range • Finally export as CSV Download Event Data

Slide 14

Slide 14 text

• Access to an Open Data Portal (eg. NYC) • Search a region dataset (eg. Police-Precincts) • Download as format that support spatial data Download Region Data

Slide 15

Slide 15 text

• Create an SQL Script • Rename columns to normalize properties • Conversion of latitude and longitude to point geometry • Include new month properties generated from date formatted as YYYYMM to events • Include missing properties (eg. population) • Setup events-tracker docker compose • Add the new script in the sql/ folder • Edit docker-compose.yml and add a new sql entry to the postgres volumes Data Conversion

Slide 16

Slide 16 text

Final Event Table

Slide 17

Slide 17 text

Final Region Table

Slide 18

Slide 18 text

Layers Configuration

Slide 19

Slide 19 text

• Initial Datastore Layers • event • region • Generated SQL Views Layers • extended events with region group name and population • extended regions with events count • hexagon cluster with events count • square cluster with events count • point cluster with events count Generated Layers

Slide 20

Slide 20 text

• Generated New Layers Based on Event and Regions Table with SQL Statements via GeoServer SQL View Layers

Slide 21

Slide 21 text

• Generated New Layers Based on Event Table with SQL Statements via GeoServer SQL View Layers

Slide 22

Slide 22 text

MapStore Events Tracker Application

Slide 23

Slide 23 text

mapstore-events-tracker is a MapStore downstream project that: • has been implemented on top of @mapstore/project experimental package • uses the frontend framework only • adds custom plugin for the specific use case • publishes custom bundles via npm package MapStore Events Tracker

Slide 24

Slide 24 text

• Initialize a new client project template with npx mapstore-events-tracker create ./my-project • The script provides • Static assets such as css, js files, images, … • Configurations files • localConfig.json • map.json • viewerConfig.json • Translations files Client Configurations

Slide 25

Slide 25 text

• localConfig.json • generic configuration properties (locales, translations paths, …) • plugins components enabled in the viewer • map.json • background layers • map center, zoom, … • viewerConfig.json • endpoints and layers for charts, tables, … • map visualizations types • normalizer options Client Configurations

Slide 26

Slide 26 text

UI Components

Slide 27

Slide 27 text

Map View

Slide 28

Slide 28 text

Map Visualization Selector

Slide 29

Slide 29 text

Map Visualization Selector

Slide 30

Slide 30 text

Counter

Slide 31

Slide 31 text

Counter and Type Filter

Slide 32

Slide 32 text

Normalizer

Slide 33

Slide 33 text

Main Line Chart

Slide 34

Slide 34 text

Time Range Filter

Slide 35

Slide 35 text

Regions Table

Slide 36

Slide 36 text

Regions Detail View

Slide 37

Slide 37 text

• How to Start the Demo • Clone https://github.com/geosolutions-it/events-tracker • Install docker, docker-compose, node and npm • Run ./start.sh command • Open the browser at http://localhost:8888/ • Sample Crime Data • New York -> https://data.cityofnewyork.us/ • Denver -> https://www.denvergov.org/opendata Demo

Slide 38

Slide 38 text

What's Next

Slide 39

Slide 39 text

• Extend visualizations types including 3D views • Improve request of vector data • Experiment with different layer types • Improve components UX (eg. include time range filter in the main chart) Further Improvements Proposals

Slide 40

Slide 40 text