public static void Main(string[] args) { GeocodingService geoCodingService = new GeocodingService(); LocationInfo locationInfo = geoCodingService.Geocode("150 GRANDVIEW WAY MISSOULA MT"); PublicHousingAuthorityInfoService phaiService = new PublicHousingAuthorityInfoService(); PublicHousingAuthorityInfo info = phaiService.GetPublicHousingAuthorityInfo(locationInfo.City, locationInfo.State); //FairMarketRentService service = new FairMarketRentService(); //service.GetFairMarketRent("King County", "WA", 3); // Geocode an address // ... // Use this to get fair market value // ... //GeocodeGoogleAddress("150 GRANDVIEW WAY MISSOULA MT"); //Esri.ArcGISRuntime.Layers. /* * while(true) * { * HudServiceExample(); * } * */ //http://services.arcgis.com/VTyQ9soqVukalItT/ArcGIS/rest/services/MultiFamilyProperties/FeatureServer/0/query?where=LAT=46.815616+AND+LON=-114.02801&outFields=*1 }
public async Task CanQuerySingle() { GeocodingService.QuerySingle(Guid.NewGuid()).Should().BeEmpty(); var address = await GeocodingService.Geocode("1 Microsoft Way, Redmond, WA 98052, USA"); GeocodingService.QuerySingle(address.Key).Should().HaveCount(1); }
public ActionResult Index() { GeocodingService geoCodingService = new GeocodingService(); LocationInfo locationInfo = geoCodingService.Geocode("150 GRANDVIEW WAY MISSOULA MT"); PublicHousingAuthorityInfoService phaiService = new PublicHousingAuthorityInfoService(); // Hangs PublicHousingAuthorityInfo info = phaiService.GetPublicHousingAuthorityInfo(locationInfo.City, locationInfo.State); ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application."; return(View()); }
public static void Main(string[] args) { // Geocode an address provided by the user GeocodingService geoCodingService = new GeocodingService(); LocationInfo locationInfo = geoCodingService.Geocode("150 GRANDVIEW WAY MISSOULA MT"); // Use the information from the geocoded address to get Fair Market Rent FairMarketRentService fmrService = new FairMarketRentService(); FairMarketRentInfo fmrInfo = fmrService.GetFairMarketRentInfo(locationInfo.Latitude, locationInfo.Longitude); // Use the information from the geocoded address to get Public Housing Authority Conact Information PublicHousingAuthorityInfoService phaiService = new PublicHousingAuthorityInfoService(); PublicHousingAuthorityInfo info = phaiService.GetPublicHousingAuthorityInfo(locationInfo.City, locationInfo.State); }
public static void Main() { var address = "23411 Summerfield, Aliso Viejo"; var svc = new GeocodingService(Credentials.None); var response = svc.Geocode(address); if (response.Status == ServiceResponseStatus.Ok) { var best = response.Results[0]; var location = best.Geometry.Location; Console.WriteLine("Geocoded \"{3}\" as \"{2}\" at ({1:n4}, {0:n4})", location.Latitude, location.Longitude, best.FormattedAddress, address); } else { Console.WriteLine("Service responded with error \"{0}\"", response.Status); } }
public async Task CanFindSpecificMovieLocations() { var movie = new Abstraction.Model.Movie { Title = Guid.NewGuid().ToString(), ReleaseYear = 2018, Actors = new List <Actor>(), Directors = new List <Director>(), Distributors = new List <Distributor>(), FilmingLocations = new[] { new FilmingLocation { Key = Guid.NewGuid(), AddressKey = (await GeocodingService.Geocode("Test address 1")).Key, FunFact = "Fun fact 1" }, new FilmingLocation { Key = Guid.NewGuid(), AddressKey = (await GeocodingService.Geocode("Test address 2")).Key, FunFact = "Fun fact 2" } }, ProductionCompanies = new List <ProductionCompany>(), Writers = new List <Writer>() }; var merged = await MovieService.Merge(movie); var locations = await FilmingLocationService.Find(); var movieLocations = locations.Where(e => e.MovieKey == merged.Key).ToList(); movieLocations.Should().HaveCount(2); movieLocations.Select(e => e.Key).Should().BeEquivalentTo(movie.FilmingLocations.Select(e => e.Key)); movieLocations.Select(e => e.MovieKey).All(key => key != default(Guid)).Should().BeTrue(); movieLocations.Select(e => e.MovieKey).Should().BeEquivalentTo(merged.FilmingLocations.Select(e => e.MovieKey)); movieLocations.Select(e => e.AddressKey).Should().BeEquivalentTo(movie.FilmingLocations.Select(e => e.AddressKey)); movieLocations.Select(e => e.Latitude).Should().BeEquivalentTo(new[] { 1.0, 1.0 }); movieLocations.Select(e => e.Longitude).Should().BeEquivalentTo(new[] { 1.0, 1.0 }); movieLocations.Select(e => e.FormattedAddress).Should().BeEquivalentTo(new[] { "Test address 1", "Test address 2" }); movieLocations.Select(e => e.FunFact).Should().BeEquivalentTo(new[] { "Fun fact 1", "Fun fact 2" }); }
public async Task CanMerge() { var movie = new Abstraction.Model.Movie { Title = Guid.NewGuid().ToString(), ReleaseYear = 2018, Actors = new[] { new Actor { FullName = "Test actor 1" }, new Actor { FullName = "Test actor 2" } }, Directors = new[] { new Director { FullName = "Test director 1" }, new Director { FullName = "Test director 2" } }, Distributors = new[] { new Distributor { Name = "Test distributor 1" }, new Distributor { Name = "Test distributor 2" } }, FilmingLocations = new[] { new FilmingLocation { Key = Guid.NewGuid(), AddressKey = (await GeocodingService.Geocode("Test address 1")).Key, FunFact = "Fun fact 1" }, new FilmingLocation { Key = Guid.NewGuid(), AddressKey = (await GeocodingService.Geocode("Test address 2")).Key, FunFact = "Fun fact 2" } }, ProductionCompanies = new[] { new ProductionCompany { Name = "Test production company 1" }, new ProductionCompany { Name = "Test production company 2" } }, Writers = new[] { new Writer { FullName = "Test writer 1" }, new Writer { FullName = "Test writer 2" } } }; var merged = await MovieService.Merge(movie); var found = await MovieService.Find(merged.Key); foreach (var m in new[] { merged, found }) { m.Should().NotBeNull(); m.Title.Should().Be(movie.Title); m.ReleaseYear.Should().Be(movie.ReleaseYear); m.Actors.Should().HaveCount(2); m.Actors.Select(e => e.Key).All(key => key != default(Guid)).Should().BeTrue(); m.Actors.Select(e => e.FullName).Should().BeEquivalentTo(new[] { "Test actor 1", "Test actor 2" }); m.Directors.Should().HaveCount(2); m.Directors.Select(e => e.Key).All(key => key != default(Guid)).Should().BeTrue(); m.Directors.Select(e => e.FullName).Should().BeEquivalentTo(new[] { "Test director 1", "Test director 2" }); m.Distributors.Should().HaveCount(2); m.Distributors.Select(e => e.Key).All(key => key != default(Guid)).Should().BeTrue(); m.Distributors.Select(e => e.Name).Should().BeEquivalentTo(new[] { "Test distributor 1", "Test distributor 2" }); m.FilmingLocations.Should().HaveCount(2); m.FilmingLocations.Select(e => e.Key).Should().BeEquivalentTo(movie.FilmingLocations.Select(e => e.Key)); m.FilmingLocations.Select(e => e.MovieKey).All(key => key != default(Guid)).Should().BeTrue(); m.FilmingLocations.Select(e => e.MovieKey).Should().BeEquivalentTo(merged.FilmingLocations.Select(e => e.MovieKey)); m.FilmingLocations.Select(e => e.AddressKey).Should().BeEquivalentTo(movie.FilmingLocations.Select(e => e.AddressKey)); m.FilmingLocations.Select(e => e.Latitude).Should().BeEquivalentTo(new[] { 1.0, 1.0 }); m.FilmingLocations.Select(e => e.Longitude).Should().BeEquivalentTo(new[] { 1.0, 1.0 }); m.FilmingLocations.Select(e => e.FormattedAddress).Should().BeEquivalentTo(new[] { "Test address 1", "Test address 2" }); m.FilmingLocations.Select(e => e.FunFact).Should().BeEquivalentTo(new[] { "Fun fact 1", "Fun fact 2" }); m.ProductionCompanies.Should().HaveCount(2); m.ProductionCompanies.Select(e => e.Key).All(key => key != default(Guid)).Should().BeTrue(); m.ProductionCompanies.Select(e => e.Name).Should().BeEquivalentTo(new[] { "Test production company 1", "Test production company 2" }); m.Writers.Should().HaveCount(2); m.Writers.Select(e => e.Key).All(key => key != default(Guid)).Should().BeTrue(); m.Writers.Select(e => e.FullName).Should().BeEquivalentTo(new[] { "Test writer 1", "Test writer 2" }); } }