<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>reverse geocoding Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/reverse-geocoding/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/reverse-geocoding/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Fri, 27 Sep 2019 14:27:39 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.4</generator>

<image>
	<url>https://zappysys.com/blog/wp-content/uploads/2023/01/cropped-zappysys-symbol-large-32x32.png</url>
	<title>reverse geocoding Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/reverse-geocoding/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>SSIS Geocoding with Google Maps API</title>
		<link>https://zappysys.com/blog/ssis-geocoding-with-google-maps-api/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 14 Sep 2018 14:02:23 +0000</pubDate>
				<category><![CDATA[Google API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS Components]]></category>
		<category><![CDATA[SSIS JSON Parser Transform]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[geocoding]]></category>
		<category><![CDATA[geocoding api]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google maps api]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[reverse geocoding]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=4821</guid>

					<description><![CDATA[<p>Introduction In this tutorial, we will cover the topics of how to perform geocoding on the addresses and reverse geocoding on the location coordinates using SSIS and Google Maps API. So what is geocoding, exactly? Geocoding is the process of translating an address (e.g. a street address) or a place to coordinates on the Earth&#8217;s surface. Simply [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-geocoding-with-google-maps-api/">SSIS Geocoding with Google Maps API</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><img decoding="async" class="wp-image-4852 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/09/icons8-google-maps-180-e1537353957364.png" alt="" width="100" height="100" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/icons8-google-maps-180-e1537353957364.png 155w, https://zappysys.com/blog/wp-content/uploads/2018/09/icons8-google-maps-180-e1537353957364-150x150.png 150w" sizes="(max-width: 100px) 100vw, 100px" /></p>
<p style="text-align: justify;">In this tutorial, we will cover the topics of how to perform <em>geocoding</em> on the addresses and <em>reverse geocoding</em> on the location coordinates using SSIS and <a href="https://developers.google.com/maps/documentation/" rel="noopener">Google Maps API</a>. So what is <em>geocoding,</em> exactly? <em>Geocoding</em> is the process of translating an address (e.g. a street address) or a place to coordinates on the Earth&#8217;s surface. Simply put, <em>geocoding</em> takes a description of a location and gives back latitude and longitude values as a result. For example, <pre class="crayon-plain-tag">1600 Amphitheatre Parkway, Mountain View, CA 94043, USA</pre>  gets translated to <pre class="crayon-plain-tag">(37.4224764, -122.0842499)</pre>. <em>Reverse geocoding</em>, on the other hand, is the exact opposite process. In it, latitude and longitude values pair gets translated into a human-readable form. To take the same example above,  <pre class="crayon-plain-tag">(37.4224764, -122.0842499)</pre> would translate back to <pre class="crayon-plain-tag">1600 Amphitheatre Parkway, Mountain View, CA 94043, USA</pre>. So, if you need to perform any of the lookups, you can use <a href="https://developers.google.com/maps/documentation/geocoding/start" rel="noopener">Google Maps Geocoding API</a>. Actually, Google Maps Geocoding API offers a bit more <span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS"><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">– you can use it for <em>address validation</em>, <em>cleansing</em>, and <em>formatting</em>.</span></span></span></span></p>
<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF7B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>NOTE:</strong> If it happens that you need to use other geocoding provider and perform the lookups in SSIS, you may still benefit from this article (the examples of usage of Google Maps Geocoding API can be replaced by another provider). </div></div>
<p style="text-align: justify;">To accomplish our goal we will use an add-on for SSIS <span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS"><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">– <a href="https://zappysys.com/products/ssis-powerpack/" rel="noopener">ZappySys SSIS PowerPack</a></span></span></span></span><span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS"><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">.</span></span></span></span> It contains many additional SSIS Tasks and Data Flow Components that lets you accomplish what you cannot do with standard SSIS connectors. We will use these <a href="https://zappysys.com/products/ssis-powerpack/" rel="noopener">ZappySys SSIS PowerPack</a> connectors:</p>
<div class="content_block" id="custom_post_widget-5067"><div style="display: table-row; background: #f7f7f7;">
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc;"><img decoding="async" style="vertical-align: middle; width: 50px; height: 50px; max-width: 50px;" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/web-api-destination/ssis-web-api-destination.png" alt="Web API Destination" width="50" height="50" /></div>
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc; border-left: none; width: 100%;"><a href="//zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">Web API Destination</a></div>
</div></div>
<div class="content_block" id="custom_post_widget-5078"><div style="display: table-row; background: #f7f7f7;">
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc;"><img loading="lazy" decoding="async" style="vertical-align: middle; width: 50px; height: 50px; max-width: 50px;" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/json-parser-transform/ssis-json-parser-transform.png" alt="JSON Parser Transform" width="50" height="50" /></div>
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc; border-left: none; width: 100%;"><a href="//zappysys.com/products/ssis-powerpack/ssis-json-parser-transform/" target="_blank" rel="noopener">JSON Parser Transform</a></div>
</div></div>
<p>Let&#8217;s start!</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2><span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS">Step-by-Step <span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">– </span></span></span></span>SSIS Geocoding with Google Maps API</h2>
<p style="text-align: justify;">Before we start, let&#8217;s consider the use-case for our tutorial. Suppose, you have a CRM system filled with user-entered addresses of your leads. Since they are user-entered, it means that they can be incomplete, malformed, or just plain rubbish. Also, you have a marketing campaign and you want to send letters with offers to your leads so that they become your clients. Before sending them any letters, you have to make sure the addresses are valid and well-formed. You are also interested in the geographical location of your leads that you could do some business intelligence analysis on the coordinates of your leads and maybe future clientele. Here is where Geocoding API kicks in.</p>
<p style="text-align: justify;">Thus in this example, we will take various street addresses <span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS"><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">– sometimes invalid, </span></span></span></span>incomplete or unformatted <span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS"><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">– and submit them to Google Geocoding API for processing. </span></span></span></span><span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS"><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">As a result, we will get nicely formatted, cleansed, full addresses and their coordinates. We will take a look on how to determine if lookup worked successfully and to what extent you should trust Geocoding API&#8217;s response. Finally, we will save retrieved addresses and their individual components (e.g. street number, street name, city, country, etc.) to a SQL Server database table.</span></span></span></span></p>
<div class="content_block" id="custom_post_widget-5017"><h3>Create a Google project</h3>
First, to use a Google API, you need to have a Google project. Create one, if you don't have any or want to use a new project:
<ol>
 	<li>Go to <a href="https://console.cloud.google.com/home/dashboard" target="_blank" rel="noopener">Google Console</a> and click on the projects list:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4923" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-project-list.png" alt="" width="603" height="243" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-project-list.png 603w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-project-list-300x121.png 300w" sizes="(max-width: 603px) 100vw, 603px" /></li>
 	<li>Once a window opens, click "New Project":
<img loading="lazy" decoding="async" class="alignnone wp-image-4924 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-create-new-project-1-e1538487942630.png" alt="" width="731" height="258" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-create-new-project-1-e1538487942630.png 731w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-create-new-project-1-e1538487942630-300x106.png 300w" sizes="(max-width: 731px) 100vw, 731px" /></li>
 	<li>Give a name for the project and click "Create":
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4925" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-give-name-for-project.png" alt="" width="603" height="379" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-give-name-for-project.png 603w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-give-name-for-project-300x189.png 300w" sizes="(max-width: 603px) 100vw, 603px" /></li>
 	<li>Wait a couple of minutes for the project to create.</li>
 	<li>Again, click on the projects drop-down list:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4926" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-project-list-1.png" alt="" width="603" height="243" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-project-list-1.png 603w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-project-list-1-300x121.png 300w" sizes="(max-width: 603px) 100vw, 603px" /></li>
 	<li>Finally, select the project you've just created:
<img loading="lazy" decoding="async" class="alignnone wp-image-4927 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-select-the-project-e1538487850139.png" alt="" width="721" height="355" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-select-the-project-e1538487850139.png 721w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-select-the-project-e1538487850139-300x148.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-select-the-project-e1538487850139-720x355.png 720w" sizes="(max-width: 721px) 100vw, 721px" /></li>
</ol></div>
<div class="content_block" id="custom_post_widget-5025"><h3>Enable billing for the project</h3>
Not all Google APIs are free. So you'll have to add billing for the project you have just created:
<div class="su-note" style="border-color: #e5dea5; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;">
<div class="su-note-inner su-clearfix" style="background-color: #fff7b7; border-color: #fffdf1; color: #333333; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;"><strong>NOTE</strong>: As of September 21, 2018, Google offers 300 USD credit for free (but you will still need to create a billing account).</div>
</div>
<ol>
 	<li>Visit <a href="https://console.cloud.google.com/project/_/billing/enable?redirect=https://developers.google.com/maps/documentation/geocoding/usage-and-billing?dialogOnLoad%3Dbilling-enabled" target="_blank" rel="noopener">Billing on Google Console</a> page.</li>
 	<li>Once it's opened, select the project:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4928" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-billing-project-list.png" alt="" width="641" height="385" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-billing-project-list.png 641w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-billing-project-list-300x180.png 300w" sizes="(max-width: 641px) 100vw, 641px" /></li>
 	<li>Once a list of projects appears, select the one you created.</li>
 	<li>Then you will be prompted to create a billing account. Proceed to create one:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4929" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-billing-create-account.png" alt="" width="514" height="202" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-billing-create-account.png 514w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-billing-create-account-300x118.png 300w" sizes="(max-width: 514px) 100vw, 514px" /></li>
</ol></div>
<div class="content_block" id="custom_post_widget-5031"><h3>Enable Google API for your project</h3>
To use any Google API you must enable it for your project:
<ol>
 	<li>Visit <a href="https://console.cloud.google.com/apis" target="_blank" rel="noopener">Google APIs Dashboard</a> page.</li>
 	<li>Make sure your project is selected and then click "Enable APIs and services":
<img loading="lazy" decoding="async" class="alignnone wp-image-4931 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-enable-api-for-the-project-e1538488797230.png" alt="" width="718" height="272" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-enable-api-for-the-project-e1538488797230.png 718w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-enable-api-for-the-project-e1538488797230-300x114.png 300w" sizes="(max-width: 718px) 100vw, 718px" /></li>
 	<li>Then in the box which appears, search for API you are interested in, e.g. "geocoding":
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4934" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-search-for-api-1.png" alt="" width="645" height="303" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-search-for-api-1.png 645w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-search-for-api-1-300x141.png 300w" sizes="(max-width: 645px) 100vw, 645px" /></li>
 	<li>Finally, click on the Google API (e.g. "Geocoding API") tile:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4935" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-select-geocoding-api.png" alt="" width="654" height="405" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-select-geocoding-api.png 654w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-select-geocoding-api-300x186.png 300w" sizes="(max-width: 654px) 100vw, 654px" /></li>
 	<li>Finally finally, enable Google API:
<img loading="lazy" decoding="async" class="alignnone wp-image-4936 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-enable-geocoding-api-e1537539131256.png" alt="" width="647" height="343" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-enable-geocoding-api-e1537539131256.png 647w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-api-console-enable-geocoding-api-e1537539131256-300x159.png 300w" sizes="(max-width: 647px) 100vw, 647px" /></li>
</ol></div>
<div class="content_block" id="custom_post_widget-5035"><h3>Create Geocoding API Key</h3>
Once you have Google API enabled, you are ready to create a Google API Key, which you will use in all HTTP requests:
<ol>
 	<li>Go to <a href="https://console.cloud.google.com/apis/dashboard" target="_blank" rel="noopener">Google APIs Dashboard</a>.</li>
 	<li>Make sure you have your project selected, then select "Credentials" menu item and create a new API Key:
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-4937" src="https://zappysys.com/blog/wp-content/uploads/2018/09/sssi-google-api-how-to-create-api-key.png" alt="" width="695" height="434" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/sssi-google-api-how-to-create-api-key.png 695w, https://zappysys.com/blog/wp-content/uploads/2018/09/sssi-google-api-how-to-create-api-key-300x187.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/sssi-google-api-how-to-create-api-key-436x272.png 436w" sizes="(max-width: 695px) 100vw, 695px" /></li>
 	<li>Copy the newly created API Key to a safe place; we will use it later.</li>
</ol></div>
<h3>Load addresses from a SQL Server database table</h3>
<p>We prepared the Google Geocoding API part, now we are ready to get to the place where the rubber meets the road <span id="Step-by-Step_Export_data_from_Salesforce_to_SQL_Server_using_SSIS"><span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">– </span></span></span></span>we will create an SSIS package and load addresses from a database table:</p>
<ol>
<li>Create a new SSIS package.</li>
<li>Drag and drop <strong>Data Flow</strong> from SSIS Toolbox onto the Control Flow.
<div id="attachment_8028" style="width: 470px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8028" class="size-full wp-image-8028" src="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png" alt="" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /><p id="caption-attachment-8028" class="wp-caption-text">Dragging and dropping Data Flow Task into Control Flow</p></div></li>
<li>Drag and drop <strong>OLE DB Source</strong> onto the Data Flow.</li>
<li>Configure <strong>OLE DB Source</strong> to retrieve addresses from your table. We will use a table from Microsoft&#8217;s Northwind&#8217;s modified database &#8220;Marketing&#8221; (<a href="https://zappysys.com/blog/wp-content/uploads/2018/09/Marketing-database-script.zip">download it</a>):</li>
</ol>
<div id="attachment_4949" style="width: 718px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-load-addresses-1-e1538134305642.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4949" class="wp-image-4949 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-load-addresses-1-e1538134305642.png" alt="Loading user-entered addresses to be looked up in Google Geocoding API using SSIS." width="708" height="704" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-load-addresses-1-e1538134305642.png 708w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-load-addresses-1-e1538134305642-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-load-addresses-1-e1538134305642-300x298.png 300w" sizes="(max-width: 708px) 100vw, 708px" /></a><p id="caption-attachment-4949" class="wp-caption-text">Loading user-entered addresses to be looked up in Google Geocoding API using SSIS.</p></div>
<h3>Construct lookup URL</h3>
<ol>
<li>Drag and drop <strong>Derived Column</strong> component onto the Data Flow.</li>
<li>Add a new column and construct Geocoding lookup URL in this format (just like it says in <a href="https://developers.google.com/maps/documentation/geocoding/start" rel="noopener">Geocoding API documentation</a>):</li>
</ol>
<pre class="crayon-plain-tag">https://maps.googleapis.com/maps/api/geocode/json?address=ADDRESS_TO_LOOKUP&amp;key=YOUR_API_KEY</pre>
<div id="attachment_4959" style="width: 729px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-construct-url-e1538140223385.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4959" class="wp-image-4959 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-construct-url-e1538140223385.png" alt="Adding Google Geocoding API lookup URL as Derived Column to be used for geocoding in SSIS." width="719" height="510" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-construct-url-e1538140223385.png 719w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-construct-url-e1538140223385-300x213.png 300w" sizes="(max-width: 719px) 100vw, 719px" /></a><p id="caption-attachment-4959" class="wp-caption-text">Adding Google Geocoding API lookup URL as Derived Column to be used for geocoding in SSIS.</p></div>
<h3>Configure the Geocoding API request</h3>
<ol>
<li>Drag and drop <strong>Web API Destination</strong> onto the Data Flow and connect it with Derived Column. We will use Web API Destination to make HTTP requests to Geocoding API.</li>
<li>Then double-click on Web API Destination and create a new HTTP connection:
<div id="attachment_4962" style="width: 796px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-create-http-connection.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4962" class="wp-image-4962 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-create-http-connection.png" alt="Setting up HTTP Connection Manager for Web API Destination to make HTTP requests to Google Geocoding API using SSIS." width="786" height="478" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-create-http-connection.png 786w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-create-http-connection-300x182.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-create-http-connection-768x467.png 768w" sizes="(max-width: 786px) 100vw, 786px" /></a><p id="caption-attachment-4962" class="wp-caption-text">Setting up HTTP Connection Manager for Web API Destination to make HTTP requests to Google Geocoding API using SSIS.</p></div></li>
<li>Finally, configure <em>Input Column for URL</em>, <em>HTTP Request Method</em> and input into URL field a sample lookup URL:<br />
<pre class="crayon-plain-tag">https://maps.googleapis.com/maps/api/geocode/json?address=One Microsoft Way Redmond 98052-6399 USA&amp;key=YOUR_API_KEY</pre>
<div id="attachment_4963" style="width: 711px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-web-api-destination.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4963" class="wp-image-4963 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-web-api-destination.png" alt="Configuring Web API Destination to make geocoding lookups in Google Geocoding API using SSIS." width="701" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-web-api-destination.png 701w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-web-api-destination-300x267.png 300w" sizes="(max-width: 701px) 100vw, 701px" /></a><p id="caption-attachment-4963" class="wp-caption-text">Configuring Web API Destination to make geocoding lookups in Google Geocoding API using SSIS.</p></div>
<p>Once you are done, click <strong>Test Request/Response</strong> button. This will actually make a geocoding lookup for Microsoft headquarters:</li>
<li>In the <em>Response (Raw)</em> tab you see the actual response from Geocoding API. Within it –  cleansed, formatted and full Microsoft headquarters address together with geographical coordinates (even we looked it up using just the part of it). Now copy-paste the response body somewhere, so that we can use it in the next step while parsing:
<div id="attachment_4964" style="width: 693px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-sample-response.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4964" class="wp-image-4964 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-sample-response.png" alt="Checking Google Geocoding API HTTP response in Web API Destination using SSIS." width="683" height="642" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-sample-response.png 683w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-sample-response-300x282.png 300w" sizes="(max-width: 683px) 100vw, 683px" /></a><p id="caption-attachment-4964" class="wp-caption-text">Checking Google Geocoding API HTTP response in Web API Destination using SSIS.</p></div></li>
</ol>
<div class="su-note"  style="border-color:#e5da9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff4b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>NOTE:</strong> When Google Geocoding API retrieves only a partial result, it adds a new property in JSON named <em>partial_match</em>, as described in <a href="https://developers.google.com/maps/documentation/geocoding/intro#Results" rel="noopener">Geocoding API documentation</a>. This node is not present in the above sample response. </div></div>
<h3>Parsing Geocoding API JSON response into columns</h3>
<ol>
<li>Drag and drop <strong>JSON Parser Transform</strong> onto the Data Flow and connect it to Web API Destination.</li>
<li>Then open it and configure <em>Input JSON Column</em>.</li>
<li>After that, set the <em>Filter</em> to <strong>$.results[*]</strong>.</li>
<li>Continue by setting <em>Sample JSON strin</em>g to the one you saved in the previous step. Actually, before doing that let&#8217;s modify it and add <strong>partial_match</strong> node next to <strong>place_id</strong> so that <em>exact</em> and <em>partial</em> matches could be told apart (otherwise this property won&#8217;t be parsed):<br />
<pre class="crayon-plain-tag">{
    "results": [{
        "address_components": [{
            "long_name": "One",
            "short_name": "One",
            "types": ["street_number"]
        }, {
            "long_name": "Microsoft Way",
            "short_name": "Microsoft Way",
            "types": ["route"]
        }, {
            "long_name": "Overlake",
            "short_name": "Overlake",
            "types": ["neighborhood", "political"]
        }, {
            "long_name": "Redmond",
            "short_name": "Redmond",
            "types": ["locality", "political"]
        }, {
            "long_name": "King County",
            "short_name": "King County",
            "types": ["administrative_area_level_2", "political"]
        }, {
            "long_name": "Washington",
            "short_name": "WA",
            "types": ["administrative_area_level_1", "political"]
        }, {
            "long_name": "United States",
            "short_name": "US",
            "types": ["country", "political"]
        }, {
            "long_name": "98052",
            "short_name": "98052",
            "types": ["postal_code"]
        }],
        "formatted_address": "One Microsoft Way, Redmond, WA 98052, USA",
        "geometry": {
            "location": {
                "lat": 47.6423318,
                "lng": -122.1369302
            },
            "location_type": "ROOFTOP",
            "viewport": {
                "northeast": {
                    "lat": 47.6436807802915,
                    "lng": -122.1355812197085
                },
                "southwest": {
                    "lat": 47.6409828197085,
                    "lng": -122.1382791802915
                }
            }
        },
        "partial_match": false,
        "place_id": "ChIJGxUEuHFtkFQRnokD7mkppQE",
        "plus_code": {
            "compound_code": "JVR7+W6 Redmond, Washington, United States",
            "global_code": "84VVJVR7+W6"
        },
        "types": ["establishment", "point_of_interest"]
    }],
    "status": "OK"
}</pre>
<div id="attachment_4967" style="width: 729px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-json-parser-transform-1.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4967" class="wp-image-4967 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-json-parser-transform-1.png" alt="Configuring JSON Parser Transform to parse looked up addresses in Google Geocoding API HTTP JSON response using SSIS." width="719" height="584" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-json-parser-transform-1.png 719w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-json-parser-transform-1-300x244.png 300w" sizes="(max-width: 719px) 100vw, 719px" /></a><p id="caption-attachment-4967" class="wp-caption-text">Configuring JSON Parser Transform to parse looked up addresses in Google Geocoding API HTTP JSON response using SSIS.</p></div></li>
<li>To proceed and parse <em>individual address components</em> from JSON response (e.g. number, street, city, country, etc.), you will need to specify columns for each address component manually, just like portrayed in <a href="https://zappysys.com/blog/parse-multi-dimensional-json-array-ssis/#Pattern_5_8211_Multiple_Columns_with_Expressions_Google_Geocoding_API_Usecase" rel="noopener">Parse multi-dimensional JSON array in SSIS or Drivers</a> article. Just open <em>2D Array Transform</em> tab and select <strong>Multiple columns using expressions</strong> as <em>Transform Type</em> and configure them:
<div id="attachment_4970" style="width: 716px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-columns-json-parser-transform-1.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4970" class="wp-image-4970 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-columns-json-parser-transform-1.png" alt="Configuring JSON Parser Transform to parse individual address components from Google Geocoding API HTTP JSON response using SSIS." width="706" height="739" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-columns-json-parser-transform-1.png 706w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-configure-columns-json-parser-transform-1-287x300.png 287w" sizes="(max-width: 706px) 100vw, 706px" /></a><p id="caption-attachment-4970" class="wp-caption-text">Configuring JSON Parser Transform to parse individual address components from Google Geocoding API HTTP JSON response using SSIS.</p></div>
<p>We specify these columns in our example:</p><pre class="crayon-plain-tag">Number = $.address_components[?(@.types[0]=='street_number')].long_name
Street = $.address_components[?(@.types[0]=='route')].long_name
City = $.address_components[?(@.types[0]=='locality')].long_name
State = $.address_components[?(@.types[0]=='administrative_area_level_1')].long_name
Country = $.address_components[?(@.types[0]=='country')].long_name
PostalCode = $.address_components[?(@.types[0]=='postal_code')].long_name</pre><p>
</li>
<li>Finally, be sure to set <strong>Include all upstream columns to downstream</strong> (quite important), so that CustomerID is passed downstream and which we can save into a destination table. Later it can be a useful column to join the source table and the destination table on. In that way, you will be able to map user-entered addresses with looked up, fully formatted addresses (won&#8217;t be demonstrated in this tutorial).</li>
</ol>
<h3>Save geocoding results into a SQL Server database table</h3>
<ol>
<li>We are now ready to add <strong>OLE DB Destination</strong>, execute the package, make the lookups, and save the results into the database:
<div id="attachment_4971" style="width: 828px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-saving-results-into-ole-db-destination-e1538150325533.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4971" class="wp-image-4971 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-saving-results-into-ole-db-destination-e1538150325533.png" alt="Creating a database table for the Google Geocoding API looked up addresses in SSIS." width="818" height="727" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-saving-results-into-ole-db-destination-e1538150325533.png 818w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-saving-results-into-ole-db-destination-e1538150325533-300x267.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-saving-results-into-ole-db-destination-e1538150325533-768x683.png 768w" sizes="(max-width: 818px) 100vw, 818px" /></a><p id="caption-attachment-4971" class="wp-caption-text">Creating a database table for the Google Geocoding API looked up addresses in SSIS.</p></div></li>
<li>Execute the package!
<div id="attachment_4972" style="width: 705px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-lookup-results.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4972" class="wp-image-4972 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-lookup-results.png" alt="SSIS geocoding package execution and its results." width="695" height="471" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-lookup-results.png 695w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-lookup-results-300x203.png 300w" sizes="(max-width: 695px) 100vw, 695px" /></a><p id="caption-attachment-4972" class="wp-caption-text">SSIS geocoding package execution and its results.</p></div></li>
</ol>
<h3>The results of SSIS geocoding</h3>
<div id="attachment_4985" style="width: 614px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4985" class="wp-image-4985 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis.png" alt="Viewing the results of SSIS geocoding in SQL Server destination table." width="604" height="209" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis.png 604w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis-300x104.png 300w" sizes="(max-width: 604px) 100vw, 604px" /></a><p id="caption-attachment-4985" class="wp-caption-text">Viewing the results of SSIS geocoding in SQL Server destination table.</p></div>
<p style="text-align: justify;">Once you query the table of looked up results, you will notice several things:</p>
<ol style="text-align: justify;">
<li>Perhaps there are more rows in the results table than in the source table</li>
<li><em>partial_match</em> column is either <strong>1</strong> or <strong>NULL</strong></li>
<li><em>geometry.location_type </em>column has several values, e.g. <strong>ROOFTOP</strong>, <strong>RANGE_INTERPOLATED</strong>, <strong>APPROXIMATE</strong>, etc.</li>
</ol>
<p style="text-align: justify;">So to what extent should you trust the results? The answer is to take a look at <a href="https://developers.google.com/maps/documentation/geocoding/intro#Results" rel="noopener">the documentation</a> and see what these values mean.</p>
<p style="text-align: justify;">Basically, when <em>partial_match</em> is equal to <strong>1</strong>, according to Google:</p>
<ul style="text-align: justify;">
<li>Partial matches most often occur for street addresses that do not exist within the locality you pass in the request.</li>
<li>Partial matches may also be returned when a request matches two or more locations in the same locality. For example, &#8220;21 Henr St, Bristol, UK&#8221; will return a partial match for both Henry Street and Henrietta Street. Note that if a request includes a misspelled address component, the geocoding service may suggest an alternative address. Suggestions triggered in this way will also be marked as a partial match.</li>
</ul>
<p style="text-align: justify;">While <em>geometry.location_type</em> column tells how accurate the lookup was. Again, according to Google:</p>
<ul style="text-align: justify;">
<li><strong>&#8220;ROOFTOP&#8221;</strong> indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision.</li>
<li><strong>&#8220;RANGE_INTERPOLATED&#8221;</strong> indicates that the returned result reflects an approximation (usually on a road) interpolated between two precise points (such as intersections). Interpolated results are generally returned when rooftop geocodes are unavailable for a street address.</li>
<li><strong>&#8220;GEOMETRIC_CENTER&#8221;</strong> indicates that the returned result is the geometric center of a result such as a polyline (for example, a street) or polygon (region).</li>
<li><strong>&#8220;APPROXIMATE&#8221;</strong> indicates that the returned result is approximate.</li>
</ul>
<p style="text-align: justify;">Simply put, <strong>&#8220;ROOFTOP&#8221;</strong> is the most accurate lookup, while <strong>&#8220;APPROXIMATE&#8221;</strong> is the least accurate.</p>
<p style="text-align: justify;">Another valuable piece of information is how many individual address components are filled. The more <strong>NULLs</strong> are there, the less accurate is the address. So if you have <strong>NULL</strong> in the <em>Number</em> column and in the <em>Street</em> column, most likely this is not a very accurate lookup:</p>
<div id="attachment_4987" style="width: 675px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis2.png" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4987" class="wp-image-4987 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis2.png" alt="Individual address components of looked up addresses in Google Geocoding API using SSIS." width="665" height="210" srcset="https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis2.png 665w, https://zappysys.com/blog/wp-content/uploads/2018/09/ssis-google-geocoding-api-result-analysis2-300x95.png 300w" sizes="(max-width: 665px) 100vw, 665px" /></a><p id="caption-attachment-4987" class="wp-caption-text">Individual address components of looked up addresses in Google Geocoding API using SSIS.</p></div>
<p style="text-align: justify;">Concluding, in the figure above, you can see how user-entered address can be <em>validated</em>, <em>cleansed</em> and <em>formatted</em>.</p>
<h2>SSIS reverse geocoding with Google Maps API</h2>
<p>The concepts presented above about &#8220;forward&#8221; geocoding will help you to make reverse geocoding requests too. The only difference is the request URL:</p><pre class="crayon-plain-tag">https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&amp;key=YOUR_API_KEY</pre><p>
For reference and help visit official <a href="https://developers.google.com/maps/documentation/geocoding/intro#ReverseGeocoding" rel="noopener">Google Geocoding API documentation</a>.</p>
<div class="content_block" id="custom_post_widget-2021"><h2>Things have gone bad: Error handling &amp; debugging</h2>
<p style="text-align: justify;">Incidentally, bad things can happen<i>. </i>A remote server may go offline or your server may go out of memory. In any case, you may want to know when that happens and take actions accordingly. For that purpose, you have to redirect bad rows to some other destination. For this example, we will take and use <em>Web API Destination</em>, but basically, you can use any SSIS component:</p>

<h3>Handling errors</h3>
<ol style="margin-left: 0;">
 	<li>Add a <em>Derived Column</em> above <em>Web API Destination</em> with expression <strong>"(DT_WSTR,4000)ZS_JSON_OUT"</strong> and name it <strong>"JsonAsString"</strong>. This will let you see what JSON you are actually passing.</li>
 	<li>Then add a database or file destination or use another <em>Trash Destination</em> for debugging purposes and redirect the bad rows (<span style="color: #d66565;">red arrow</span>) from <em><em>Web API Destination </em></em>into it<em><em>. </em></em>Don't forget to set <span class="lang:default decode:true crayon-inline">Redirect row</span> option for both, <em>Error</em> and <em>Truncation</em> columns:<em><em>
</em></em>
<div class="wp-caption">

<a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-1487 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows.png" alt="Redirect bad rows from &lt;em&gt;Web API Destination&lt;/em&gt; to &lt;em&gt;Trash Destination&lt;/em&gt; when load from SQL Server to Elasticsearch is failing. Add derived column JsonAsString to be able to read JSON you are using." width="739" height="267" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows.png 739w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-redirecting-bad-rows-300x108.png 300w" sizes="(max-width: 739px) 100vw, 739px" /></a>
<p class="wp-caption-text">Redirected failed requests from <em>Web API Destination</em> to a desired destination when loading from SQL Server to REST API Service is failing. Derived Column <em>JsonAsString</em> added to be able to read JSON which was passed to Elasticsearch</p>

</div></li>
 	<li>Finally, add a <a href="https://technet.microsoft.com/en-us/library/ms140318%28v=sql.90%29.aspx?f=255&amp;MSPPError=-2147217396" target="_blank" rel="noopener"><em>Data Viewer</em></a> for the red path, if you want to debug the flow. You will be able to see URL, JSON and the error message for each record. You may want to copy-paste <em>ErrorMessage</em> to <em>Notepad </em>if you want it to be more readable:
<div class="wp-caption">

<a href="//zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-1494 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling.png" alt="Use Data Viewer to view HTTP requests that failed to be fulfilled in Elasticsearch" width="752" height="280" srcset="https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling.png 752w, https://zappysys.com/blog/wp-content/uploads/2017/06/ssis-sql-server-to-elasticsearch-error-handling-300x112.png 300w" sizes="(max-width: 752px) 100vw, 752px" /></a>
<p class="wp-caption-text">Use Data Viewer to view HTTP requests that failed to be fulfilled.</p>

</div></li>
</ol>
<div class="su-note" style="border-color: #e5dea5; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;">
<div class="su-note-inner su-clearfix" style="background-color: #fff7b7; border-color: #fffdf1; color: #333333; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;"><strong>NOTE</strong>: You can read more about redirecting rows in <a href="//zappysys.com/blog/ssis-error-handling-in-data-flow-redirect-bad-rows/" target="_blank" rel="noopener">SSIS Error Handling (Redirect bad rows)</a> article.</div>
</div>
<h3>Debugging HTTP requests</h3>
<p style="text-align: justify;">A common thing you have to do when working with HTTP requests is to debug those requests; e.g. to check what headers, body or URL was passed. <span id="Debug_Web_API_call_using_Fiddler"></span>To test how things look behind the scenes we strongly suggest to use <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">Fiddler</a> - a popular web debugging tool.</p>
<p style="text-align: justify;">Inside it, you can double-click the URL entry (Right side) to see Request and Response Panels. The top panel is Request (URL, Headers, Body) and Bottom Panel is Response. For https:// (secure URL) make sure you enable HTTPS option in Fiddler (Tools &gt; Options &gt; HTTPS &gt; Check Decrypt https request):</p>

<div id="attachment_2344" class="wp-caption alignnone">

<a href="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?ssl=1" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-2344 size-full" style="border: 0px; max-width: 100%; height: auto; box-shadow: rgba(0, 0, 0, 0.176) 0px 1px 2px;" src="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png" alt="Debugging Web API call using Fiddler in SSIS" width="1287" height="564" data-attachment-id="2344" data-permalink="https://zappysys.com/blog/pass-authorization-header-redirected-location/ssis-rest-api-call-debug-via-fiddler/#main" data-orig-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=1287%2C564&amp;ssl=1" data-orig-size="1287,564" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="ssis-rest-api-call-debug-via-fiddler" data-image-description="&lt;p&gt;Debugging Web API call using Fiddler in SSIS&lt;/p&gt; " data-medium-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=300%2C131&amp;ssl=1" data-large-file="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png?fit=720%2C316&amp;ssl=1" srcset="https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler.png 1287w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler-300x131.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler-768x337.png 768w, https://zappysys.com/blog/wp-content/uploads/2016/05/ssis-rest-api-call-debug-via-fiddler-1024x449.png 1024w" sizes="(max-width: 1287px) 100vw, 1287px" /></a>
<p class="wp-caption-text">Debugging Web API call using Fiddler in SSIS</p>

</div></div>
<h2>Common errors</h2>
<div class="content_block" id="custom_post_widget-1887"><h3>Truncation related error</h3>
<p style="text-align: justify;">The most common error you may face when you run an SSIS package is truncation error. During the design time only 300 rows are scanned from a source (a file or a REST API call response) to detect datatypes but at runtime, it is likely you will retrieve far more records. So it is possible that you will get longer strings than initially expected. For detailed instructions on how to fix common metadata related errors read an article "<a href="//zappysys.com/blog/handling-ssis-component-metadata-issues/" target="_blank" rel="noopener">How to handle SSIS errors (truncation, metadata issues)</a>".</p>

<h3>Authentication related error</h3>
Another frequent error you may get is an authentication error, which happens when you deploy/copy a package to another machine and run it there. Check <a href="#Deployment_to_Production">the paragraph below</a> to see why it happens and how to solve this problem.</div>
<h2><span id="Deployment_to_Production">Parameterization and d</span><span id="Deployment_to_Production">eployment to production </span></h2>
<div class="content_block" id="custom_post_widget-1932"><p style="text-align: justify;">In SSIS package <a href="https://docs.microsoft.com/en-us/sql/integration-services/security/access-control-for-sensitive-data-in-packages" target="_blank" rel="noopener">sensitive data such as tokens and passwords are by default encrypted by SSIS</a> with your Windows account which you use to create a package. So SSIS will fail to decrypt tokens/passwords when you run it from another machine using another Windows account. To circumvent this when you are creating an SSIS package which uses authentication components (e.g. an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-oauth-connection-manager.htm" target="_blank" rel="noopener">OAuth Connection Manager</a> or an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-http-connection-manager.htm" target="_blank" rel="noopener">HTTP Connection Manager</a> with credentials, etc.), consider using parameters/variables to pass tokens/passwords. In this way, you won’t face authentication related errors when a package is deployed to a production server.</p>
<p style="text-align: justify;">Check our article on <a href="https://zappysys.com/blog/how-to-run-an-ssis-package-with-sensitive-data-on-sql-server/" target="_blank" rel="noopener">how to configure packages with sensitive data on your production or development server</a>.</p></div>
<h2>Download a sample package</h2>
<p style="text-align: justify;">Be sure to download a <a href="https://zappysys.com/blog/wp-content/uploads/2018/09/SSIS-Geocoding-using-Google-Maps-API.zip">sample SQL Server 2012 SSIS package</a>, in case you want to try it right away (you can upgrade it to a higher version). If you want to use the database that was used in this tutorial, don&#8217;t forget to create the <a href="https://zappysys.com/blog/wp-content/uploads/2018/09/Marketing-database-script.zip">Marketing database from the script</a> (a modified Microsoft&#8217;s Northwind database).</p>
<h2>Conclusion</h2>
<p style="text-align: justify;">In this tutorial, we step-by-step covered how to make geocoding lookups using Geocoding API, part of Google Maps API. We learned how to <em>cleanse</em>, <em>validate</em> and <em>format</em> address just by submitting it to Geocoding API and parsing the results. We moved forward and looked at how to interpret the results and what geocoding results to trust. Then we touched the point that the same process could be applied to <a href="https://developers.google.com/maps/documentation/geocoding/intro#ReverseGeocoding" rel="noopener"><em>reverse geocoding</em></a>. Concluding, we took a look at how to handle common errors and how to parameterize an SSIS package and deploy it to production.</p>
<p>The post <a href="https://zappysys.com/blog/ssis-geocoding-with-google-maps-api/">SSIS Geocoding with Google Maps API</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
