A Venice counting tile

Counting all the ships in Venice

Well for a project, I tried to find the number of ships in Venice, of which most do not seem to transmit AIS.

I couldn’t find an answer.

One way would be to use the Italian Freedom of Information Act as boats in Venice need to registered.

I decided to us an Google API key and download 1200 overlapping images that were stitched together with Microsoft ICE (Image Composite Editor). A rectangle around historic Venice was chosen and off we went.


library(ggplot2)
library(ggmap)
require("maps")
for(i in 0:40) {
  for (j in 0:30) {
    mylon = 12.31 + (i * 0.0015) # start longitude+ step size
    mylat = 45.45 - (j * 0.001)  # start latitude + step size
    # possibility to add normal random delay to throw off Google Robot blocker (Abs prevents the odd negative number)
    mytime = abs(rnorm(1, mean = 2 , sd = 1))
    # generate a filename
    outfile = (paste(sprintf("%02d", i), sprintf("%02d", j), "venice.png", sep =
 "-"))
    myfilename = paste("X:/afolder/venice/shipcount/", outfile, sep =
 "")
 #if there is no file already go generate a map tile
 if (!file_test("-f", myfilename)) {
    mapgilbert <-
    get_map(
    location = c(lon = mylon, lat = mylat),
    source = "google",
    zoom = 19,
    maptype = "satellite",
    scale = 1
  )
  #rite map
  png(filename = myfilename)
  print(
  ggmap(mapgilbert, extent = "device") + geom_point(
  aes(x = as.numeric(lon), y = as.numeric(lat)),
  colour = "red",
  alpha = 1,
  size = 4,
  data = df
  ) + geom_text(
  data = df,
  aes(
  x = as.numeric(lon),
  y = as.numeric(lat),
  label = as.character(NAME)
  ),
  size = 4,
  vjust = 0,
  hjust = -0.1
  )
  )
  # just a sanity delay
  Sys.sleep(1)
  #close the device
  dev.off()
  #sleep for a random period determined above
  Sys.sleep(mytime)
  # some info for us
  print(paste(mytime, mylon, mylat, myfilename, sep = " "))
  } else {
  # some info for us
  print(paste(":)", mylon, mylat, myfilename, sep = " "))
 }
 }
}

After stitching the tiles  in ICE  the following picture was generated.  The original image measured Original 17082×12314 pixels to retain useful details.

Stitched Venice (downsized) Original 17082x12314 pixel
Stitched Venice (downsized) Image courtsey of the Google static Image API
Original 17082×12314 pixels

The stitched image was then smooth tiled (no overlap) with ImageMagick under Ubuntu into 121 images.
convert -crop 10%x10% 00-00-venice_stitch.jpg venice.jpg

A Venice counting tile
A Venice counting tile Image courtsey of the Google static Image API

After several counting software (for example  Interactive counting by Oxfords VGG) either crashed or generated weak regressions, wetware (human intelligence) was used to get to a result quickly.

I used Inkscape and drew a shape over every boat I saw in every tiled picture. At the end clicking the arrow and Ctrl A gives you a total of all shapes. Subtract one for the loaded image and you have a boat count.

All tiles were added in an Openoffice Spread sheet.
The number of boats in main historic Venice at that particular Google Satellite overpass was 5071. But not all boats drive the same amount.

The following article
Turning Traffic Around:
An Analysis of Boat Traffic in Venice and its
Environmental Impacts
states:

“One striking example is the gondola class which accounts for 4% of the total traffic population but contributes 0% to overall noise. This difference is accounted for by the turismo boats which output 43% of the overall volume while making up only 40% of overall traffic”

So I tried to figure out the number of water taxis, water buses (Vaporetto) and ferry types.

Tourism related boats in Venice
Tourism related boats in Venice Image courtsey of the Google static Image API

I counted 107 Vaporetti of the type above, 33 Ferry types and as best guess 230 Water taxis that were visible and of the described type. There might be others, so I went only for the easy to identify ones.  I assumed that tourism type vehicles would amass around the Piazza San Marco. This is obviously a more subjective count.

I did not count Gondolas and what are intermediate sized vehicles as the person interested in this data only wants to target diesel engined boats of a certain size.

Venice image Tile numberboatsbusesferry typetaxis
00000
12001
246005
34100
41001
52000
62101
71001
81100
91000
100200
110000
1260001
13249006
14174006
15137205
163200
170000
180100
190000
205101
210000
2247414
2379104
2456304
25100003
26135013
2728005
280000
290000
300000
311000
320000
330000
34938013
3569105
3657001
3757106
38602012
3978101
4038201
412101
423000
430000
4417000
451060020
4672004
47119206
48583012
4972005
5053100
5120003
5225003
532001
540000
5512100
56187002
57110105
58410012
591011017
6099718
6165590
62175000
63132003
64118000
650000
664000
6714200
6871211
69127308
70504013
7185300
725121
737400
742491531
7592000
760000
77159200
78124002
7944202
809301
815012
8228021
832001
842000
8559000
8699020
870300
8826000
8921020
90166420
91410230
926001
931100
942010
952000
968013
9713010
980000
990000
1000000
1010000
1020000
1031001
1040000
1050000
1064000
1071000
1080000
1090000
1100000
1110000
1120000
1130000
1140000
1150000
1160000
1170000
1180000
1190000
1200000
507110733230

Most ships are in tile 91. 410 where the Cantiere Nautico Tagliapietra S.R.L. is.

Venice Tile 91 Image courtesy im Google Static Image API.
Venice Tile 91
Image courtesy of  Google Static Image API.