Skip to content

Commit

Permalink
feat(arcgis): updating the parameter objects to include new parameter…
Browse files Browse the repository at this point in the history
…s for endpoints (#91)

Closes #88
  • Loading branch information
JustinCanton authored Dec 30, 2023
1 parent a8951f1 commit 0c9028a
Show file tree
Hide file tree
Showing 9 changed files with 500 additions and 26 deletions.
30 changes: 4 additions & 26 deletions src/Geo.ArcGIS/Models/Parameters/AddressAttributeParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

namespace Geo.ArcGIS.Models.Parameters
{
using Newtonsoft.Json;

/// <summary>
/// The geocoding address parameters.
/// </summary>
public class AddressAttributeParameter
public class AddressAttributeParameter : AddressParameters
{
/// <summary>
/// Gets or sets a UNIQUE value used for identifying the address.
Expand All @@ -19,31 +21,7 @@ public class AddressAttributeParameter
/// Gets or sets the single line representation of the address.
/// If this is passed in, the other fields will be ignored.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string SingleLine { get; set; }

/// <summary>
/// Gets or sets the address of the location.
/// </summary>
public string Address { get; set; }

/// <summary>
/// Gets or sets the neighbourhood of the location.
/// </summary>
public string Neighbourhood { get; set; }

/// <summary>
/// Gets or sets the city of the location.
/// </summary>
public string City { get; set; }

/// <summary>
/// Gets or sets the subregion of the location.
/// </summary>
public string Subregion { get; set; }

/// <summary>
/// Gets or sets the region of the location.
/// </summary>
public string Region { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@ public class AddressCandidateParameters : StorageParameters
/// Gets or sets the address you want to geocode as a single line of text.
/// </summary>
public string SingleLineAddress { get; set; }

/// <summary>
/// Gets or sets an ID attribute value that, along with the text attribute, links a suggestion to an address or place.
/// </summary>
public string MagicKey { get; set; }
}
}
78 changes: 78 additions & 0 deletions src/Geo.ArcGIS/Models/Parameters/AddressParameters.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// <copyright file="AddressParameters.cs" company="Geo.NET">
// Copyright (c) Geo.NET.
// Licensed under the MIT license. See the LICENSE file in the solution root for full license information.
// </copyright>

namespace Geo.ArcGIS.Models.Parameters
{
using Newtonsoft.Json;

/// <summary>
/// A parameters object for the address information for a ArcGIS request.
/// </summary>
public class AddressParameters
{
/// <summary>
/// Gets or sets the address of the location.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string Address { get; set; }

/// <summary>
/// Gets or sets a string that represents the second line of a street address.
/// This can include street name/house number, building name, place-name, or subunit.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string Address2 { get; set; }

/// <summary>
/// Gets or sets a string that represents the third line of a street address.
/// This can include street name/house number, building name, place-name, or subunit.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string Address3 { get; set; }

/// <summary>
/// Gets or sets the neighbourhood of the location.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string Neighbourhood { get; set; }

/// <summary>
/// Gets or sets the city of the location.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string City { get; set; }

/// <summary>
/// Gets or sets the subregion of the location.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string Subregion { get; set; }

/// <summary>
/// Gets or sets the region of the location.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string Region { get; set; }

/// <summary>
/// Gets or sets the standard postal code for an address, typically, a three– to six-digit alphanumeric code.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string Postal { get; set; }

/// <summary>
/// Gets or sets a postal code extension, such as the United States Postal Service ZIP+4 code, provides finer resolution or higher accuracy when also passing postal.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string PostalExt { get; set; }

/// <summary>
/// Gets or sets a value representing the country. Providing this value increases geocoding speed.
/// Acceptable values include the full country name in English or the official language of the country, the two-character country code, or the three-character country code.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string CountryCode { get; set; }
}
}
82 changes: 82 additions & 0 deletions src/Geo.ArcGIS/Models/Parameters/PlaceCandidateParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,68 @@

namespace Geo.ArcGIS.Models.Parameters
{
using System.Globalization;
using Geo.ArcGIS.Enums;
using Geo.ArcGIS.Models.Responses;

/// <summary>
/// A parameters object for the place candidates ArcGIS request.
/// </summary>
public class PlaceCandidateParameters : StorageParameters
{
/// <summary>
/// Gets or sets the address of the location.
/// </summary>
public string Address { get; set; }

/// <summary>
/// Gets or sets a string that represents the second line of a street address.
/// This can include street name/house number, building name, place-name, or subunit.
/// </summary>
public string Address2 { get; set; }

/// <summary>
/// Gets or sets a string that represents the third line of a street address.
/// This can include street name/house number, building name, place-name, or subunit.
/// </summary>
public string Address3 { get; set; }

/// <summary>
/// Gets or sets the neighbourhood of the location.
/// </summary>
public string Neighbourhood { get; set; }

/// <summary>
/// Gets or sets the city of the location.
/// </summary>
public string City { get; set; }

/// <summary>
/// Gets or sets the subregion of the location.
/// </summary>
public string Subregion { get; set; }

/// <summary>
/// Gets or sets the region of the location.
/// </summary>
public string Region { get; set; }

/// <summary>
/// Gets or sets the standard postal code for an address, typically, a three– to six-digit alphanumeric code.
/// </summary>
public string Postal { get; set; }

/// <summary>
/// Gets or sets a postal code extension, such as the United States Postal Service ZIP+4 code, provides finer resolution or higher accuracy when also passing postal.
/// </summary>
public string PostalExt { get; set; }

/// <summary>
/// Gets or sets a value representing the country. Providing this value increases geocoding speed.
/// Acceptable values include the full country name in English or the official language of the country, the two-character country code, or the three-character country code.
/// </summary>
public string CountryCode { get; set; }

/// <summary>
/// gets or sets the type of places to search for such as Restaurants, Coffee Shop, Gas Stations.
/// </summary>
Expand All @@ -22,12 +77,39 @@ public class PlaceCandidateParameters : StorageParameters
/// </summary>
public Coordinate Location { get; set; }

/// <summary>
/// Gets or sets the spatial reference of the x/y coordinates returned by a geocode request.
/// For a list of valid WKID values, see Projected coordinate systems and Geographic coordinate systems
/// (https://developers.arcgis.com/rest/services-reference/geographic-coordinate-systems.htm).
/// </summary>
public int OutSpatialReference { get; set; }

/// <summary>
/// Gets or sets a set of bounding box coordinates that limit the search area for suggestions to a specific region.
/// </summary>
public BoundingBox SearchExtent { get; set; }

/// <summary>
/// Gets or sets the maximum number of candidates to return.
/// The maximum allowable is 50.
/// The minimum is 1.
/// If any other value is specified, then all matching candidates up to the service maximum are returned.
/// </summary>
public uint MaximumLocations { get; set; } = 0;

/// <summary>
/// Gets or sets the language in which reverse-geocoded addresses are returned.
/// Addresses in many countries are available in more than one language;
/// in these cases the LanguageCode parameter can be used to specify which language should be used for addresses returned by the reverseGeocode operation.
/// See the table of supported countries for valid language code values in each country
/// (https://developers.arcgis.com/rest/geocode/api-reference/geocode-coverage.htm#GUID-D61FB53E-32DF-4E0E-A1CC-473BA38A23C0).
/// </summary>
public CultureInfo LanguageCode { get; set; }

/// <summary>
/// Gets or sets a value that specifies if the output geometry of PointAddress and Subaddress matches should be the rooftop point or street entrance location.
/// The default value is rooftop.
/// </summary>
public LocationType LocationType { get; set; } = LocationType.Rooftop;
}
}
23 changes: 23 additions & 0 deletions src/Geo.ArcGIS/Models/Parameters/SuggestParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

namespace Geo.ArcGIS.Models.Parameters
{
using System.Collections.Generic;
using System.Globalization;
using Geo.ArcGIS.Enums;
using Geo.ArcGIS.Models.Responses;

/// <summary>
Expand Down Expand Up @@ -42,5 +45,25 @@ public class SuggestParameters
/// If any other value is specified, the default value is used.
/// </summary>
public uint MaximumLocations { get; set; } = 5;

/// <summary>
/// Gets or sets a value representing the country. Providing this value increases geocoding speed.
/// Acceptable values include the full country name in English or the official language of the country, the two-character country code, or the three-character country code.
/// </summary>
public string CountryCode { get; set; }

/// <summary>
/// Gets a value representing the country. When a value is passed for this parameter,
/// all of the addresses in the input table are sent to the specified country to be geocoded.
/// You can specify multiple country codes to limit results to more than one country.
/// </summary>
public IList<RegionInfo> SourceCountry { get; } = new List<RegionInfo>();

/// <summary>
/// Gets or sets a configuration of output fields returned in a response from the
/// ArcGIS World Geocoding Service by specifying which address component values should be included in output fields.
/// The default value is postal city.
/// </summary>
public PreferredLabelValue PreferredLabelValue { get; set; } = PreferredLabelValue.PostalCity;
}
}
Loading

0 comments on commit 0c9028a

Please sign in to comment.