Commit ae67c4e7 authored by LML's avatar LML
Browse files

Added following files: cameras positions (kml,csv and geojson), street...

Added following files: cameras positions (kml,csv and geojson), street coordinates (csv, geojson), background for Paris map and first script that plots cameras on the map
parent 808a0510
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
# Libraries
import csv
import matplotlib.pyplot as plt
# Variables
pathOfCameraFile = "/Users/lml/Documents/lqdn/mappingetalgoantisurveillance/2018-11-15-export-cameras-pvpp.kml.csv"
pathOfMapBackground = "parisMap.png"
cameraPositions = [] # List is of the form [latitude,longitude]
allLongitudes = []
allLatitudes = []
maxLatitude = 0
minLatitude = 10000000
maxLongitude = 0
minLongitude = 10000000
eliminateFirstRow = 1 # Deal (poorly) with the header
# Begin
with open(pathOfCameraFile) as openedCsvFile:
readedFile = csv.reader(openedCsvFile,delimiter=';')
for row in readedFile:
if eliminateFirstRow == 0:
longitude = float(row[-3])
latitude = float(row[-2])
minLatitude = min(latitude,minLatitude)
maxLatitude = max(latitude,maxLatitude)
minLongitude = min(longitude,minLongitude)
maxLongitude = max(longitude,maxLongitude)
eliminateFirstRow = 0
boundingBox = (minLongitude,maxLongitude,minLatitude,maxLatitude)
print (boundingBox)
# plot the cameras
fig, ax = plt.subplots()
ax.scatter(allLongitudes, allLatitudes, color='red',s=0.8, marker = r'$\bullet$')
imgBackground = plt.imread(pathOfMapBackground)
ax.imshow(imgBackground, extent=[minLongitude,maxLongitude , minLatitude, maxLatitude])
# show the map
resolution_value = 1200
plt.savefig("myImage.png", format="png", dpi=resolution_value)
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment