adding where to your ruby apps

40
Adding Where To Your Ruby Apps @bsao - Robson Junior @rpepato - Roberto Pepato

Upload: roberto-pepato

Post on 05-Jul-2015

643 views

Category:

Technology


0 download

DESCRIPTION

These are the slides of my presentation at RubyConfBr 2011

TRANSCRIPT

Page 1: Adding where to your ruby apps

Adding Where To Your Ruby Apps

@bsao - Robson Junior@rpepato - Roberto Pepato

Page 2: Adding where to your ruby apps

Who are these guys ?

Page 3: Adding where to your ruby apps

GIS?

Page 4: Adding where to your ruby apps

Why GIS?

Page 5: Adding where to your ruby apps

Why GIS?

Page 7: Adding where to your ruby apps

Soft Part

Page 8: Adding where to your ruby apps

reverse geocodingreverse geocodinggeocoding

routing

reverse geocodinggeocoding

routing

reverse geocoding

Page 9: Adding where to your ruby apps

How to work with Geocoding in Ruby ?

Page 10: Adding where to your ruby apps

see => http://railscasts.com/episodes/273-geocoder

Page 11: Adding where to your ruby apps
Page 12: Adding where to your ruby apps

Utilities

Page 13: Adding where to your ruby apps

Mining

Page 14: Adding where to your ruby apps

Security

Page 15: Adding where to your ruby apps

Oil & Gas

Page 16: Adding where to your ruby apps

More Applications ?

Agriculture

Page 17: Adding where to your ruby apps

More Applications ?

Agriculture

Page 18: Adding where to your ruby apps

Hard Part

Page 19: Adding where to your ruby apps

Many Projections

Page 20: Adding where to your ruby apps

Many Zones

Page 21: Adding where to your ruby apps

A whole

Page 22: Adding where to your ruby apps

A whole

Difficult Part

Page 23: Adding where to your ruby apps

A whole

Difficult Part Easy Part

Page 24: Adding where to your ruby apps

A whole

Easy Part

Page 25: Adding where to your ruby apps

Market

Page 26: Adding where to your ruby apps

OpenSource

Grass GIS

Page 27: Adding where to your ruby apps
Page 28: Adding where to your ruby apps

ESRI for Ruby ?

Page 29: Adding where to your ruby apps

ESRI for Ruby ?

#fail

Page 30: Adding where to your ruby apps

ESRI for Ruby ?

#fail

Designed for C, C++, .Net, Java, Flex and Python*

Page 31: Adding where to your ruby apps

ESRI guys told us: Don’t worry, we will provide you with a

“REST” API

{ :get, :put, :post, :delete }

Page 32: Adding where to your ruby apps

Seriously ? REST ?

No semanticsNo resources

Page 33: Adding where to your ruby apps

rgis - hard (boring?) part made easy

Page 34: Adding where to your ruby apps
Page 35: Adding where to your ruby apps

using System.Windows.Controls;using System.Windows;using ESRI.ArcGIS.Client.Geometry;using ESRI.ArcGIS.Client.Tasks;using ESRI.ArcGIS.Client;using System.Collections.Generic;using ESRI.ArcGIS.Client.Symbols;

namespace ArcGISSilverlightSDK{ public partial class Project : UserControl { GeometryService geometryService; GraphicsLayer graphicsLayer;

public Project() { InitializeComponent();

geometryService = new GeometryService("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); geometryService.ProjectCompleted += geometryService_ProjectCompleted; geometryService.Failed += geometryService_Failed;

graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; }

private void ProjectButton_Click(object sender, System.Windows.RoutedEventArgs e) { double x; double y; if (!double.TryParse(XTextBox.Text, out x) || !double.TryParse(YTextBox.Text, out y)) { MessageBox.Show("Enter valid coordinate values."); return; }

MapPoint inputMapPoint = new MapPoint(x, y, new SpatialReference(4326));

geometryService.ProjectAsync(new List<Graphic>() { new Graphic() { Geometry = inputMapPoint } }, MyMap.SpatialReference, inputMapPoint); }

void geometryService_ProjectCompleted(object sender, GraphicsEventArgs e) { Graphic resultGraphic = e.Results[0];

if (resultGraphic.Geometry.Extent != null) { resultGraphic.Symbol = LayoutRoot.Resources["RoundMarkerSymbol"] as SimpleMarkerSymbol;

MapPoint resultMapPoint = resultGraphic.Geometry as MapPoint; resultGraphic.Attributes.Add("Output_CoordinateX", resultMapPoint.X); resultGraphic.Attributes.Add("Output_CoordinateY", resultMapPoint.Y);

MapPoint inputMapPoint = e.UserState as MapPoint; resultGraphic.Attributes.Add("Input_CoordinateX", inputMapPoint.X); resultGraphic.Attributes.Add("Input_CoordinateY", inputMapPoint.Y);

graphicsLayer.Graphics.Add(resultGraphic);

MyMap.PanTo(resultGraphic.Geometry); } else { MessageBox.Show("Invalid input coordinate, unable to project."); }

}

void geometryService_Failed(object sender, TaskFailedEventArgs e) { MessageBox.Show("Geometry Service error: " + e.Error); } }}

Project X, Y (ESRI .Net Silverlight API)

Page 36: Adding where to your ruby apps
Page 37: Adding where to your ruby apps

point = RGis::Point.new(15,17) new_point = point.project(:from => 4326, :to => 102100)

Project X, Y (rgis)

Page 38: Adding where to your ruby apps

https://github.com/rgis/rgis

Page 39: Adding where to your ruby apps

Questions?

https://github.com/rgis/rgis

Page 40: Adding where to your ruby apps

@bsao@rpepato

Join us to make GIS easier:https://github.com/rgis

Text