public class

GeocodingRequest

extends Object
java.lang.Object
   ↳ com.carto.geocoding.GeocodingRequest

Class Overview

A geocoding request describing text-based query and other optional constraints.

Summary

Public Constructors
GeocodingRequest(Projection projection, String query)
Constructs a new GeocodingRequest object from a projection and a string-based query.
Public Methods
synchronized void delete()
boolean equals(Object obj)
Checks if this object is equal to the specified object.
Variant getCustomParameter(String param)
Returns the custom parameter value of the request.
MapPos getLocation()
Returns the location attribute of the request.
float getLocationRadius()
Returns the location radius attribute of the request (in meters).
Projection getProjection()
Returns the projection of the request.
String getQuery()
Returns the text-based query of the request.
int hashCode()
Returns the hash value of this object.
void setCustomParameter(String param, Variant value)
Sets a custom parameter value for the the request.
void setLocation(MapPos pos)
Sets the location attribute of the request.
void setLocationRadius(float radius)
Sets the location radius attribute of the request.
String toString()
Creates a string representation of this request object, useful for logging.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public GeocodingRequest (Projection projection, String query)

Constructs a new GeocodingRequest object from a projection and a string-based query.

Parameters
projection The projection to use for the result and location data.
query The text-based query.

Public Methods

public synchronized void delete ()

public boolean equals (Object obj)

Checks if this object is equal to the specified object.

Parameters
obj The reference object.
Returns
  • True when objects are equal, false otherwise.

public Variant getCustomParameter (String param)

Returns the custom parameter value of the request.

Parameters
param The name of the parameter to return.
Returns
  • The value of the parameter. If the parameter does not exist, empty variant is returned.

public MapPos getLocation ()

Returns the location attribute of the request.
The matching address near the specified location (up to a specified radius) are preferred.

Returns
  • The location attribute of the request.

public float getLocationRadius ()

Returns the location radius attribute of the request (in meters).

Returns
  • The location radius attribute of the request in meters.

public Projection getProjection ()

Returns the projection of the request.

Returns
  • The projection of the request.

public String getQuery ()

Returns the text-based query of the request.

Returns
  • The text-based query of the request.

public int hashCode ()

Returns the hash value of this object.

Returns
  • The hash value of this object.

public void setCustomParameter (String param, Variant value)

Sets a custom parameter value for the the request.

Parameters
param The name of the parameter. For example, "ranking.location_sigma".
value The new value for the parameter.

public void setLocation (MapPos pos)

Sets the location attribute of the request.
The matching address near the specified location (up to a specified radius) are preferred.

Parameters
pos The new location for the request.

public void setLocationRadius (float radius)

Sets the location radius attribute of the request.
The default is 0, which means that location based ranking is not applied.

Parameters
radius The location radius attribute of the request in meters.

public String toString ()

Creates a string representation of this request object, useful for logging.

Returns
  • The string representation of this request object.