Exemplo n.º 1
0
        /// <summary>
        /// Rapid Street Zipcode All
        /// </summary>
        public void RapidStreetZipcodeAll()
        {
            // Create the manager with the api key
            Route4MeManager route4Me = new Route4MeManager(c_ApiKey);

            GeocodingParameters geoParams = new GeocodingParameters()
            {
                Zipcode = "00601"
            };
            // Run the query
            string    errorString = "";
            ArrayList result      = route4Me.RapidStreetZipcode(geoParams, out errorString);

            Console.WriteLine("");

            if (result != null)
            {
                Console.WriteLine("RapidStreetZipcodeAll executed successfully");
                foreach (Dictionary <string, string> res1 in result)
                {
                    Console.WriteLine("Zipcode: " + res1["zipcode"]);
                    Console.WriteLine("Street name: " + res1["street_name"]);
                    Console.WriteLine("---------------------------");
                }
            }
            else
            {
                Console.WriteLine("RapidStreetZipcodeAll error: {0}", errorString);
            }
        }
        /// <summary>
        /// Rapid Street Data All
        /// </summary>
        public void RapidStreetDataAll()
        {
            // Create the manager with the api key
            var route4Me = new Route4MeManager(ActualApiKey);

            var geoParams = new GeocodingParameters();

            // Run the query
            ArrayList result = route4Me.RapidStreetData(geoParams, out string errorString);

            PrintExampleGeocodings(result, GeocodingPrintOption.StreetData, errorString);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Asynchronous batch geocoding
        /// </summary>
        /// <param name="geoParams">Geocoding parameters</param>
        public void BatchGeocodingForwardAsync(GeocodingParameters geoParams = null)
        {
            var route4Me = new Route4MeManager(ActualApiKey);

            geoParams = new GeocodingParameters
            {
                Addresses    = "Los Angeles International Airport, CA\n3495 Purdue St, Cuyahoga Falls, OH 44221",
                ExportFormat = "json"
            };

            //Run the query
            string result = route4Me.BatchGeocodingAsync(geoParams, out string errorString);

            PrintExampleGeocodings(result, GeocodingPrintOption.Geocodings, errorString);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Reverse Geocoding
        /// </summary>
        /// <returns> json/xml object </returns>
        public void ReverseGeocoding()
        {
            // Create the manager with the api key
            var route4Me = new Route4MeManager(ActualApiKey);

            var geoParams = new GeocodingParameters
            {
                Addresses = "42.35863,-71.05670",
                Format    = "json"
            };

            // Run the query
            string result = route4Me.Geocoding(geoParams, out string errorString);

            PrintExampleGeocodings(result, GeocodingPrintOption.Geocodings, errorString);
        }
        /// <summary>
        /// Rapid Street Service All
        /// </summary>
        public void RapidStreetServiceAll()
        {
            // Create the manager with the api key
            var route4Me = new Route4MeManager(ActualApiKey);

            var geoParams = new GeocodingParameters()
            {
                Zipcode     = "00601",
                Housenumber = "17"
            };

            // Run the query
            ArrayList result = route4Me.RapidStreetService(geoParams, out string errorString);

            PrintExampleGeocodings(result, GeocodingPrintOption.StreetService, errorString);
        }
        /// <summary>
        /// Rapid Street Zipcode Limited
        /// </summary>
        public void RapidStreetZipcodeLimited()
        {
            // Create the manager with the api key
            var route4Me = new Route4MeManager(ActualApiKey);

            var geoParams = new GeocodingParameters()
            {
                Zipcode = "00601",
                Offset  = 1,
                Limit   = 10
            };

            // Run the query
            ArrayList result = route4Me.RapidStreetZipcode(geoParams, out string errorString);

            PrintExampleGeocodings(result, GeocodingPrintOption.StreetZipCode, errorString);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Forward Geocoding
        /// </summary>
        /// <returns> json/xml object </returns>
        public void GeocodingForward(GeocodingParameters geoParams = null)
        {
            // Create the manager with the api key
            var route4Me = new Route4MeManager(ActualApiKey);

            if (geoParams == null)
            {
                geoParams = new GeocodingParameters()
                {
                    Addresses = "Los Angeles International Airport, CA||3495 Purdue St, Cuyahoga Falls, OH 44221",
                    Format    = "json"
                };
            }

            //Run the query
            string result = route4Me.Geocoding(geoParams, out string errorString);

            PrintExampleGeocodings(result, GeocodingPrintOption.Geocodings, errorString);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Forward Geocoding
        /// </summary>
        /// <returns> xml object </returns>
        public void GeocodingForward(GeocodingParameters geoParams)
        {
            // Create the manager with the api key
            Route4MeManager route4Me = new Route4MeManager(c_ApiKey);

            //Run the query
            string errorString = "";
            string result      = route4Me.Geocoding(geoParams, out errorString);

            Console.WriteLine("");

            if (result != null)
            {
                Console.WriteLine("GeocodingForward executed successfully");
            }
            else
            {
                Console.WriteLine("GeocodingForward error: {0}", errorString);
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Reverse Geocoding
        /// </summary>
        /// <returns> xml object </returns>
        public void ReverseGeocoding()
        {
            // Create the manager with the api key
            Route4MeManager route4Me = new Route4MeManager(c_ApiKey);

            GeocodingParameters geoParams = new GeocodingParameters {
                Addresses = "42.35863,-71.05670"
            };
            // Run the query
            string errorString = "";
            string result      = route4Me.Geocoding(geoParams, out errorString);

            Console.WriteLine("");

            if (result != null)
            {
                Console.WriteLine("ReverseGeocoding executed successfully");
            }
            else
            {
                Console.WriteLine("ReverseGeocoding error: {0}", errorString);
            }
        }