Changes

1,139 bytes added ,  16:56, 30 September 2013
Created page with "Will return the name and location of the closest city in the spatial map to the specified road in the spatial map. The road is specified by the start and end cities. Since roa..."
Will return the name and location of the closest city in the spatial map to the specified road in the spatial map. The road is specified by the start and end cities. Since roads are undirected, specifying [start=A,end=B] is identical to specifying [start=B,end=A]. Obviously the city will not be one of the endpoints of the road or this command would be trivial. Ties broken by the city with the asciibetically least name.

== Parameters (In output order) ==
* start
* end

== Possible ''<output>'' ==
The output will contain one city tag which is the nearest city (isolated or not). This is an example of a city tag:
<code>
<city name="city1" x="coordx" y="coordy" color="color1" radius="radius1"/>
</code>

== Possible ''<error>'' types ==
* roadIsNotMapped
* noOtherCitiesMapped

== ''<success>'' Example ==
<code>
<success>
<command name="nearestCityToRoad" id="14">
<parameters>
<start value="Annapolis"/>
<end value="Derwood"/>
</parameters>
<output>
<city name="CollegePark" x="20" y="30" color="red" radius="12"/>
</output>
</success>
</code>
editor
68

edits