Obtaining Geocoding Address Data

Topics:

The police department has an address of a theft that they want to include in the crime pattern analysis that the GIS will perform. The first step is to obtain the data required by the GIS, the latitude and longitude of the theft address. To do this, they must:

  1. Create a geocoding target that defines the path to the location data source (latitude and longitude data).
  2. Connect to the target, which is the location data directory.
  3. Generate and save schemas for the geocoding XML request and response documents.
  4. Use an XML editor to create the request and response documents based on these schemas.
  5. Create a geocoding service and a method for the service. In this case, it is the geocoding method.

Geocoding Request Document

The address from the police database to be geocoded is 1306 Forest View Drive, Avenel, NJ 07001. The following is the geocoding XML request document that contains this address within the <record> tags.

<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSPY v5 rel. 4 U
    (http://www.xmlspy.com)-->
<address_geocoding_request 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:noNamespaceSchemaLocation=
               "http://siva.ibi.com:9000/schemas/service/
    GeoLoad/Geocode/S9892524/GeoCoding_request.xsd">
      <record>
            <street>1306 forest view drive</street>
            <city>avenel</city>
            <state>new jersey</state>
            <country>USA</country>
            <zipcode>07001</zipcode>
      </record>
</address_geocoding_request>

This XML request document is sent in a geocoding service call to retrieve the latitude and longitude of this address.

Geocoding Response Document

The geocoding service matches the address in the request document to the latitude and longitude in the location data source. The following geocoding XML response document is returned with the original address information and the latitude and longitude (and other geographic information, such as block number and group) for the address. Note that:

  • the <Locator> tag begins the geographic information related to the address.
  • the <Matched_Status>OK</Matched_Status> statement indicates that the address was found in the location data source.
<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <SOAP-ENV:Body>
    <SelectResponse xmlns="urn:iwaysoftware:ibse:jul2003:Select:response"
                          cid="1CA0EF7E48A66E61BBE191517CE619C9">
      <address_geocoding_response>
        <record>
          <street>1306 forest view drive</street>
          <city>avenel</city>
          <state>new jersey</state>
          <country>USA</country>
          <zipcode>07001</zipcode>
            <Locator>
              <locationX>-74.263965</locationX>
              <locationY>40.580023</locationY>
              <XYScale>1</XYScale>
              <Standard_Street_Name>FOREST VIEW DR</Standard_Street_Name>
              <Standard_City_Name>AVENEL</Standard_City_Name> 
              <Standard_State_Name>NJ</Standard_State_Name>
              <Standard_Country_Name>US</Standard_Country_Name> 
              <Standard_Zipcode>07001</Standard_Zipcode>
              <Rationale />
              <Block>6002</Block>
              <Block_Group>6</Block_Group>
              <Cbsa>14220</Cbsa>
              <County>117</County>
              <Matched_Side>L</Matched_Side>
              <Matched_Status>OK</Matched_Status>
              <Mcd>95695</Mcd>
              <Msa>0</Msa>
              <Place>0</Place>
              <Previous_Msa>0</Previous_Msa>
              <State_Fips />
              <Tract>950300</Tract>
            </Locator>
        </record>
      </address_geocoding_response>
   </SelectResponse>
  </SOAP-ENV:Body>
 </SOAP-ENV:Envelope>