Documentation
¶
Index ¶
- Constants
- Variables
- func CalculateTileCount(bounds Envelope, zoomLevel int) (tilesX, tilesY, totalTiles int)
- func Degrees(rad float64) float64
- func Lat2y(lat float64) float64
- func LatLngToTile(level uint, lat, lng float64) (row, column uint)
- func Lon2x(lon float64) float64
- func MITMProxyTransport() (*http.Transport, error)
- func MetersToPixels(mx, my float64, zoom int) (px, py float64)
- func MetersToTile(mx, my float64, zoom int) (tx, ty int)
- func Radians(deg float64) float64
- func Resolution(zoom int) float64
- func ScaleToZoom(scale float64, dpi float64) int
- func ServiceRootFromTenant(base string, tenantId string) string
- func X2lat(x float64) float64
- func Y2lat(y float64) float64
- type AdminInfo
- type ArcGIS
- func (ag *ArcGIS) AdminInfo(ctx context.Context, serviceName string, serviceType ServiceType) (*AdminInfo, error)
- func (ag *ArcGIS) GeocodeFindAddressCandidates(ctx context.Context, address string) (*response.GeocodeFindAddressCandidates, error)
- func (ag *ArcGIS) GeometryProject(ctx context.Context, geometries []response.Geometry) (*response.Project, error)
- func (ag *ArcGIS) Info(ctx context.Context) (*RestInfo, error)
- func (ag *ArcGIS) MapServices(ctx context.Context) ([]MapService, error)
- func (ag *ArcGIS) NewServiceFeature(ctx context.Context, name string, url url.URL) *ServiceFeature
- func (ag *ArcGIS) PermissionList(ctx context.Context, serviceName string, serviceType ServiceType) (*response.PermissionSlice, error)
- func (ag *ArcGIS) PortalsGlobal(ctx context.Context) (*response.Portal, error)
- func (ag *ArcGIS) PortalsSelf(ctx context.Context) (*response.Portal, error)
- func (ag *ArcGIS) Search(ctx context.Context, query string) (*SearchResponse, error)
- func (ag *ArcGIS) SearchInAccount(ctx context.Context, query string) (*SearchResponse, error)
- func (ag *ArcGIS) ServiceByName(ctx context.Context, name string) (*ServiceFeature, error)
- func (ag *ArcGIS) ServiceByURL(ctx context.Context, url url.URL) (*ServiceFeature, error)
- func (ag *ArcGIS) Services(ctx context.Context) ([]*ServiceFeature, error)
- func (ag *ArcGIS) WebhookList(ctx context.Context, serviceName string, serviceType ServiceType) (*WebhookSlice, error)
- type AuthInfo
- type Authenticator
- type AuthenticatorOAuth
- type AuthenticatorToken
- type AuthenticatorUsernamePassword
- type CodeWrapper
- type CodedValue
- type DefaultValueWrapper
- type Domain
- type Envelope
- type ErrorFromAPI
- type ErrorResponse
- type Field
- type MapService
- type Point
- type Position
- type Query
- type ResourceInfo
- type ResponseServiceInfo
- type RestInfo
- type SearchResponse
- type SearchResult
- type ServiceFeature
- func (sf *ServiceFeature) LayerMetadata(ctx context.Context, layer_id uint) (*response.LayerMetadata, error)
- func (sf *ServiceFeature) Layers(ctx context.Context) ([]response.Layer, error)
- func (sf *ServiceFeature) PopulateMetadata(ctx context.Context) (*response.FeatureService, error)
- func (sf *ServiceFeature) Query(ctx context.Context, layer_id uint, query Query) (*response.QueryResult, error)
- func (sf *ServiceFeature) QueryCount(ctx context.Context, layer_id uint) (*response.QueryResultCount, error)
- func (sf *ServiceFeature) QueryEnvelope(ctx context.Context, layer_id uint, point Point) (*response.QueryResult, error)
- func (sf *ServiceFeature) QueryIDs(ctx context.Context, layer_id uint, query Query) (*response.QueryResultOnlyIDs, error)
- func (sf *ServiceFeature) QueryRaw(ctx context.Context, layer_id uint, query Query) ([]byte, error)
- func (sf *ServiceFeature) QueryWithin(ctx context.Context, layer_id uint, point Point) (*response.QueryResult, error)
- func (fs *ServiceFeature) SchemaRaw(ctx context.Context, layer_id uint) ([]byte, error)
- type ServiceListing
- type ServiceType
- type SpatialReference
- type TimeInfo
- type TimeReference
- type Usage
- type Webhook
- type WebhookListResponse
- type WebhookSlice
Constants ¶
View Source
const ( APIErrorUnrecognized apiErrorType = "" APIErrorInvalidAuthToken apiErrorType = "invalid_auth_token" APIErrorInvalidRequest apiErrorType = "invalid_request" APIErrorNotPermitted apiErrorType = "not_permitted" )
View Source
const ( TileSize = 256 // Standard tile size in pixels EarthRadius = 6378137.0 // Earth's radius in meters (Web Mercator) OriginShift = math.Pi * EarthRadius )
View Source
const R = 6378137.0
Variables ¶
View Source
var ( ErrorInvalidAuthToken *apiError = &apiError{ Code: 400, Description: "invalid auth token", Details: []string{}, ErrorType: APIErrorInvalidAuthToken, Message: "invalid auth token", } ErrorInvalidRefreshToken *apiError = &apiError{ Code: 498, Description: "invalidated refresh_token", Details: []string{}, ErrorType: APIErrorInvalidRequest, Message: "invalidated refresh_token", } ErrorNotPermitted *apiError = &apiError{ Code: 403, Description: "User does not have permissions to access this service", Details: []string{}, ErrorType: APIErrorNotPermitted, Message: "not permitted", } )
View Source
var ServiceTypeNames = map[ServiceType]string{ ServiceTypeGPServer: "GPServer", ServiceTypeFeatureServer: "FeatureServer", }
Functions ¶
func CalculateTileCount ¶ added in v0.0.9
Calculate number of tiles needed to cover the bounds at a given zoom level
func LatLngToTile ¶ added in v0.0.7
LatLngToTile converts GPS coordinates to ArcGIS tile coordinates
func MITMProxyTransport ¶ added in v0.0.7
func MetersToPixels ¶ added in v0.0.9
Convert Web Mercator meters to pixel coordinates
func MetersToTile ¶ added in v0.0.9
Convert Web Mercator meters to tile coordinates
func Resolution ¶ added in v0.0.9
Calculate resolution (meters per pixel) at given zoom level
func ScaleToZoom ¶ added in v0.0.9
If you have scale instead of zoom, convert it
func ServiceRootFromTenant ¶ added in v0.0.3
Types ¶
type AdminInfo ¶ added in v0.0.6
type AdminInfo struct {
CurrentVersion string `json:"currentversion"`
}
type ArcGIS ¶
type ArcGIS struct {
AccountID string
// contains filtered or unexported fields
}
Root structure for an instance of the ArcGIS API
func NewArcGISAuth ¶ added in v0.0.7
func NewArcGISAuth(ctx context.Context, auth Authenticator) (*ArcGIS, error)
func NewArcGISTransport ¶ added in v0.0.7
func (*ArcGIS) GeocodeFindAddressCandidates ¶ added in v0.0.7
func (*ArcGIS) GeometryProject ¶ added in v0.0.9
func (ag *ArcGIS) GeometryProject(ctx context.Context, geometries []response.Geometry) (*response.Project, error)
This isn't tested
func (*ArcGIS) MapServices ¶ added in v0.0.7
func (ag *ArcGIS) MapServices(ctx context.Context) ([]MapService, error)
func (*ArcGIS) NewServiceFeature ¶ added in v0.0.7
func (*ArcGIS) PermissionList ¶ added in v0.0.6
func (ag *ArcGIS) PermissionList(ctx context.Context, serviceName string, serviceType ServiceType) (*response.PermissionSlice, error)
func (*ArcGIS) PortalsGlobal ¶ added in v0.0.7
func (*ArcGIS) PortalsSelf ¶ added in v0.0.3
func (*ArcGIS) SearchInAccount ¶ added in v0.0.7
func (*ArcGIS) ServiceByName ¶ added in v0.0.9
func (*ArcGIS) ServiceByURL ¶ added in v0.0.9
func (*ArcGIS) Services ¶ added in v0.0.3
func (ag *ArcGIS) Services(ctx context.Context) ([]*ServiceFeature, error)
func (*ArcGIS) WebhookList ¶ added in v0.0.4
func (ag *ArcGIS) WebhookList(ctx context.Context, serviceName string, serviceType ServiceType) (*WebhookSlice, error)
type Authenticator ¶ added in v0.0.3
type Authenticator interface {
// contains filtered or unexported methods
}
type AuthenticatorOAuth ¶ added in v0.0.3
type AuthenticatorToken ¶ added in v0.0.3
type AuthenticatorToken struct {
Token string
}
Authentication by adding in a 'token=?' query argument to requests
type AuthenticatorUsernamePassword ¶ added in v0.0.7
type CodeWrapper ¶
type CodeWrapper string
func (*CodeWrapper) UnmarshalJSON ¶
func (c *CodeWrapper) UnmarshalJSON(data []byte) (err error)
type CodedValue ¶
type CodedValue struct {
Code CodeWrapper
Name string
}
type DefaultValueWrapper ¶
type DefaultValueWrapper string
func (*DefaultValueWrapper) UnmarshalJSON ¶
func (d *DefaultValueWrapper) UnmarshalJSON(data []byte) (err error)
type Domain ¶
type Domain struct {
CodedValues []CodedValue
MergePolicy string
Name string
SplitPolicy string
Type string
}
type Envelope ¶ added in v0.0.9
type Envelope struct {
SpatialReference SpatialReference `json:"spatialReference"`
XMax float64 `json:"xmax"`
YMax float64 `json:"ymax"`
XMin float64 `json:"xmin"`
YMin float64 `json:"ymin"`
}
type ErrorFromAPI ¶
type ErrorFromAPI struct {
Code int `json:"code"`
Details []string `json:"details"`
Error string `json:"error"`
Description string `json:"error_description"`
Message string `json:"message"`
}
func (ErrorFromAPI) HasDetail ¶ added in v0.0.7
func (e ErrorFromAPI) HasDetail(s string) bool
type ErrorResponse ¶ added in v0.0.4
type ErrorResponse struct {
Error ErrorFromAPI `json:"error"`
}
func (ErrorResponse) AsError ¶ added in v0.0.4
func (e ErrorResponse) AsError(ctx context.Context) apiError
type MapService ¶ added in v0.0.7
type MapService struct {
ID string
Metadata *response.MapServiceMetadata
Name string
Title string
URL url.URL
// contains filtered or unexported fields
}
func (MapService) PopulateMetadata ¶ added in v0.0.9
func (ms MapService) PopulateMetadata(ctx context.Context) (*response.MapServiceMetadata, error)
type Point ¶ added in v0.0.9
func ExtentSize ¶ added in v0.0.9
type Position ¶
func GeometryToPosition ¶
type Query ¶
type ResourceInfo ¶ added in v0.0.3
type ResourceInfo struct {
CurrentVersion float32 `json:"currentVersion"`
MapName string `json:"mapName"`
SupportsDynamicLayers bool `json:"supportsDynamicLayers"`
//Layers []LayerResource
//Tables TableResource
//SpatialReference SpatialReference `json:"spatialReference"`
SingleFusedMapCache bool `json:"singleFusedMapCache"`
}
type ResponseServiceInfo ¶ added in v0.0.7
type ResponseServiceInfo struct {
CurrentVersion float64
Services []ServiceListing
}
type SearchResponse ¶ added in v0.0.3
type SearchResponse struct {
Total int `json:"total"`
Start int `json:"start"`
Num int `json:"num"`
NextStart int `json:"nextStart"`
Results []SearchResult `json:"results"`
}
type SearchResult ¶ added in v0.0.3
type SearchResult struct {
ID string `json:"id"`
Owner string `json:"owner"`
OrgID string `json:"orgId"`
Created int64 `json:"created"`
IsOrgItem bool `json:"isOrgItem"`
Modified int64 `json:"modified"`
Guid *string `json:"guid"`
Name string `json:"name"`
Title string `json:"title"`
Type string `json:"type"`
TypeKeywords []string `json:"typeKeywords"`
Description string `json:"description"`
Tags []string `json:"tags"`
Snippet string `json:"snippet"`
Thumbnail string `json:"thumbnail"`
Documentation *string `json:"documentation"`
Extent [][]float32 `json:"extent"`
Categories []string `json:"categories"`
SpatialReference string `json:"spatialReference"`
AccessInformation string `json:"accessInformation"`
Classification *string `json:"classification"`
LicenseInfo string `json:"licenseInfo"`
Culture string `json:"culture"`
Properties *map[string]interface{} `json:"properties"`
AdvancedSettings *string `json:"advancedSettings"`
URL string `json:"url"`
ProxyFilter *string `json:"proxyFilter"`
Access string `json:"access"`
Size int `json:"size"`
SubInfo int `json:"subInfo"`
AppCategories []string `json:"appCategories"`
Industries []string `json:"industries"`
Languages []string `json:"languages"`
LargeThumbnail *string `json:"largeThumbnail"`
Banner *string `json:"banner"`
Screenshots []string `json:"screenshots"`
Listed bool `json:"listed"`
NumComments int `json:"numComments"`
NumRatings int `json:"numRatings"`
AvgRating int `json:"avgRating"`
NumViews int `json:"numViews"`
ScoreCompleteness int `json:"scoreCompleteness"`
GroupDesignations *string `json:"groupDesignations"`
ApiToken1ExpirationDate int `json:"apiToken1ExpirationDate"`
ApiToken2ExpirationDate int `json:"apiToken2ExpirationDate"`
LastViewed int64 `json:"lastViewed"`
}
type ServiceFeature ¶ added in v0.0.7
type ServiceFeature struct {
Name string
Metadata *response.FeatureService
URL url.URL
// contains filtered or unexported fields
}
func (*ServiceFeature) LayerMetadata ¶ added in v0.0.9
func (sf *ServiceFeature) LayerMetadata(ctx context.Context, layer_id uint) (*response.LayerMetadata, error)
func (*ServiceFeature) PopulateMetadata ¶ added in v0.0.9
func (sf *ServiceFeature) PopulateMetadata(ctx context.Context) (*response.FeatureService, error)
func (*ServiceFeature) Query ¶ added in v0.0.9
func (sf *ServiceFeature) Query(ctx context.Context, layer_id uint, query Query) (*response.QueryResult, error)
func (*ServiceFeature) QueryCount ¶ added in v0.0.9
func (sf *ServiceFeature) QueryCount(ctx context.Context, layer_id uint) (*response.QueryResultCount, error)
func (*ServiceFeature) QueryEnvelope ¶ added in v0.0.9
func (sf *ServiceFeature) QueryEnvelope(ctx context.Context, layer_id uint, point Point) (*response.QueryResult, error)
func (*ServiceFeature) QueryIDs ¶ added in v0.0.9
func (sf *ServiceFeature) QueryIDs(ctx context.Context, layer_id uint, query Query) (*response.QueryResultOnlyIDs, error)
func (*ServiceFeature) QueryWithin ¶ added in v0.0.9
func (sf *ServiceFeature) QueryWithin(ctx context.Context, layer_id uint, point Point) (*response.QueryResult, error)
type ServiceListing ¶
type ServiceType ¶ added in v0.0.4
type ServiceType int
const ( ServiceTypeGPServer ServiceType = iota ServiceTypeFeatureServer )
type SpatialReference ¶
type TimeInfo ¶ added in v0.0.9
type TimeInfo struct {
TimeExtent []int64 `json:"timeExtent"`
TimeReference *TimeReference `json:"timeReference,omitempty"`
TimeRelation string `json:"timeRelation"`
DefaultTimeInterval int `json:"defaultTimeInterval"`
DefaultTimeIntervalUnits string `json:"defaultTimeIntervalUnits"`
DefaultTimeWindow int `json:"defaultTimeWindow"`
HasLiveData bool `json:"hasLiveData"`
LiveModeOffsetDirection string `json:"liveModeOffsetDirection"`
}
type TimeReference ¶ added in v0.0.9
type WebhookListResponse ¶ added in v0.0.4
type WebhookListResponse struct {
Webhooks []Webhook `json:"webhooks"`
}
type WebhookSlice ¶ added in v0.0.7
type WebhookSlice = []Webhook
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
schema-to-sql
command
|
|
|
schema-to-struct
command
|
|
|
counts
command
|
|
|
dump-map-layer
command
|
|
|
exporter
command
|
|
|
feature-service-spatial-query
command
|
|
|
fieldseeker-default
command
|
|
|
fieldseeker-search
command
|
|
|
layer-to-csv
command
|
|
|
map-tile
command
|
|
|
service-request
command
|
|
|
trap-data
command
|
|
|
version
command
|
|
Click to show internal directories.
Click to hide internal directories.