mysql spatial extensions and ruby
TRANSCRIPT
![Page 2: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/2.jpg)
MySQL Spatial Extensions
![Page 3: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/3.jpg)
GeoRuby
![Page 4: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/4.jpg)
MySQL Spatial Extensions
+GeoRuby
![Page 5: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/5.jpg)
What’s the problem?
![Page 6: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/6.jpg)
Storing Spatial Data
![Page 7: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/7.jpg)
Where does this data come from?
![Page 8: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/8.jpg)
What is this data?
![Page 9: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/9.jpg)
Raster Data
![Page 10: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/10.jpg)
Vector Data
![Page 11: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/11.jpg)
Earthly Complications
![Page 12: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/12.jpg)
[katamari]
http://flickr.com/photos/ethanhein/1555066117/
![Page 13: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/13.jpg)
Latitude & Longitude
![Page 14: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/14.jpg)
Projections
![Page 15: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/15.jpg)
![Page 16: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/16.jpg)
![Page 17: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/17.jpg)
I maps
![Page 18: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/18.jpg)
![Page 19: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/19.jpg)
SRIDs
![Page 20: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/20.jpg)
File Types
![Page 21: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/21.jpg)
Simpler Formats
![Page 22: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/22.jpg)
Google Earth
![Page 23: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/23.jpg)
qgis
![Page 24: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/24.jpg)
GRASS
![Page 25: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/25.jpg)
OGR
![Page 26: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/26.jpg)
MapServer / GeoServer
![Page 27: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/27.jpg)
WMS / WFS
![Page 28: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/28.jpg)
Geocoding
![Page 29: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/29.jpg)
Reverse Geocoding
![Page 30: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/30.jpg)
How is this data represented in
MySQL?
![Page 31: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/31.jpg)
OGC Simple Features for SQL
![Page 32: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/32.jpg)
MySQL-specifics
![Page 33: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/33.jpg)
How is this data queried?
![Page 34: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/34.jpg)
๏Dimension(g)
๏Envelope(g)
๏GeometryType(g)
๏SRID(g)
๏X(g)
๏Y(g)
๏EndPoint(ls)
๏GLength(ls)
๏NumPoints(ls)
๏StartPoint(ls)
๏ IsClosed(mls)
๏Area(poly)
๏ExteriorRing(poly)
๏ InteriorRingN(poly,N)
๏NumInteriorRings(poly)
๏GeometryN(gc,N)
๏NumGeometries(gc)
๏MBRContains(g1,g2)
๏MBRDisjoint(g1,g2)
๏MBREqual(g1,g2)
๏MBRIntersects(g1,g2)
๏MBROverlaps(g1,g2)
๏MBRTouches(g1,g2)
๏MBRWithin(g1,g2)
![Page 35: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/35.jpg)
MoreMySQL-specifics
![Page 36: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/36.jpg)
WKT,WKB,WTF?
![Page 37: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/37.jpg)
ActiveRecord with GeoRuby
![Page 38: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/38.jpg)
loc = Location.find(:first)loc.geom.x # => point's x coordinateloc.geom.y # => point's y coordinateloc.geom.srid # => point's SRIDloc.geom.as_kml # => KML representation
loc.geom.ellipsoidal_distance(loc2) # => ellipsoidal distance from loc2loc.geom.euclidian_distance(loc2) # => euclidean distance from loc2loc.geom.spherical_distance(loc2) # => spherical distance from loc2
loc.geom.x = -43.2253 # set location's longitudeloc.save!
state = State.find(:first)state.geom.envelope # => bounding boxstate.geom.rings.first.points # => points making up the outer LinearRingstate.geom.as_georss # => GeoRSS representation
![Page 39: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/39.jpg)
create_table "locations", :options => 'ENGINE=MyISAM' do |t| t.string "name" t.column "geom", :geometry, :null => false t.datetime "created_at" t.datetime "updated_at"end
add_index "locations", ["geom"], :name => "geom", :spatial => true
![Page 40: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/40.jpg)
Exposure
![Page 41: MySQL Spatial Extensions And Ruby](https://reader033.vdocuments.us/reader033/viewer/2022052623/559c1ca61a28abfb148b4685/html5/thumbnails/41.jpg)
Links• http://georuby.rubyforge.org/
• http://geokit.rubyforge.org/
• http://ym4r.rubyforge.org/
• http://forge.mysql.com/wiki/GIS_Functions
• http://rails.nomad-labs.com/?page_id=7
• http://www.mass.gov/mgis/
• http://www.usgs.gov/ngpo/
• http://teczno.com/faumaxion-II/