Documentation
¶
Overview ¶
Package geoapify provides a Go client for the GeoApify Location Platform APIs.
Create a client with your API key and use the fluent builder pattern to construct and execute API requests:
client := geoapify.NewClient("YOUR_API_KEY")
results, err := client.Geocoding().
Search("1313 Broadway, Tacoma, WA").
WithLimit(5).
Do(ctx)
Index ¶
- func CircleBias(lon, lat, radiusMeters float64) string
- func CircleFilter(lon, lat, radiusMeters float64) string
- func CountryBias(codes ...string) string
- func CountryFilter(codes ...string) string
- func PlaceFilter(placeID string) string
- func ProximityBias(lon, lat float64) string
- func RectBias(lon1, lat1, lon2, lat2 float64) string
- func RectFilter(lon1, lat1, lon2, lat2 float64) string
- type APIError
- type Address
- type AutocompleteRequest
- func (r *AutocompleteRequest) Do(ctx context.Context) (*GeocodingResponse, error)
- func (r *AutocompleteRequest) WithBias(biases ...string) *AutocompleteRequest
- func (r *AutocompleteRequest) WithFilter(filters ...string) *AutocompleteRequest
- func (r *AutocompleteRequest) WithFormat(f Format) *AutocompleteRequest
- func (r *AutocompleteRequest) WithLang(v string) *AutocompleteRequest
- func (r *AutocompleteRequest) WithType(t LocationType) *AutocompleteRequest
- type BatchForwardRequest
- func (r *BatchForwardRequest) Do(ctx context.Context) (*BatchJobResponse, error)
- func (r *BatchForwardRequest) WithBias(biases ...string) *BatchForwardRequest
- func (r *BatchForwardRequest) WithFilter(filters ...string) *BatchForwardRequest
- func (r *BatchForwardRequest) WithLang(v string) *BatchForwardRequest
- func (r *BatchForwardRequest) WithType(t LocationType) *BatchForwardRequest
- type BatchGeocodingService
- func (s *BatchGeocodingService) GetForwardResult(jobID string) *BatchResultRequest
- func (s *BatchGeocodingService) GetReverseResult(jobID string) *BatchResultRequest
- func (s *BatchGeocodingService) SubmitForward(addresses []string) *BatchForwardRequest
- func (s *BatchGeocodingService) SubmitReverse(coordinates [][2]float64) *BatchReverseRequest
- type BatchJobResponse
- type BatchResultRequest
- type BatchResultResponse
- type BatchReverseRequest
- type BoundariesConsistsOfRequest
- func (r *BoundariesConsistsOfRequest) Do(ctx context.Context) (*GeoJSONFeatureCollection, error)
- func (r *BoundariesConsistsOfRequest) WithBoundary(b BoundaryType) *BoundariesConsistsOfRequest
- func (r *BoundariesConsistsOfRequest) WithGeometry(g GeometryType) *BoundariesConsistsOfRequest
- func (r *BoundariesConsistsOfRequest) WithLang(v string) *BoundariesConsistsOfRequest
- func (r *BoundariesConsistsOfRequest) WithSublevel(n int) *BoundariesConsistsOfRequest
- type BoundariesPartOfRequest
- func (r *BoundariesPartOfRequest) Do(ctx context.Context) (*GeoJSONFeatureCollection, error)
- func (r *BoundariesPartOfRequest) WithBoundary(b BoundaryType) *BoundariesPartOfRequest
- func (r *BoundariesPartOfRequest) WithGeometry(g GeometryType) *BoundariesPartOfRequest
- func (r *BoundariesPartOfRequest) WithLang(v string) *BoundariesPartOfRequest
- type BoundariesService
- type BoundaryType
- type Client
- func (c *Client) BatchGeocoding() *BatchGeocodingService
- func (c *Client) Boundaries() *BoundariesService
- func (c *Client) Geocoding() *GeocodingService
- func (c *Client) IPGeolocation() *IPGeolocationService
- func (c *Client) Isolines() *IsolinesService
- func (c *Client) MapMatching() *MapMatchingService
- func (c *Client) PlaceDetails() *PlaceDetailsService
- func (c *Client) Places() *PlacesService
- func (c *Client) Postcode() *PostcodeService
- func (c *Client) RouteMatrix() *RouteMatrixService
- func (c *Client) RoutePlanner() *RoutePlannerService
- func (c *Client) Routing() *RoutingService
- type Datasource
- type Format
- type GeoJSONFeature
- type GeoJSONFeatureCollection
- type GeoJSONGeometry
- type GeocodingParsed
- type GeocodingQuery
- type GeocodingResponse
- type GeocodingService
- type GeometryType
- type IPGeolocationRequest
- type IPGeolocationResponse
- type IPGeolocationService
- type IPLocationCity
- type IPLocationContinent
- type IPLocationCoords
- type IPLocationCountry
- type IPLocationLang
- type IPLocationState
- type IsolineRequest
- func (r *IsolineRequest) Do(ctx context.Context) (*GeoJSONFeatureCollection, error)
- func (r *IsolineRequest) WithAvoid(avoids ...string) *IsolineRequest
- func (r *IsolineRequest) WithMaxSpeed(n int) *IsolineRequest
- func (r *IsolineRequest) WithMode(m TravelMode) *IsolineRequest
- func (r *IsolineRequest) WithRange(ranges ...int) *IsolineRequest
- func (r *IsolineRequest) WithRouteType(rt RouteType) *IsolineRequest
- func (r *IsolineRequest) WithTraffic(t TrafficModel) *IsolineRequest
- func (r *IsolineRequest) WithType(t IsolineType) *IsolineRequest
- func (r *IsolineRequest) WithUnits(u Units) *IsolineRequest
- type IsolineType
- type IsolinesService
- type LegStep
- type Location
- type LocationType
- type MapMatchingRequest
- type MapMatchingService
- type MapMatchingWaypoint
- type Option
- type PlaceDetailsRequest
- type PlaceDetailsService
- type PlacesRequest
- func (r *PlacesRequest) Do(ctx context.Context) (*GeoJSONFeatureCollection, error)
- func (r *PlacesRequest) WithBias(biases ...string) *PlacesRequest
- func (r *PlacesRequest) WithConditions(conditions ...string) *PlacesRequest
- func (r *PlacesRequest) WithFilter(filters ...string) *PlacesRequest
- func (r *PlacesRequest) WithLang(v string) *PlacesRequest
- func (r *PlacesRequest) WithLimit(n int) *PlacesRequest
- func (r *PlacesRequest) WithName(v string) *PlacesRequest
- func (r *PlacesRequest) WithOffset(n int) *PlacesRequest
- type PlacesService
- type PlannerAgent
- type PlannerAgentResult
- type PlannerBreak
- type PlannerJob
- type PlannerLocation
- type PlannerRouteStep
- type PlannerShipment
- type PlannerShipmentStop
- type PostcodeRequest
- func (r *PostcodeRequest) Do(ctx context.Context) (*GeoJSONFeatureCollection, error)
- func (r *PostcodeRequest) WithBias(biases ...string) *PostcodeRequest
- func (r *PostcodeRequest) WithFilter(filters ...string) *PostcodeRequest
- func (r *PostcodeRequest) WithFormat(f Format) *PostcodeRequest
- func (r *PostcodeRequest) WithGeometry(g GeometryType) *PostcodeRequest
- func (r *PostcodeRequest) WithLang(v string) *PostcodeRequest
- func (r *PostcodeRequest) WithLimit(n int) *PostcodeRequest
- type PostcodeService
- type Rank
- type ReverseGeocodingRequest
- func (r *ReverseGeocodingRequest) Do(ctx context.Context) (*GeocodingResponse, error)
- func (r *ReverseGeocodingRequest) WithFormat(f Format) *ReverseGeocodingRequest
- func (r *ReverseGeocodingRequest) WithLang(v string) *ReverseGeocodingRequest
- func (r *ReverseGeocodingRequest) WithLimit(n int) *ReverseGeocodingRequest
- func (r *ReverseGeocodingRequest) WithType(t LocationType) *ReverseGeocodingRequest
- type Route
- type RouteDetail
- type RouteLeg
- type RouteMatrixAvoid
- type RouteMatrixEntry
- type RouteMatrixRequest
- func (r *RouteMatrixRequest) Do(ctx context.Context) (*RouteMatrixResponse, error)
- func (r *RouteMatrixRequest) Sources(locations ...Location) *RouteMatrixRequest
- func (r *RouteMatrixRequest) Targets(locations ...Location) *RouteMatrixRequest
- func (r *RouteMatrixRequest) WithAvoid(avoids ...RouteMatrixAvoid) *RouteMatrixRequest
- func (r *RouteMatrixRequest) WithMaxSpeed(n int) *RouteMatrixRequest
- func (r *RouteMatrixRequest) WithMode(mode TravelMode) *RouteMatrixRequest
- func (r *RouteMatrixRequest) WithTraffic(t TrafficModel) *RouteMatrixRequest
- func (r *RouteMatrixRequest) WithType(t RouteType) *RouteMatrixRequest
- func (r *RouteMatrixRequest) WithUnits(u Units) *RouteMatrixRequest
- type RouteMatrixResponse
- type RouteMatrixService
- type RouteMatrixWaypoint
- type RoutePlannerRequest
- func (r *RoutePlannerRequest) Do(ctx context.Context) (*RoutePlannerResponse, error)
- func (r *RoutePlannerRequest) WithAgents(agents ...PlannerAgent) *RoutePlannerRequest
- func (r *RoutePlannerRequest) WithAvoid(avoids ...RouteMatrixAvoid) *RoutePlannerRequest
- func (r *RoutePlannerRequest) WithJobs(jobs ...PlannerJob) *RoutePlannerRequest
- func (r *RoutePlannerRequest) WithLocations(locations ...PlannerLocation) *RoutePlannerRequest
- func (r *RoutePlannerRequest) WithMaxSpeed(n int) *RoutePlannerRequest
- func (r *RoutePlannerRequest) WithMode(mode TravelMode) *RoutePlannerRequest
- func (r *RoutePlannerRequest) WithShipments(shipments ...PlannerShipment) *RoutePlannerRequest
- func (r *RoutePlannerRequest) WithTraffic(t TrafficModel) *RoutePlannerRequest
- func (r *RoutePlannerRequest) WithType(t RouteType) *RoutePlannerRequest
- func (r *RoutePlannerRequest) WithUnits(u Units) *RoutePlannerRequest
- type RoutePlannerResponse
- type RoutePlannerService
- type RouteType
- type RoutingRequest
- func (r *RoutingRequest) Do(ctx context.Context) (*RoutingResponse, error)
- func (r *RoutingRequest) WithAvoid(avoids ...string) *RoutingRequest
- func (r *RoutingRequest) WithDetails(details ...RouteDetail) *RoutingRequest
- func (r *RoutingRequest) WithFormat(f Format) *RoutingRequest
- func (r *RoutingRequest) WithLang(v string) *RoutingRequest
- func (r *RoutingRequest) WithMaxSpeed(n int) *RoutingRequest
- func (r *RoutingRequest) WithMode(mode TravelMode) *RoutingRequest
- func (r *RoutingRequest) WithTraffic(t TrafficModel) *RoutingRequest
- func (r *RoutingRequest) WithType(t RouteType) *RoutingRequest
- func (r *RoutingRequest) WithUnits(u Units) *RoutingRequest
- type RoutingResponse
- type RoutingService
- type SearchRequest
- func (r *SearchRequest) Do(ctx context.Context) (*GeocodingResponse, error)
- func (r *SearchRequest) WithBias(biases ...string) *SearchRequest
- func (r *SearchRequest) WithCity(v string) *SearchRequest
- func (r *SearchRequest) WithCountry(v string) *SearchRequest
- func (r *SearchRequest) WithFilter(filters ...string) *SearchRequest
- func (r *SearchRequest) WithFormat(f Format) *SearchRequest
- func (r *SearchRequest) WithHouseNumber(v string) *SearchRequest
- func (r *SearchRequest) WithLang(v string) *SearchRequest
- func (r *SearchRequest) WithLimit(n int) *SearchRequest
- func (r *SearchRequest) WithName(v string) *SearchRequest
- func (r *SearchRequest) WithPostcode(v string) *SearchRequest
- func (r *SearchRequest) WithState(v string) *SearchRequest
- func (r *SearchRequest) WithStreet(v string) *SearchRequest
- func (r *SearchRequest) WithType(t LocationType) *SearchRequest
- type StepInstruction
- type Timezone
- type TrafficModel
- type TravelMode
- type Units
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CircleBias ¶
CircleBias creates a circle bias.
func CircleFilter ¶
CircleFilter creates a circle filter.
func CountryBias ¶
CountryBias creates a country code bias.
func CountryFilter ¶
CountryFilter creates a country code filter.
func ProximityBias ¶
ProximityBias creates a proximity bias.
func RectFilter ¶
RectFilter creates a rectangle filter.
Types ¶
type APIError ¶
type APIError struct {
StatusCode int `json:"statusCode"`
Message string `json:"message"`
RawBody []byte `json:"-"`
}
APIError represents an error returned by the GeoApify API.
func IsAPIError ¶
IsAPIError checks if the error is an APIError and returns it.
type Address ¶
type Address struct {
Name string `json:"name,omitempty"`
Country string `json:"country,omitempty"`
CountryCode string `json:"country_code,omitempty"`
State string `json:"state,omitempty"`
StateCode string `json:"state_code,omitempty"`
County string `json:"county,omitempty"`
CountyCode string `json:"county_code,omitempty"`
Postcode string `json:"postcode,omitempty"`
City string `json:"city,omitempty"`
Street string `json:"street,omitempty"`
HouseNumber string `json:"housenumber,omitempty"`
Suburb string `json:"suburb,omitempty"`
District string `json:"district,omitempty"`
Lon float64 `json:"lon"`
Lat float64 `json:"lat"`
Formatted string `json:"formatted,omitempty"`
AddressLine1 string `json:"address_line1,omitempty"`
AddressLine2 string `json:"address_line2,omitempty"`
ResultType string `json:"result_type,omitempty"`
Distance float64 `json:"distance,omitempty"`
PlaceID string `json:"place_id,omitempty"`
Category string `json:"category,omitempty"`
Rank *Rank `json:"rank,omitempty"`
Timezone *Timezone `json:"timezone,omitempty"`
Datasource *Datasource `json:"datasource,omitempty"`
}
Address represents a geocoded address result.
type AutocompleteRequest ¶
type AutocompleteRequest struct {
// contains filtered or unexported fields
}
AutocompleteRequest is a builder for address autocomplete requests.
func (*AutocompleteRequest) Do ¶
func (r *AutocompleteRequest) Do(ctx context.Context) (*GeocodingResponse, error)
Do executes the autocomplete request.
func (*AutocompleteRequest) WithBias ¶
func (r *AutocompleteRequest) WithBias(biases ...string) *AutocompleteRequest
WithBias adds geocoding biases (joined with |).
func (*AutocompleteRequest) WithFilter ¶
func (r *AutocompleteRequest) WithFilter(filters ...string) *AutocompleteRequest
WithFilter adds geocoding filters (joined with |).
func (*AutocompleteRequest) WithFormat ¶
func (r *AutocompleteRequest) WithFormat(f Format) *AutocompleteRequest
WithFormat sets the response format.
func (*AutocompleteRequest) WithLang ¶
func (r *AutocompleteRequest) WithLang(v string) *AutocompleteRequest
WithLang sets the response language.
func (*AutocompleteRequest) WithType ¶
func (r *AutocompleteRequest) WithType(t LocationType) *AutocompleteRequest
WithType sets the location type filter.
type BatchForwardRequest ¶
type BatchForwardRequest struct {
// contains filtered or unexported fields
}
BatchForwardRequest is a builder for submitting a forward batch geocoding job.
func (*BatchForwardRequest) Do ¶
func (r *BatchForwardRequest) Do(ctx context.Context) (*BatchJobResponse, error)
Do executes the forward batch geocoding request.
func (*BatchForwardRequest) WithBias ¶
func (r *BatchForwardRequest) WithBias(biases ...string) *BatchForwardRequest
WithBias adds geocoding biases (joined with |).
func (*BatchForwardRequest) WithFilter ¶
func (r *BatchForwardRequest) WithFilter(filters ...string) *BatchForwardRequest
WithFilter adds geocoding filters (joined with |).
func (*BatchForwardRequest) WithLang ¶
func (r *BatchForwardRequest) WithLang(v string) *BatchForwardRequest
WithLang sets the response language.
func (*BatchForwardRequest) WithType ¶
func (r *BatchForwardRequest) WithType(t LocationType) *BatchForwardRequest
WithType sets the location type filter.
type BatchGeocodingService ¶
type BatchGeocodingService struct {
// contains filtered or unexported fields
}
BatchGeocodingService provides access to the Batch Geocoding API.
func (*BatchGeocodingService) GetForwardResult ¶
func (s *BatchGeocodingService) GetForwardResult(jobID string) *BatchResultRequest
GetForwardResult creates a builder to poll forward batch geocoding results.
func (*BatchGeocodingService) GetReverseResult ¶
func (s *BatchGeocodingService) GetReverseResult(jobID string) *BatchResultRequest
GetReverseResult creates a builder to poll reverse batch geocoding results.
func (*BatchGeocodingService) SubmitForward ¶
func (s *BatchGeocodingService) SubmitForward(addresses []string) *BatchForwardRequest
SubmitForward creates a builder for submitting a forward batch geocoding job.
func (*BatchGeocodingService) SubmitReverse ¶
func (s *BatchGeocodingService) SubmitReverse(coordinates [][2]float64) *BatchReverseRequest
SubmitReverse creates a builder for submitting a reverse batch geocoding job.
type BatchJobResponse ¶
type BatchJobResponse struct {
ID string `json:"id"`
Status string `json:"status"`
URL string `json:"url,omitempty"`
}
BatchJobResponse represents the response when submitting a batch job.
type BatchResultRequest ¶
type BatchResultRequest struct {
// contains filtered or unexported fields
}
BatchResultRequest is a builder for polling batch geocoding results.
func (*BatchResultRequest) Do ¶
func (r *BatchResultRequest) Do(ctx context.Context) (*BatchResultResponse, error)
Do executes the batch result polling request.
func (*BatchResultRequest) WithFormat ¶
func (r *BatchResultRequest) WithFormat(v string) *BatchResultRequest
WithFormat sets the response format.
type BatchResultResponse ¶
type BatchResultResponse struct {
// When pending
ID string `json:"id,omitempty"`
Status string `json:"status,omitempty"`
// When complete - results is an array of Address objects
Results []Address `json:"-"`
// Raw holds the raw JSON for flexible parsing
Raw json.RawMessage `json:"-"`
}
BatchResultResponse represents the response when polling for batch results.
func (*BatchResultResponse) UnmarshalJSON ¶
func (r *BatchResultResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements custom unmarshalling for BatchResultResponse. If the JSON is an array, it represents completed results. If it is an object with "status", it represents a pending job.
type BatchReverseRequest ¶
type BatchReverseRequest struct {
// contains filtered or unexported fields
}
BatchReverseRequest is a builder for submitting a reverse batch geocoding job.
func (*BatchReverseRequest) Do ¶
func (r *BatchReverseRequest) Do(ctx context.Context) (*BatchJobResponse, error)
Do executes the reverse batch geocoding request.
func (*BatchReverseRequest) WithLang ¶
func (r *BatchReverseRequest) WithLang(v string) *BatchReverseRequest
WithLang sets the response language.
func (*BatchReverseRequest) WithType ¶
func (r *BatchReverseRequest) WithType(t LocationType) *BatchReverseRequest
WithType sets the location type filter.
type BoundariesConsistsOfRequest ¶
type BoundariesConsistsOfRequest struct {
// contains filtered or unexported fields
}
BoundariesConsistsOfRequest is a builder for boundaries consists-of API requests.
func (*BoundariesConsistsOfRequest) Do ¶
func (r *BoundariesConsistsOfRequest) Do(ctx context.Context) (*GeoJSONFeatureCollection, error)
Do executes the boundaries consists-of request.
func (*BoundariesConsistsOfRequest) WithBoundary ¶
func (r *BoundariesConsistsOfRequest) WithBoundary(b BoundaryType) *BoundariesConsistsOfRequest
WithBoundary sets the boundary type filter.
func (*BoundariesConsistsOfRequest) WithGeometry ¶
func (r *BoundariesConsistsOfRequest) WithGeometry(g GeometryType) *BoundariesConsistsOfRequest
WithGeometry sets the geometry type.
func (*BoundariesConsistsOfRequest) WithLang ¶
func (r *BoundariesConsistsOfRequest) WithLang(v string) *BoundariesConsistsOfRequest
WithLang sets the response language.
func (*BoundariesConsistsOfRequest) WithSublevel ¶
func (r *BoundariesConsistsOfRequest) WithSublevel(n int) *BoundariesConsistsOfRequest
WithSublevel sets the sublevel depth.
type BoundariesPartOfRequest ¶
type BoundariesPartOfRequest struct {
// contains filtered or unexported fields
}
BoundariesPartOfRequest is a builder for boundaries part-of API requests.
func (*BoundariesPartOfRequest) Do ¶
func (r *BoundariesPartOfRequest) Do(ctx context.Context) (*GeoJSONFeatureCollection, error)
Do executes the boundaries part-of request.
func (*BoundariesPartOfRequest) WithBoundary ¶
func (r *BoundariesPartOfRequest) WithBoundary(b BoundaryType) *BoundariesPartOfRequest
WithBoundary sets the boundary type filter.
func (*BoundariesPartOfRequest) WithGeometry ¶
func (r *BoundariesPartOfRequest) WithGeometry(g GeometryType) *BoundariesPartOfRequest
WithGeometry sets the geometry type.
func (*BoundariesPartOfRequest) WithLang ¶
func (r *BoundariesPartOfRequest) WithLang(v string) *BoundariesPartOfRequest
WithLang sets the response language.
type BoundariesService ¶
type BoundariesService struct {
// contains filtered or unexported fields
}
BoundariesService provides access to the GeoApify Boundaries API.
func (*BoundariesService) ConsistsOf ¶
func (s *BoundariesService) ConsistsOf(id string) *BoundariesConsistsOfRequest
ConsistsOf creates a new boundaries consists-of request builder by place ID.
func (*BoundariesService) PartOf ¶
func (s *BoundariesService) PartOf(lat, lon float64) *BoundariesPartOfRequest
PartOf creates a new boundaries part-of request builder by coordinates.
func (*BoundariesService) PartOfByID ¶
func (s *BoundariesService) PartOfByID(id string) *BoundariesPartOfRequest
PartOfByID creates a new boundaries part-of request builder by place ID.
type BoundaryType ¶
type BoundaryType string
BoundaryType represents the boundary type.
const ( BoundaryAdministrative BoundaryType = "administrative" BoundaryPostalCode BoundaryType = "postal_code" BoundaryPolitical BoundaryType = "political" BoundaryLowEmissionZone BoundaryType = "low_emission_zone" )
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the GeoApify API client.
func (*Client) BatchGeocoding ¶
func (c *Client) BatchGeocoding() *BatchGeocodingService
BatchGeocoding returns a batch geocoding service.
func (*Client) Boundaries ¶
func (c *Client) Boundaries() *BoundariesService
Boundaries returns a boundaries service.
func (*Client) Geocoding ¶
func (c *Client) Geocoding() *GeocodingService
Geocoding returns a geocoding service for building geocoding requests.
func (*Client) IPGeolocation ¶
func (c *Client) IPGeolocation() *IPGeolocationService
IPGeolocation returns an IP geolocation service.
func (*Client) Isolines ¶
func (c *Client) Isolines() *IsolinesService
Isolines returns an isolines service for building isoline requests.
func (*Client) MapMatching ¶
func (c *Client) MapMatching() *MapMatchingService
MapMatching returns a map matching service.
func (*Client) PlaceDetails ¶
func (c *Client) PlaceDetails() *PlaceDetailsService
PlaceDetails returns a place details service.
func (*Client) Places ¶
func (c *Client) Places() *PlacesService
Places returns a places service for building places requests.
func (*Client) Postcode ¶
func (c *Client) Postcode() *PostcodeService
Postcode returns a postcode service.
func (*Client) RouteMatrix ¶
func (c *Client) RouteMatrix() *RouteMatrixService
RouteMatrix returns a route matrix service.
func (*Client) RoutePlanner ¶
func (c *Client) RoutePlanner() *RoutePlannerService
RoutePlanner returns a route planner service.
func (*Client) Routing ¶
func (c *Client) Routing() *RoutingService
Routing returns a routing service for building routing requests.
type Datasource ¶
type Datasource struct {
SourceName string `json:"sourcename,omitempty"`
Attribution string `json:"attribution,omitempty"`
License string `json:"license,omitempty"`
URL string `json:"url,omitempty"`
}
Datasource contains data source attribution.
type GeoJSONFeature ¶
type GeoJSONFeature struct {
Type string `json:"type"`
Geometry *GeoJSONGeometry `json:"geometry,omitempty"`
Properties map[string]any `json:"properties,omitempty"`
}
GeoJSONFeature is a generic GeoJSON Feature.
type GeoJSONFeatureCollection ¶
type GeoJSONFeatureCollection struct {
Type string `json:"type"`
Features []GeoJSONFeature `json:"features"`
Properties map[string]any `json:"properties,omitempty"`
}
GeoJSONFeatureCollection is a generic GeoJSON FeatureCollection.
type GeoJSONGeometry ¶
GeoJSONGeometry is a generic GeoJSON Geometry.
type GeocodingParsed ¶
type GeocodingParsed struct {
HouseNumber string `json:"housenumber,omitempty"`
Street string `json:"street,omitempty"`
Postcode string `json:"postcode,omitempty"`
City string `json:"city,omitempty"`
State string `json:"state,omitempty"`
Country string `json:"country,omitempty"`
ExpectedType string `json:"expected_type,omitempty"`
}
GeocodingParsed contains the parsed components of a geocoding query.
type GeocodingQuery ¶
type GeocodingQuery struct {
Text string `json:"text,omitempty"`
Parsed *GeocodingParsed `json:"parsed,omitempty"`
}
GeocodingQuery contains query metadata returned by the API.
type GeocodingResponse ¶
type GeocodingResponse struct {
Results []Address `json:"results"`
Query *GeocodingQuery `json:"query,omitempty"`
}
GeocodingResponse represents the response from geocoding APIs.
type GeocodingService ¶
type GeocodingService struct {
// contains filtered or unexported fields
}
GeocodingService provides access to the GeoApify Geocoding APIs.
func (*GeocodingService) Autocomplete ¶
func (s *GeocodingService) Autocomplete(text string) *AutocompleteRequest
Autocomplete creates a new address autocomplete request builder.
func (*GeocodingService) Reverse ¶
func (s *GeocodingService) Reverse(lat, lon float64) *ReverseGeocodingRequest
Reverse creates a new reverse geocoding request builder.
func (*GeocodingService) Search ¶
func (s *GeocodingService) Search(text string) *SearchRequest
Search creates a new forward geocoding request builder.
type GeometryType ¶
type GeometryType string
GeometryType represents the boundary geometry type.
const ( GeometryPoint GeometryType = "point" Geometry1000 GeometryType = "geometry_1000" Geometry5000 GeometryType = "geometry_5000" Geometry10000 GeometryType = "geometry_10000" )
type IPGeolocationRequest ¶
type IPGeolocationRequest struct {
// contains filtered or unexported fields
}
IPGeolocationRequest is a builder for IP geolocation API requests.
func (*IPGeolocationRequest) Do ¶
func (r *IPGeolocationRequest) Do(ctx context.Context) (*IPGeolocationResponse, error)
Do executes the IP geolocation request.
func (*IPGeolocationRequest) WithIP ¶
func (r *IPGeolocationRequest) WithIP(ip string) *IPGeolocationRequest
WithIP sets a specific IP address to look up.
type IPGeolocationResponse ¶
type IPGeolocationResponse struct {
IP string `json:"ip,omitempty"`
City *IPLocationCity `json:"city,omitempty"`
State *IPLocationState `json:"state,omitempty"`
Country *IPLocationCountry `json:"country,omitempty"`
Continent *IPLocationContinent `json:"continent,omitempty"`
Location *IPLocationCoords `json:"location,omitempty"`
}
IPGeolocationResponse is the response from the IP geolocation API.
type IPGeolocationService ¶
type IPGeolocationService struct {
// contains filtered or unexported fields
}
IPGeolocationService provides access to the GeoApify IP Geolocation API.
func (*IPGeolocationService) Lookup ¶
func (s *IPGeolocationService) Lookup() *IPGeolocationRequest
Lookup creates a new IP geolocation request builder that auto-detects the IP.
type IPLocationCity ¶
type IPLocationCity struct {
Name string `json:"name,omitempty"`
}
IPLocationCity contains city information.
type IPLocationContinent ¶
type IPLocationContinent struct {
Name string `json:"name,omitempty"`
Code string `json:"code,omitempty"`
}
IPLocationContinent contains continent information.
type IPLocationCoords ¶
type IPLocationCoords struct {
Latitude float64 `json:"latitude,omitempty"`
Longitude float64 `json:"longitude,omitempty"`
}
IPLocationCoords contains geographic coordinates.
type IPLocationCountry ¶
type IPLocationCountry struct {
Name string `json:"name,omitempty"`
NameNative string `json:"name_native,omitempty"`
ISOCode string `json:"iso_code,omitempty"`
PhoneCode string `json:"phone_code,omitempty"`
Capital string `json:"capital,omitempty"`
Flag string `json:"flag,omitempty"`
Languages []IPLocationLang `json:"languages,omitempty"`
Currency string `json:"currency,omitempty"`
}
IPLocationCountry contains country information.
type IPLocationLang ¶
type IPLocationLang struct {
ISOCode string `json:"iso_code,omitempty"`
Name string `json:"name,omitempty"`
NameNative string `json:"name_native,omitempty"`
}
IPLocationLang contains language information.
type IPLocationState ¶
type IPLocationState struct {
Name string `json:"name,omitempty"`
}
IPLocationState contains state/subdivision information.
type IsolineRequest ¶
type IsolineRequest struct {
// contains filtered or unexported fields
}
IsolineRequest is a builder for an isoline API call.
func (*IsolineRequest) Do ¶
func (r *IsolineRequest) Do(ctx context.Context) (*GeoJSONFeatureCollection, error)
Do executes the isoline request.
func (*IsolineRequest) WithAvoid ¶
func (r *IsolineRequest) WithAvoid(avoids ...string) *IsolineRequest
WithAvoid sets features to avoid.
func (*IsolineRequest) WithMaxSpeed ¶
func (r *IsolineRequest) WithMaxSpeed(n int) *IsolineRequest
WithMaxSpeed sets the maximum speed.
func (*IsolineRequest) WithMode ¶
func (r *IsolineRequest) WithMode(m TravelMode) *IsolineRequest
WithMode sets the travel mode.
func (*IsolineRequest) WithRange ¶
func (r *IsolineRequest) WithRange(ranges ...int) *IsolineRequest
WithRange sets the isoline range values.
func (*IsolineRequest) WithRouteType ¶
func (r *IsolineRequest) WithRouteType(rt RouteType) *IsolineRequest
WithRouteType sets the route type.
func (*IsolineRequest) WithTraffic ¶
func (r *IsolineRequest) WithTraffic(t TrafficModel) *IsolineRequest
WithTraffic sets the traffic model.
func (*IsolineRequest) WithType ¶
func (r *IsolineRequest) WithType(t IsolineType) *IsolineRequest
WithType sets the isoline type (time or distance).
func (*IsolineRequest) WithUnits ¶
func (r *IsolineRequest) WithUnits(u Units) *IsolineRequest
WithUnits sets the distance units.
type IsolineType ¶
type IsolineType string
IsolineType represents the isoline calculation type.
const ( IsolineTime IsolineType = "time" IsolineDistance IsolineType = "distance" )
type IsolinesService ¶
type IsolinesService struct {
// contains filtered or unexported fields
}
IsolinesService provides access to the GeoApify Isolines API.
func (*IsolinesService) At ¶
func (s *IsolinesService) At(lat, lon float64) *IsolineRequest
At creates a new IsolineRequest for the given coordinates.
func (*IsolinesService) ByID ¶
func (s *IsolinesService) ByID(id string) *IsolineRequest
ByID creates a new IsolineRequest to retrieve a previously generated isoline.
type LegStep ¶
type LegStep struct {
Distance float64 `json:"distance"`
Time float64 `json:"time"`
FromIndex int `json:"from_index"`
ToIndex int `json:"to_index"`
Toll bool `json:"toll,omitempty"`
Ferry bool `json:"ferry,omitempty"`
Tunnel bool `json:"tunnel,omitempty"`
Bridge bool `json:"bridge,omitempty"`
Roundabout bool `json:"roundabout,omitempty"`
Speed float64 `json:"speed,omitempty"`
SpeedLimit float64 `json:"speed_limit,omitempty"`
TruckLimit float64 `json:"truck_limit,omitempty"`
Surface string `json:"surface,omitempty"`
LaneCount int `json:"lane_count,omitempty"`
RoadClass string `json:"road_class,omitempty"`
Name string `json:"name,omitempty"`
Instruction *StepInstruction `json:"instruction,omitempty"`
}
LegStep represents a step within a route leg.
type Location ¶
Location represents a geographic coordinate pair.
type LocationType ¶
type LocationType string
LocationType represents a location type filter.
const ( TypeCountry LocationType = "country" TypeState LocationType = "state" TypeCity LocationType = "city" TypePostcode LocationType = "postcode" TypeStreet LocationType = "street" TypeAmenity LocationType = "amenity" TypeLocality LocationType = "locality" )
type MapMatchingRequest ¶
type MapMatchingRequest struct {
// contains filtered or unexported fields
}
MapMatchingRequest is a builder for map matching API requests.
func (*MapMatchingRequest) Do ¶
func (r *MapMatchingRequest) Do(ctx context.Context) (*GeoJSONFeatureCollection, error)
Do executes the map matching request.
func (*MapMatchingRequest) Waypoints ¶
func (r *MapMatchingRequest) Waypoints(waypoints ...MapMatchingWaypoint) *MapMatchingRequest
Waypoints sets the waypoints to match.
func (*MapMatchingRequest) WithMode ¶
func (r *MapMatchingRequest) WithMode(mode TravelMode) *MapMatchingRequest
WithMode sets the travel mode.
type MapMatchingService ¶
type MapMatchingService struct {
// contains filtered or unexported fields
}
MapMatchingService provides access to the GeoApify Map Matching API.
func (*MapMatchingService) Match ¶
func (s *MapMatchingService) Match() *MapMatchingRequest
Match creates a new map matching request builder.
type MapMatchingWaypoint ¶
type MapMatchingWaypoint struct {
Location [2]float64 `json:"location"`
Timestamp string `json:"timestamp,omitempty"`
Bearing *float64 `json:"bearing,omitempty"`
}
MapMatchingWaypoint represents a waypoint for map matching.
type Option ¶
type Option func(*Client)
Option configures the Client.
func WithBaseURL ¶
WithBaseURL overrides the default API base URL.
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client.
func WithRetry ¶
WithRetry enables retry with exponential backoff and jitter. Retries are attempted on 429 (rate limit) and 5xx (server error) responses. maxRetries is the maximum number of retry attempts (0 means no retries). initialDelay is the delay before the first retry. maxDelay is the maximum delay between retries.
type PlaceDetailsRequest ¶
type PlaceDetailsRequest struct {
// contains filtered or unexported fields
}
PlaceDetailsRequest is a builder for place details requests.
func (*PlaceDetailsRequest) Do ¶
func (r *PlaceDetailsRequest) Do(ctx context.Context) (*GeoJSONFeatureCollection, error)
Do executes the place details request.
func (*PlaceDetailsRequest) WithFeatures ¶
func (r *PlaceDetailsRequest) WithFeatures(features ...string) *PlaceDetailsRequest
WithFeatures sets the features to include in the response.
func (*PlaceDetailsRequest) WithLang ¶
func (r *PlaceDetailsRequest) WithLang(v string) *PlaceDetailsRequest
WithLang sets the response language.
type PlaceDetailsService ¶
type PlaceDetailsService struct {
// contains filtered or unexported fields
}
PlaceDetailsService provides access to the Place Details API.
func (*PlaceDetailsService) ByCoordinates ¶
func (s *PlaceDetailsService) ByCoordinates(lat, lon float64) *PlaceDetailsRequest
ByCoordinates creates a place details request by coordinates.
func (*PlaceDetailsService) ByID ¶
func (s *PlaceDetailsService) ByID(placeID string) *PlaceDetailsRequest
ByID creates a place details request by place ID.
type PlacesRequest ¶
type PlacesRequest struct {
// contains filtered or unexported fields
}
PlacesRequest is a builder for a places API call.
func (*PlacesRequest) Do ¶
func (r *PlacesRequest) Do(ctx context.Context) (*GeoJSONFeatureCollection, error)
Do executes the places request.
func (*PlacesRequest) WithBias ¶
func (r *PlacesRequest) WithBias(biases ...string) *PlacesRequest
WithBias adds biases to the request.
func (*PlacesRequest) WithConditions ¶
func (r *PlacesRequest) WithConditions(conditions ...string) *PlacesRequest
WithConditions adds conditions to the request.
func (*PlacesRequest) WithFilter ¶
func (r *PlacesRequest) WithFilter(filters ...string) *PlacesRequest
WithFilter adds filters to the request.
func (*PlacesRequest) WithLang ¶
func (r *PlacesRequest) WithLang(v string) *PlacesRequest
WithLang sets the response language.
func (*PlacesRequest) WithLimit ¶
func (r *PlacesRequest) WithLimit(n int) *PlacesRequest
WithLimit sets the maximum number of results.
func (*PlacesRequest) WithName ¶
func (r *PlacesRequest) WithName(v string) *PlacesRequest
WithName sets a name filter for the request.
func (*PlacesRequest) WithOffset ¶
func (r *PlacesRequest) WithOffset(n int) *PlacesRequest
WithOffset sets the result offset for pagination.
type PlacesService ¶
type PlacesService struct {
// contains filtered or unexported fields
}
PlacesService provides access to the GeoApify Places API.
func (*PlacesService) Categories ¶
func (s *PlacesService) Categories(categories ...string) *PlacesRequest
Categories creates a new PlacesRequest for the given categories.
type PlannerAgent ¶
type PlannerAgent struct {
ID string `json:"id,omitempty"`
Description string `json:"description,omitempty"`
StartLocation [2]float64 `json:"start_location,omitempty"`
StartLocationIdx *int `json:"start_location_index,omitempty"`
EndLocation [2]float64 `json:"end_location,omitempty"`
EndLocationIdx *int `json:"end_location_index,omitempty"`
PickupCapacity *int `json:"pickup_capacity,omitempty"`
DeliveryCapacity *int `json:"delivery_capacity,omitempty"`
Capabilities []string `json:"capabilities,omitempty"`
TimeWindows [][2]int `json:"time_windows,omitempty"`
Breaks []PlannerBreak `json:"breaks,omitempty"`
}
PlannerAgent represents a vehicle or driver in the route planner.
type PlannerAgentResult ¶
type PlannerAgentResult struct {
AgentIndex int `json:"agent_index"`
Route []PlannerRouteStep `json:"route,omitempty"`
Distance float64 `json:"distance"`
Time float64 `json:"time"`
}
PlannerAgentResult represents the result for a single agent.
type PlannerBreak ¶
type PlannerBreak struct {
Duration int `json:"duration"`
TimeWindows [][2]int `json:"time_windows,omitempty"`
}
PlannerBreak represents a break for an agent.
type PlannerJob ¶
type PlannerJob struct {
ID string `json:"id,omitempty"`
Description string `json:"description,omitempty"`
Location [2]float64 `json:"location,omitempty"`
LocationIdx *int `json:"location_index,omitempty"`
Priority *int `json:"priority,omitempty"`
Duration *int `json:"duration,omitempty"`
PickupAmount *int `json:"pickup_amount,omitempty"`
DeliveryAmount *int `json:"delivery_amount,omitempty"`
Requirements []string `json:"requirements,omitempty"`
TimeWindows [][2]int `json:"time_windows,omitempty"`
}
PlannerJob represents a job to be assigned to an agent.
type PlannerLocation ¶
type PlannerLocation struct {
ID string `json:"id,omitempty"`
Location [2]float64 `json:"location"`
}
PlannerLocation represents a reusable location.
type PlannerRouteStep ¶
type PlannerRouteStep struct {
Type string `json:"type,omitempty"`
JobIndex *int `json:"job_index,omitempty"`
Distance float64 `json:"distance,omitempty"`
Time float64 `json:"time,omitempty"`
}
PlannerRouteStep represents a step in an agent's route.
type PlannerShipment ¶
type PlannerShipment struct {
ID string `json:"id"`
Pickup PlannerShipmentStop `json:"pickup"`
Delivery PlannerShipmentStop `json:"delivery"`
Requirements []string `json:"requirements,omitempty"`
Priority *int `json:"priority,omitempty"`
Description string `json:"description,omitempty"`
Amount *int `json:"amount,omitempty"`
}
PlannerShipment represents a shipment with pickup and delivery stops.
type PlannerShipmentStop ¶
type PlannerShipmentStop struct {
Location [2]float64 `json:"location,omitempty"`
LocationIdx *int `json:"location_index,omitempty"`
Duration *int `json:"duration,omitempty"`
TimeWindows [][2]int `json:"time_windows,omitempty"`
}
PlannerShipmentStop represents a pickup or delivery stop.
type PostcodeRequest ¶
type PostcodeRequest struct {
// contains filtered or unexported fields
}
PostcodeRequest is a builder for postcode API requests.
func (*PostcodeRequest) Do ¶
func (r *PostcodeRequest) Do(ctx context.Context) (*GeoJSONFeatureCollection, error)
Do executes the postcode request.
func (*PostcodeRequest) WithBias ¶
func (r *PostcodeRequest) WithBias(biases ...string) *PostcodeRequest
WithBias sets the result biases.
func (*PostcodeRequest) WithFilter ¶
func (r *PostcodeRequest) WithFilter(filters ...string) *PostcodeRequest
WithFilter sets the result filters.
func (*PostcodeRequest) WithFormat ¶
func (r *PostcodeRequest) WithFormat(f Format) *PostcodeRequest
WithFormat sets the response format.
func (*PostcodeRequest) WithGeometry ¶
func (r *PostcodeRequest) WithGeometry(g GeometryType) *PostcodeRequest
WithGeometry sets the geometry type.
func (*PostcodeRequest) WithLang ¶
func (r *PostcodeRequest) WithLang(v string) *PostcodeRequest
WithLang sets the response language.
func (*PostcodeRequest) WithLimit ¶
func (r *PostcodeRequest) WithLimit(n int) *PostcodeRequest
WithLimit sets the maximum number of results.
type PostcodeService ¶
type PostcodeService struct {
// contains filtered or unexported fields
}
PostcodeService provides access to the GeoApify Postcode API.
func (*PostcodeService) Search ¶
func (s *PostcodeService) Search(lat, lon float64) *PostcodeRequest
Search creates a new postcode request builder with the given coordinates.
type Rank ¶
type Rank struct {
Importance float64 `json:"importance,omitempty"`
Popularity float64 `json:"popularity,omitempty"`
Confidence float64 `json:"confidence,omitempty"`
ConfidenceCityLevel float64 `json:"confidence_city_level,omitempty"`
ConfidenceStreetLevel float64 `json:"confidence_street_level,omitempty"`
ConfidenceBuildingLevel float64 `json:"confidence_building_level,omitempty"`
MatchType string `json:"match_type,omitempty"`
}
Rank contains confidence and match information.
type ReverseGeocodingRequest ¶
type ReverseGeocodingRequest struct {
// contains filtered or unexported fields
}
ReverseGeocodingRequest is a builder for reverse geocoding requests.
func (*ReverseGeocodingRequest) Do ¶
func (r *ReverseGeocodingRequest) Do(ctx context.Context) (*GeocodingResponse, error)
Do executes the reverse geocoding request.
func (*ReverseGeocodingRequest) WithFormat ¶
func (r *ReverseGeocodingRequest) WithFormat(f Format) *ReverseGeocodingRequest
WithFormat sets the response format.
func (*ReverseGeocodingRequest) WithLang ¶
func (r *ReverseGeocodingRequest) WithLang(v string) *ReverseGeocodingRequest
WithLang sets the response language.
func (*ReverseGeocodingRequest) WithLimit ¶
func (r *ReverseGeocodingRequest) WithLimit(n int) *ReverseGeocodingRequest
WithLimit sets the maximum number of results.
func (*ReverseGeocodingRequest) WithType ¶
func (r *ReverseGeocodingRequest) WithType(t LocationType) *ReverseGeocodingRequest
WithType sets the location type filter.
type Route ¶
type Route struct {
Distance float64 `json:"distance"`
DistanceUnits string `json:"distance_units,omitempty"`
Time float64 `json:"time"`
Toll bool `json:"toll,omitempty"`
Ferry bool `json:"ferry,omitempty"`
Legs []RouteLeg `json:"legs"`
}
Route represents a single route result.
type RouteDetail ¶
type RouteDetail string
RouteDetail represents additional route detail types.
const ( DetailInstructions RouteDetail = "instruction_details" DetailRoute RouteDetail = "route_details" DetailElevation RouteDetail = "elevation" )
type RouteLeg ¶
type RouteLeg struct {
Distance float64 `json:"distance"`
Time float64 `json:"time"`
Steps []LegStep `json:"steps"`
Elevation []float64 `json:"elevation,omitempty"`
ElevationRange [][]float64 `json:"elevation_range,omitempty"`
CountryCode []string `json:"country_code,omitempty"`
}
RouteLeg represents a leg of a route.
type RouteMatrixAvoid ¶
type RouteMatrixAvoid struct {
Type string `json:"type"`
Values []Location `json:"values,omitempty"`
}
RouteMatrixAvoid represents an area or feature to avoid.
type RouteMatrixEntry ¶
type RouteMatrixEntry struct {
Distance float64 `json:"distance"`
Time float64 `json:"time"`
SourceIndex int `json:"source_index"`
TargetIndex int `json:"target_index"`
}
RouteMatrixEntry represents a single source-to-target result.
type RouteMatrixRequest ¶
type RouteMatrixRequest struct {
// contains filtered or unexported fields
}
RouteMatrixRequest is a builder for route matrix API requests.
func (*RouteMatrixRequest) Do ¶
func (r *RouteMatrixRequest) Do(ctx context.Context) (*RouteMatrixResponse, error)
Do executes the route matrix request.
func (*RouteMatrixRequest) Sources ¶
func (r *RouteMatrixRequest) Sources(locations ...Location) *RouteMatrixRequest
Sources sets the source locations.
func (*RouteMatrixRequest) Targets ¶
func (r *RouteMatrixRequest) Targets(locations ...Location) *RouteMatrixRequest
Targets sets the target locations.
func (*RouteMatrixRequest) WithAvoid ¶
func (r *RouteMatrixRequest) WithAvoid(avoids ...RouteMatrixAvoid) *RouteMatrixRequest
WithAvoid sets areas or features to avoid.
func (*RouteMatrixRequest) WithMaxSpeed ¶
func (r *RouteMatrixRequest) WithMaxSpeed(n int) *RouteMatrixRequest
WithMaxSpeed sets the maximum speed in km/h.
func (*RouteMatrixRequest) WithMode ¶
func (r *RouteMatrixRequest) WithMode(mode TravelMode) *RouteMatrixRequest
WithMode sets the travel mode.
func (*RouteMatrixRequest) WithTraffic ¶
func (r *RouteMatrixRequest) WithTraffic(t TrafficModel) *RouteMatrixRequest
WithTraffic sets the traffic model.
func (*RouteMatrixRequest) WithType ¶
func (r *RouteMatrixRequest) WithType(t RouteType) *RouteMatrixRequest
WithType sets the route optimization type.
func (*RouteMatrixRequest) WithUnits ¶
func (r *RouteMatrixRequest) WithUnits(u Units) *RouteMatrixRequest
WithUnits sets the distance units.
type RouteMatrixResponse ¶
type RouteMatrixResponse struct {
Sources []RouteMatrixWaypoint `json:"sources"`
Targets []RouteMatrixWaypoint `json:"targets"`
SourcesToTargets [][]RouteMatrixEntry `json:"sources_to_targets"`
}
RouteMatrixResponse is the response from the route matrix API.
type RouteMatrixService ¶
type RouteMatrixService struct {
// contains filtered or unexported fields
}
RouteMatrixService provides access to the GeoApify Route Matrix API.
func (*RouteMatrixService) Calculate ¶
func (s *RouteMatrixService) Calculate() *RouteMatrixRequest
Calculate creates a new route matrix request builder.
type RouteMatrixWaypoint ¶
type RouteMatrixWaypoint struct {
OriginalLocation [2]float64 `json:"original_location"`
Location [2]float64 `json:"location"`
}
RouteMatrixWaypoint represents a snapped waypoint in the matrix response.
type RoutePlannerRequest ¶
type RoutePlannerRequest struct {
// contains filtered or unexported fields
}
RoutePlannerRequest is a builder for route planner API requests.
func (*RoutePlannerRequest) Do ¶
func (r *RoutePlannerRequest) Do(ctx context.Context) (*RoutePlannerResponse, error)
Do executes the route planner request.
func (*RoutePlannerRequest) WithAgents ¶
func (r *RoutePlannerRequest) WithAgents(agents ...PlannerAgent) *RoutePlannerRequest
WithAgents sets the agents (vehicles/drivers).
func (*RoutePlannerRequest) WithAvoid ¶
func (r *RoutePlannerRequest) WithAvoid(avoids ...RouteMatrixAvoid) *RoutePlannerRequest
WithAvoid sets areas or features to avoid.
func (*RoutePlannerRequest) WithJobs ¶
func (r *RoutePlannerRequest) WithJobs(jobs ...PlannerJob) *RoutePlannerRequest
WithJobs sets the jobs to be assigned.
func (*RoutePlannerRequest) WithLocations ¶
func (r *RoutePlannerRequest) WithLocations(locations ...PlannerLocation) *RoutePlannerRequest
WithLocations sets the reusable locations.
func (*RoutePlannerRequest) WithMaxSpeed ¶
func (r *RoutePlannerRequest) WithMaxSpeed(n int) *RoutePlannerRequest
WithMaxSpeed sets the maximum speed in km/h.
func (*RoutePlannerRequest) WithMode ¶
func (r *RoutePlannerRequest) WithMode(mode TravelMode) *RoutePlannerRequest
WithMode sets the travel mode.
func (*RoutePlannerRequest) WithShipments ¶
func (r *RoutePlannerRequest) WithShipments(shipments ...PlannerShipment) *RoutePlannerRequest
WithShipments sets the shipments to be assigned.
func (*RoutePlannerRequest) WithTraffic ¶
func (r *RoutePlannerRequest) WithTraffic(t TrafficModel) *RoutePlannerRequest
WithTraffic sets the traffic model.
func (*RoutePlannerRequest) WithType ¶
func (r *RoutePlannerRequest) WithType(t RouteType) *RoutePlannerRequest
WithType sets the route optimization type.
func (*RoutePlannerRequest) WithUnits ¶
func (r *RoutePlannerRequest) WithUnits(u Units) *RoutePlannerRequest
WithUnits sets the distance units.
type RoutePlannerResponse ¶
type RoutePlannerResponse struct {
Properties map[string]any `json:"properties,omitempty"`
Agents []PlannerAgentResult `json:"agents,omitempty"`
}
RoutePlannerResponse is the response from the route planner API.
type RoutePlannerService ¶
type RoutePlannerService struct {
// contains filtered or unexported fields
}
RoutePlannerService provides access to the GeoApify Route Planner (VRP) API.
func (*RoutePlannerService) Plan ¶
func (s *RoutePlannerService) Plan() *RoutePlannerRequest
Plan creates a new route planner request builder.
type RoutingRequest ¶
type RoutingRequest struct {
// contains filtered or unexported fields
}
RoutingRequest is a builder for routing API requests.
func (*RoutingRequest) Do ¶
func (r *RoutingRequest) Do(ctx context.Context) (*RoutingResponse, error)
Do executes the routing request.
func (*RoutingRequest) WithAvoid ¶
func (r *RoutingRequest) WithAvoid(avoids ...string) *RoutingRequest
WithAvoid sets road features to avoid.
func (*RoutingRequest) WithDetails ¶
func (r *RoutingRequest) WithDetails(details ...RouteDetail) *RoutingRequest
WithDetails sets additional route details to include.
func (*RoutingRequest) WithFormat ¶
func (r *RoutingRequest) WithFormat(f Format) *RoutingRequest
WithFormat sets the response format.
func (*RoutingRequest) WithLang ¶
func (r *RoutingRequest) WithLang(v string) *RoutingRequest
WithLang sets the response language.
func (*RoutingRequest) WithMaxSpeed ¶
func (r *RoutingRequest) WithMaxSpeed(n int) *RoutingRequest
WithMaxSpeed sets the maximum speed in km/h.
func (*RoutingRequest) WithMode ¶
func (r *RoutingRequest) WithMode(mode TravelMode) *RoutingRequest
WithMode sets the travel mode.
func (*RoutingRequest) WithTraffic ¶
func (r *RoutingRequest) WithTraffic(t TrafficModel) *RoutingRequest
WithTraffic sets the traffic model.
func (*RoutingRequest) WithType ¶
func (r *RoutingRequest) WithType(t RouteType) *RoutingRequest
WithType sets the route optimization type.
func (*RoutingRequest) WithUnits ¶
func (r *RoutingRequest) WithUnits(u Units) *RoutingRequest
WithUnits sets the distance units.
type RoutingResponse ¶
type RoutingResponse struct {
Results []Route `json:"results"`
Properties map[string]any `json:"properties,omitempty"`
}
RoutingResponse is the response from the routing API.
type RoutingService ¶
type RoutingService struct {
// contains filtered or unexported fields
}
RoutingService provides access to the GeoApify Routing API.
func (*RoutingService) Waypoints ¶
func (s *RoutingService) Waypoints(waypoints ...Location) *RoutingRequest
Waypoints creates a new routing request builder with the given waypoints.
type SearchRequest ¶
type SearchRequest struct {
// contains filtered or unexported fields
}
SearchRequest is a builder for forward geocoding requests.
func (*SearchRequest) Do ¶
func (r *SearchRequest) Do(ctx context.Context) (*GeocodingResponse, error)
Do executes the forward geocoding request.
func (*SearchRequest) WithBias ¶
func (r *SearchRequest) WithBias(biases ...string) *SearchRequest
WithBias adds geocoding biases (joined with |).
func (*SearchRequest) WithCity ¶
func (r *SearchRequest) WithCity(v string) *SearchRequest
WithCity sets the city parameter.
func (*SearchRequest) WithCountry ¶
func (r *SearchRequest) WithCountry(v string) *SearchRequest
WithCountry sets the country parameter.
func (*SearchRequest) WithFilter ¶
func (r *SearchRequest) WithFilter(filters ...string) *SearchRequest
WithFilter adds geocoding filters (joined with |).
func (*SearchRequest) WithFormat ¶
func (r *SearchRequest) WithFormat(f Format) *SearchRequest
WithFormat sets the response format.
func (*SearchRequest) WithHouseNumber ¶
func (r *SearchRequest) WithHouseNumber(v string) *SearchRequest
WithHouseNumber sets the house number parameter.
func (*SearchRequest) WithLang ¶
func (r *SearchRequest) WithLang(v string) *SearchRequest
WithLang sets the response language.
func (*SearchRequest) WithLimit ¶
func (r *SearchRequest) WithLimit(n int) *SearchRequest
WithLimit sets the maximum number of results.
func (*SearchRequest) WithName ¶
func (r *SearchRequest) WithName(v string) *SearchRequest
WithName sets the name parameter.
func (*SearchRequest) WithPostcode ¶
func (r *SearchRequest) WithPostcode(v string) *SearchRequest
WithPostcode sets the postcode parameter.
func (*SearchRequest) WithState ¶
func (r *SearchRequest) WithState(v string) *SearchRequest
WithState sets the state parameter.
func (*SearchRequest) WithStreet ¶
func (r *SearchRequest) WithStreet(v string) *SearchRequest
WithStreet sets the street parameter.
func (*SearchRequest) WithType ¶
func (r *SearchRequest) WithType(t LocationType) *SearchRequest
WithType sets the location type filter.
type StepInstruction ¶
type StepInstruction struct {
Text string `json:"text,omitempty"`
Type string `json:"type,omitempty"`
}
StepInstruction contains turn-by-turn instruction details.
type Timezone ¶
type Timezone struct {
Name string `json:"name,omitempty"`
NameAlt string `json:"name_alt,omitempty"`
OffsetSTD string `json:"offset_STD,omitempty"`
OffsetSTDSeconds int `json:"offset_STD_seconds,omitempty"`
OffsetDST string `json:"offset_DST,omitempty"`
OffsetDSTSeconds int `json:"offset_DST_seconds,omitempty"`
AbbreviationSTD string `json:"abbreviation_STD,omitempty"`
AbbreviationDST string `json:"abbreviation_DST,omitempty"`
}
Timezone contains timezone information.
type TrafficModel ¶
type TrafficModel string
TrafficModel represents a traffic model.
const ( TrafficFreeFlow TrafficModel = "free_flow" TrafficApproximated TrafficModel = "approximated" )
type TravelMode ¶
type TravelMode string
TravelMode represents a travel/transportation mode.
const ( ModeDrive TravelMode = "drive" ModeLightTruck TravelMode = "light_truck" ModeMediumTruck TravelMode = "medium_truck" ModeTruck TravelMode = "truck" ModeHeavyTruck TravelMode = "heavy_truck" ModeTruckDangerousGoods TravelMode = "truck_dangerous_goods" ModeLongTruck TravelMode = "long_truck" ModeBus TravelMode = "bus" ModeScooter TravelMode = "scooter" ModeMotorcycle TravelMode = "motorcycle" ModeBicycle TravelMode = "bicycle" ModeMountainBike TravelMode = "mountain_bike" ModeRoadBike TravelMode = "road_bike" ModeWalk TravelMode = "walk" ModeHike TravelMode = "hike" ModeTransit TravelMode = "transit" ModeApproximatedTransit TravelMode = "approximated_transit" )