Pavia – Wiki Loves Monuments

Wiki Loves Monuments è un concorso fotografico che punta a valorizzare il patrimonio culturale italiano presente su Wikipedia. Viene organizzato dal 2009 in molti Stati, ma in Italia sarà possibile partecipare soltanto a partire da questa edizione. Questo a causa di problemi legati alla interpretazione giuridica del Codice Urbani (Dlgs. 42/2004) che appare a molti come un ostacolo alla libertà di panorama, alla liberta, cioè, di pubblicare liberamente, fotografie contenenti monumenti di proprietà di un Ente Pubblico.

Per superare il problema, limitatamente alla città di Pavia, ho deciso di agire e di prendere contatti con l’amministrazione del Comune, e dopo alcuni incontri, siamo riusciti ad arrivare a questo traguardo, la rinuncia da parte dell’amministrazione, dei presunti diritti garantiti dal Decreto Urbani, con la conseguente possibilità di scattare fotografie con licenze libere, quali la Creative Commons CC0 o la CC-BY-SA.

Qui sotto il testo della delibera e la mappa dei 21 monumenti liberati.
Continue reading

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Converting an Excel file with point coordinates from Gauss-Boaga to WGS84 and to KML file format

Let’s say we have a file like the following, coming from a local mapping agency. It is a Microsoft Excel/LibreOffice where we have two columns for the X and Y coordinates represented in the Gauss-Boaga coordinate system, plus several informational columns containing non-geographic data.

Here an hypotetical tabular data file:

POSXPOSYheighttype
1722813.0005102614.0004.0Lanterne
1722818.0005102572.0003.5Lanterne
1722825.2765102541.0783.5Sfere
1722838.0005102546.0003.5Sfere
1722851.8485102550.5243.5Sfere
1722814.7475102522.7394.0Sfere
1722809.2415102501.7894.0Sfere

We need to convert it to KML in order to visualize the data in Google Earth. Google Earth makes use of the WGS84 coordinate system, so we are going to use the excellent OGR/GDAL command line software both for the coordinate conversion process (Gauss-Boaga –> WGS84) and the data format conversion (CSV –> KML).

It is a multi step process:

  • Write the supporting files
    • Create a CSV out of the spreadsheet
    • Create the data access VRT file
    • Create the  Gauss-Boaga rototranslation file
  • Converting the files
    • from CSV to SHP (still Gauss-Boaga)
    • from  SHP Gauss-Boaga to SHP WGS84
    • from SHP (WGS84) to KML

Let’s start: we need to prepare some support files to help us convert the data. First of all we need to export the data from the spreadsheet software to a Comma Separated Values (CSV) file. Which will look like this:

POSX,POSY,height,type
1722813.000,5102614.000,4.0,Lanterne
1722818.000,5102572.000,3.5,Lanterne
1722825.276,5102541.078,3.5,Sfere
1722838.000,5102546.000,3.5,Sfere
1722851.848,5102550.524,3.5,Sfere
1722814.747,5102522.739,4.0,Sfere
1722809.241,5102501.789,4.0,Sfere

OGR supports a virtual format which allows specification via an XML file. If you convert your worksheet into a CSV, you can generate a VRT file to instruct GDAL on how to access the data. I’ve created my VRT file like the following, and saved it on the disk as example.vrt:

<OGRVRTDataSource>
    <OGRVRTLayer name="example">
        <SrcDataSource>/home/simone/Desktop/test_data/example.csv</SrcDataSource>
        <GeometryType>wkbPoint</GeometryType>
        <LayerSRS>WGS84</LayerSRS>
        <GeometryField encoding="PointFromColumns" x="POSX" y="POSY"/>
    </OGRVRTLayer>
</OGRVRTDataSource>

This line in example.vrtis the important one:

<GeometryField encoding="PointFromColumns" x="POSX" y="POSY"/>

it tells GDAL which culumn is what. Which column is the east-west and north-south coordinate. We are now ready to generate a SHP, still in Gauss-Boaga coordinates.

ogr2ogr -f "ESRI Shapefile" example.shp example.vrt

Now we can convert example.shp to WGS84, using this PROJ file (gauss-boaga.prj):

PROJCS["Monte Mario / Italy zone 1",
GEOGCS["Monte Mario",DATUM["Monte_Mario",
SPHEROID["International 1924",6378388,297,AUTHORITY["EPSG","7022"]],
TOWGS84[-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68],
AUTHORITY["EPSG","6265"]],
PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],
UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4265"]],
UNIT["metre",1,AUTHORITY["EPSG","9001"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",9],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",1500000],
PARAMETER["false_northing",0],
AUTHORITY["EPSG","3003"],
AXIS["X",EAST],AXIS["Y",NORTH]
]

and by executing the following code:

ogr2ogr -s_srs gauss-boaga.prj -t_srs EPSG:4326 example_wgs84.shp example.shp

We are ready for the final step: convert the SHP file to KML:

ogr2ogr -f "KML" wgs84_GE.kml wgs84_example.shp

wgs84_GE.kml is our final output file.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

mapping illegal horse tracks with OpenStreetMap

One of the most interesting things about OSM is the fact that it allows you to “map the reality”, map the ground-truth, not what the State-run maps tells you it’s there, but what is actually there.

Recently, on 10. January, an illegal horse racing, in a sort of clandestine racetrack was blocked by the military police in Pachino, Syracuse (Sicily, Italy). The blitz has, so far, allowed to identify more than 20 horse owners, jockeys and 3 veterinarians. The land placed in the open countryside, less than 2km from the sea, where the race was stopped, was a clandestine race-course, complete with boxes for the horses.

Just after discovering the news, I went hunting for that track on aerial images. We have been lucky enough to have been granted access to some 25cm resolution images, these images were made by the Regione Sicilia, after some more research I ended up discovering that the racetrack is located in Contrada Granelli, and not nearby the inhabited part of the Pachino town, so in the end, I was able to find it on the map, and tag it accordingly.

<way id=”49641876″>
<tag k=”clandestine” v=”yes”/>
<tag k=”leisure” v=”track”/>
<tag k=”name” v=”Granelli”/>
<tag k=”sport” v=”horse_racing”/>
</way>

Here is the result:

loading map - please wait...

horse track: 36.707651, 15.022774

Surely this is not as important as what my friend Mikel is doing in Kibera, but still a declaration of indipendence from the canonical mapmakers.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

L’unità di tutte le scienze è trovata nella geografia

L’unità di tutte le scienze è trovata nella geografia. Il significato della geografia è che essa presenta la terra come la sede duratura delle occupazioni dell’uomo. (John Dewey)

Alle elementari avevo un maestro che insegnava geografia e che tirava giù una carta geografica del mondo davanti alla lavagna. Avevo un compagno di classe al sesto anno che un giorno ha alzato la mano e ha indicato la costa orientale del Sudamerica; poi ha indicato la costa occidentale dell’Africa e ha chiesto: «Sono state mai unite?». E il maestro ha risposto: «Certo che no, è una cosa ridicola!». Lo studente cominciò a fare uso di droghe e sparì. L’insegnante è diventato consigliere scientifico dell’attuale amministrazione (ndr Bush). (dal film documentario statunitense del 2006 “Una scomoda verità”, diretto da Davis Guggenheim).

Nella mia geografia ancora sta scritto che tra Catanzaro e il mare si trovano i Giardini delle Esperidi. (George Robert Gissing, da Sulle rive dello Jonio).

L’arma del giornalista è la penna o la macchina da scrivere. L’arma del giornalista sotto vetro smerigliato è la bacchetta o la carta geografica. (Sergio Saviane).

Lungo la costa dell’Africa del Sud-Ovest, delimitato da montagne di origine vulcanica da una parte e dall’Atlantico dall’altra, si stende uno dei più antichi e selvaggi deserti della terra. I geografi chiamano questa zona la Costa degli Scheletri, perché le sue spiagge sono disseminate dei relitti delle navi che vi hanno fatto naufragi. (Ronald Schiller da “Nel mondo dei diamanti”).


Insieme a:

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

OpenStreetMap Haiti Statistics

For a poster I’m working on for the Geomatics for Crisis Management conference, I did run some simple stats on the Haiti Planet extracts. After the recent Earthquake, and after the donation of free/libre aerial imagery there has been an increase in user contributions.

These are the total number of users in the Haiti planet extract as of today (the 29th), and dating back to the 14th. For comparison purpose I’ve added the data for 30th dec 2009. It can clearly be seen that the biggest spike was on 16th, reason being on the 15th the first high quality images were made available for retracing. Then, same thing, same reason, on the 22nd.

first column: date of the extract
second: unique users contributing to the Haiti map
third: Megabytes of the uncompressed extract file (useful for gathering a rough idea of “detail”)

Date# usersSize (MB)
2009-12-303844
2010-01-147149
2010-01-159651
2010-01-1618360
2010-01-1724577
2010-01-1828693
2010-01-19300106
2010-01-20327117
2010-01-21365126
2010-01-22494188
2010-01-23515197
2010-01-24573211
2010-01-25585219
2010-01-26642229
2010-01-27649234
2010-01-28655238
2010-01-29663239
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

OpenStreetMap ad Haiti

La mancanza di mappe aggiornate alla reale situazione post-terremoto rischiava di compromettere le attività di salvataggio.

Dopo il terremoto ad Haiti la macchina internazionale degli aiuti si è immediatamente messa in moto, questa volta, una importantissima azione è stata svolta dai volontari openstreetmap.

Poche ore dopo sono state rese disponibili foto aeree delle zone colpite, i nostri volontari si sono, indipendentemente, messi all’opera e hanno iniziato a inserire dati nel nostro database, questo ha portato, nel giro di poche ore, alla generazione di mappe aggiornate dell’isola, con indicate tutte le strade ancora percorribili, le posizioni dei campi profughi, ponti inagibili, il neo costruito aeroporto.

Le mappe vengono continuamente aggiornate e sono rese immediatamente disponibili per qualsiasi uso, commerciale, o umanitario. Esse sono scaricabili sui navigatori portatili e usate sui cellulari dotati di GPS.

E’ uno straordinario esempio di come un approccio partecipato può funzionare anche in questi drammatici casi.

Un esempio di mappa che mostra gli accampamenti spontanei.

Due immagini che mostrano il progresso: la prima è Port au Prince adesso, la seconda, prima del terremoto.

haiti.osm.20090114180900

haiti.osm.pre-event

Per maggiori informazioni, soprattutto per i giornalisti, fate riferimetno a questo: Informazioni per la Stampa.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

geo search using Lucene + SOLR + OpenStreetMap

An interesting article on finding geo data (OpenStreetMap) using common-use search software as SOLR a java frontend to Lucene. Apache Lucene is a Java™-based, high performance search library. Apache Solr is a search server that uses Lucene to provide search, faceting, and many more capabilities over HTTP. Both are licensed under the commercial-friendly Apache Software License. Both Lucene and Solr also offer the ability to restrict the space being searched by applying one or more filters, which are key to spatial search. Range queries and range filters are among the essential mechanisms for restricting the space.

http://www.ibm.com/developerworks/opensource/library/j-spatial/index.html

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)