AskGeo .NET  1.1.0
AskGeo Libraries for .NET
 All Classes Namespaces Functions Variables Enumerations Pages
Public Member Functions
AskGeo.Dbl.ResultBase Class Reference

The base class of all result classes. Each subclass of GeneralMap has a companion result class that is itself a subclass of ResultBase. Those result classes are what are returned when a map is queried. More...

Inheritance diagram for AskGeo.Dbl.ResultBase:
AskGeo.Dbl.NaturalEarthCountryResult AskGeo.Dbl.TimeZoneResult AskGeo.Dbl.UsCensusResultBase AskGeo.Dbl.UsBlockGroupHighResult AskGeo.Dbl.UsBlockGroupLowResult AskGeo.Dbl.UsCountyHighResult AskGeo.Dbl.UsCountyLowResult AskGeo.Dbl.UsCountySubdivisionHighResult AskGeo.Dbl.UsCountySubdivisionLowResult AskGeo.Dbl.UsPlaceHighResult AskGeo.Dbl.UsPlaceLowResult AskGeo.Dbl.UsStateHighResult AskGeo.Dbl.UsStateLowResult AskGeo.Dbl.UsTractHighResult AskGeo.Dbl.UsTractLowResult AskGeo.Dbl.UsZctaHighResult

List of all members.

Public Member Functions

override String ToString ()
 The string representation of a result is a tab-separated concatenation of all the data fields.
PolygonData GetPolygonData ()
 Returns the polygon data for the shape from which this result was built
int GetAskGeoId ()
 Within each map, every shape has a unique int ID.
bool GetIsInside ()
 Query points that are not within any of the shapes in the map will snap-to the nearest shape if that shape is within a specified snap-to radius. This method returns whether the this particular query point was inside the shape from which this result was built.
double GetMinDistanceKm ()
 Query points that are not within any of the shapes in the map will snap-to the nearest shape if that shape is within a specified snap-to radius. If the query point was inside the shape, this method returns zero. If the query point was outside the shape, this method returns the smallest distance (in km) along the surface of the globe between the query point and the outer boundary of the shape.
String GetResultField (DataFieldInterface f)
 The AskGeo ID, the isInside bool, and the minDistanceKm may be accessed by the direct accessors getAskGeoId, getIsInside, and getMinDistanceKm. They may also be accessed by using this method with the ResultField enum.
String GetDataField (DataFieldInterface e)
 Each map has metadata associated with each shape. That metadata is returned with results built from that shape. This method gives access to that metadata using a DataField enum. Each map has an public inner enum called DataField. Passing
double ParseDoubleOrNan (String text)
 All data fields are stored as strings but many are more useful as numbers. This method converts a String to a double. If the conversion fails, double.NaN is returned.
int ParseIntOrElse (String text, int alt)
 All data fields are stored as strings but many are more useful as numbers. This method converts a String to an int. If the conversion fails, alt is returned.

Detailed Description

The base class of all result classes. Each subclass of GeneralMap has a companion result class that is itself a subclass of ResultBase. Those result classes are what are returned when a map is queried.

Maps may be configured so that if a given query point does not lie inside any of the shapes in the map, then it will snap to a nearby shape if it is within a specified distance of the query point. The getIsInside method return whether the query point was inside the shape or not, and the getMinDistanceKm method returns the distance from the query point to the shape in kilometers (or zero if it is inside the shape).


Member Function Documentation

int AskGeo.Dbl.ResultBase.GetAskGeoId ( )

Within each map, every shape has a unique int ID.

Returns:
the ID of the shape from which this result was built.
String AskGeo.Dbl.ResultBase.GetDataField ( DataFieldInterface  e)

Each map has metadata associated with each shape. That metadata is returned with results built from that shape. This method gives access to that metadata using a DataField enum. Each map has an public inner enum called DataField. Passing

Parameters:
eis a DataField enum value from the public inner enum within the map class from which this result was generated.
Returns:
the string representation of the requested data field.
bool AskGeo.Dbl.ResultBase.GetIsInside ( )

Query points that are not within any of the shapes in the map will snap-to the nearest shape if that shape is within a specified snap-to radius. This method returns whether the this particular query point was inside the shape from which this result was built.

Returns:
whether the query point was inside the shape from which this result was built.
double AskGeo.Dbl.ResultBase.GetMinDistanceKm ( )

Query points that are not within any of the shapes in the map will snap-to the nearest shape if that shape is within a specified snap-to radius. If the query point was inside the shape, this method returns zero. If the query point was outside the shape, this method returns the smallest distance (in km) along the surface of the globe between the query point and the outer boundary of the shape.

Returns:
the distance in kilometers between the query point and the shape, along the shortest path between them.
PolygonData AskGeo.Dbl.ResultBase.GetPolygonData ( )

Returns the polygon data for the shape from which this result was built

Returns:
the polygon data.
String AskGeo.Dbl.ResultBase.GetResultField ( DataFieldInterface  f)

The AskGeo ID, the isInside bool, and the minDistanceKm may be accessed by the direct accessors getAskGeoId, getIsInside, and getMinDistanceKm. They may also be accessed by using this method with the ResultField enum.

Parameters:
fis a ResultField enum value (either ResultField.AskGeoId, ResultField.IsInside, or ResultField.MinDistanceKm).
Returns:
a string representation of the given result field.
double AskGeo.Dbl.ResultBase.ParseDoubleOrNan ( String  text)

All data fields are stored as strings but many are more useful as numbers. This method converts a String to a double. If the conversion fails, double.NaN is returned.

Parameters:
textthe string representation of a double.
Returns:
the double value of this String, or double.NaN if the conversion fails.
int AskGeo.Dbl.ResultBase.ParseIntOrElse ( String  text,
int  alt 
)

All data fields are stored as strings but many are more useful as numbers. This method converts a String to an int. If the conversion fails, alt is returned.

Parameters:
texttext the string representation of a double.
altalt the int to return if the parsing fails.
Returns:
the double value of this String, or alt if the parsing fails.
override String AskGeo.Dbl.ResultBase.ToString ( )

The string representation of a result is a tab-separated concatenation of all the data fields.

Returns:
the string representation of the result.

Reimplemented in AskGeo.Dbl.UsCensusResultBase.


The documentation for this class was generated from the following file: