Select to view content in your preferred language

Locator AddressToLocations format change - No results

553
3
01-20-2012 05:52 AM
DarellStoick
Occasional Contributor
Using a locator build with in 10.0.2 the AddressToLocations method accepted the following for a Single line Input AddressToLocationsParameters

SingleLine, -77.93907 34.2561

It appears for locators built with versions 10.0.3 (locator is labeled 10.1 already) the format has changed to

SingleLine, -77.93907,34.2561


Without the comma the request returns no results, of course, request to 10.0.2 with the comma also returns no results. So we are checking the version of the locator and suppling the correct format based on the version. (Json request)

Good luck
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
What version of the API are you using? Have you tried making the web request outside your Silverlight app? You can run Fiddler to see what parameters your app is using and set the same parameters from your web browser when you go to REST endpoint. I am not aware of format change between server versions so I wanted to know if we can identify the issue. Thanks.
0 Kudos
DarellStoick
Occasional Contributor
Jennifer,

I can duplicate it using the rest endpoint's- findaddresscandidates


.../findAddressCandidates?Street=&City=&SingleLine=-77.93907+34.25611&outFields=&outSR=&f=html

...findAddressCandidates?Street=&City=&ZIP=&SingleLine=-77.93907%2C+34.25611&outFields=&outSR=&f=html

The first works for locators build with 10.0.2 and not in 10.0.3
the second works for locators build with 10.0.3 and not in 10.0.2


from our application it ends up being the pretty much the same (running Fiddler)
.../findAddressCandidates?SingleLine=-77.93907%2c34.25611&f=json&

I think it has more to do with what version the locators have been created with than the silverlight API version but we are running 2.3. If you need us to we can make the two locators accessible for outside our network.

Thanks

Darell
Geo-Comm
0 Kudos
BradNiemand
Esri Regular Contributor
This was a locator change.  We now require a "CoordSeparator" between the two coordinates and we allow for the space between the "CoordSeparator" and the second coordinate to be optional (before it was required and that is why it doesn't match with the 10.0.2 locator).

Valid inputs (comma below can be replaced with ";" or "|" as well):
coord,coord
coord , coord
coord, coord
coord ,coord

Locator definition in the XML file is below. If needed, line 10 below can be uncommented to allow for no separator but if that is done, also change the pre_separator to "required" for the "latitudePrefix" element below.  We won't ship any locators this way because we saw some strange address parsing but if it is a necessity, proceed with caution.  If not, I would suggest to require the "CoordSeparator" and edit the 10.0.2 locator to have pre_separator "optional" for the "CoordSeparator" or just use the 10.0.3 locator.
      <section desc="Coordinates">
        <def name="OptCoordsysID">
          <alt>WGS_1984</alt>
          <alt/>
        </def>
        <def name="CoordSeparator">
          <alt>,</alt>
          <alt>;</alt>
          <alt>|</alt>
          <!--<alt/>-->
        </def>
        <def name="Coordinates">
          <alt>
            <elt ref="longitudePrefix"/>
            <elt ref="positiveRealNumber" pre_separator="optional"/>
            <elt ref="CoordSeparator" pre_separator="optional"/>
            <elt ref="latitudePrefix" pre_separator="optional"/>
            <elt ref="positiveRealNumber" pre_separator="optional"/>
            <elt ref="OptCoordsysID"/>
            <result tag="Coordinates">
              <method ref="create_point">
                <init_properties>
                  <prop name="CoordinateSystem">WGS_1984</prop>
                </init_properties>
                <parameter>
                  <component_value component="_1"/>
                </parameter>
                <parameter>
                  <component_value component="_2"/>
                </parameter>
                <parameter>
                  <component_value component="_4"/>
                </parameter>
                <parameter>
                  <component_value component="_5"/>
                </parameter>
                <parameter>
                  <component_value component="_6"/>
                </parameter>
              </method>
            </result>
          </alt>
        </def>
        <def name="longitudePrefix">
          <alt>w</alt>
          <alt>e</alt>
          <alt>-</alt>
          <alt>+</alt>
          <alt/>
        </def>
        <def name="latitudePrefix">
          <alt>n</alt>
          <alt>s</alt>
          <alt>-</alt>
          <alt>+</alt>
          <alt/>
        </def>
      </section>


Brad
0 Kudos