BIXI Toronto is (nearly) here!
Here are the proposed station locations: Bixi_Toronto_shp.zip (Shapefile) or Bixi_Toronto-kml_csv.zip (KML and CSV).
BIXI Toronto is (nearly) here!
Here are the proposed station locations: Bixi_Toronto_shp.zip (Shapefile) or Bixi_Toronto-kml_csv.zip (KML and CSV).
After yesterday’s post, I went a bit nuts with working out the whole amateur radio grid locator thing (not that I’m currently likely to use it, though). I’d hoped to provide a shapefile of the entire world, but that would be too big for the format’s 2GB file size limit.
What I can give you, though, is:
If anyone would like their grid square in Google Earth format, let me know, or read on …
Several people have asked, so here’s how you convert to KML. You’ll need the OGR toolkit installed, which comes in several open-source geo software bundles: FWTools/osgeo4w/QGis. Let’s assume we want to make the grid square ‘EN’.
make_grid.pl en
ogr2ogr -f KML EN-maidenhead_grid.kml EN-maidenhead_grid.shp
ogr2ogr -f KML -where "Square='82'" EN82-maidenhead_grid.kml EN-maidenhead_grid.shp
While we already know how to make trivial shapefiles with shapelib, sometimes that’s too tedious. Very frequently I get data in Comma Separated Value (CSV) format, and reliably importing/converting it can be a pain.
Here’s our sample CSV file, library_test.csv
:
"Easting","Northing","Library" 625539.6,4837170.9,"Dufferin St. Clair" 625862.0,4838241.1,"Oakwood Village" 626251.0,4835287.2,"Bloor Gladstone" 626671.7,4836922.6,"Davenport" 627227.2,4840006.4,"Forest Hill"
ogr has a CSV driver. In its documentation the Virtual Format driver is touched upon. This allows you to set up a data definition file, especially useful if you read the same format frequently.
Here’s the VRT file for that CSV:
<OGRVRTDataSource> <!-- note that OGRVRTLayer name must be basename of source file --> <OGRVRTLayer name="library_test"> <SrcDataSource>library_test.csv</SrcDataSource> <GeometryType>wkbPoint</GeometryType> <!-- your SRS goes here; I used EPSG SRID --> <LayerSRS>EPSG:2958</LayerSRS> <GeometryField encoding="PointFromColumns" x="Easting" y="Northing"/> </OGRVRTLayer> </OGRVRTDataSource>
Your CSV file will now behave like a shapefile, or indeed any other geo-format that OGR understands. QGIS is a bit picky – it doesn’t seem to always work out the path of the source file.
To prove these are real coordinates, here’s what I did to make a Google Earth KML file:
ogr2ogr -f KML -t_srs EPSG:4326 library_test.kml library_test.vrt -dsco NameField=Library
Technically, you don’t need to specify the SRS for KML output as it only supports EPSG:4326, but I found you got trivially different results if it was omitted.
Try this in Google Earth: library_test.kml