VIAMICHELIN SOAP API


XYTOPIXELS

Description 

This method takes a map definition and an array of geographic coordinates, and converts each geographic coordinates in pixels coordinates. 
Specifications 

  • The method enables to convert an array of geographic coordinates.
  • The maximum number of items in the array is 1000. Beyond this limit, a SOAP fault is returned.
  • The minimum number of items in the array cannot be lower than 1. Otherwise, a SOAP fault is returned.
  • The geographic coordinates used are WGS84 encoded.

Input Parameters 

 Parameter  Mandatory  Description
request (XYToPixelsRequest) true Specifies a map definition (by scale or by identifier) and an array of geographic coordinates to convert.
authenticationParams (String) true Specifies an authentication identifier for accessing Web Service: login + '|' character + password

Output Parameter 

 Parameter  Description
PixelPoint Array of pixel coordinates. Each item corresponding to a supplied geographic coordinates.

Use 

To convert geographic coordinates into pixels coordinates using the XYToPixelsRequest you have to specify the following attributes:
  • geoCoordinatesList attribute defines the array containing the list of points in geographic coordinates (GWS84 encoded) to be converted in pixel coordinates.
  • mapDefinition attribute (see InputMapDefinitionList) contains the definition of the map from which the conversion must be applied.

Note 

This Web service billing is from now based on the number of successful requests received. 
Errors 

 Error code  Description  Possible problems
800 Invalid request value - request value is not defined (null)
801 Invalid geographic coordinates list - the list of geographic coordinates is not defined (null)
- the list of geographic coordinates is empty
- the list of geographic coordinates contains more that 1000 items.
802 Invalid map definition - supplied map definition is invalid
3 Abnormal service termination - internal problem

Code sample (Java)
XYToPixelsRequest request = new XYToPixelsRequest(); 
// ********************************** 
// set Map definition 
// ********************************** 
InputMapDefinitionList mapDefList = new InputMapDefinitionList(); 
MapDefinitionByID byID = new MapDefinitionByID(); 
byID.setMapId("-t64x77veem7abp"); 
ImgSize mapSize = new ImgSize(); 
mapSize.setWidth(400); 
mapSize.setHeight(400); 
byID.setMapSize(mapSize); 
mapDefList.setByID(byID); 

request.setMapDefinition(mapDefList); 

// ********************************** 
// set geographic coordinates list 
// ********************************** 
GeoCoordinates[] geoCoordinatesList = new GeoCoordinates[2]; 
GeoCoordinates coord = null; 

coord = new GeoCoordinates(); 
coord.setLongitude(2.6296176627249546); 
coord.setLatitude(47.33633397046694); 
geoCoordinatesList[0] = coord; 

coord = new GeoCoordinates(); 
coord.setLongitude(1.1907023890040493); 
coord.setLatitude(48.46521339325698); 
geoCoordinatesList[1] = coord; 
request.setGeoCoordinatesList(geoCoordinatesList); 

// invoke MapManagement Web Service
MapManagementLocator locator = new MapManagementServiceLocator(); 
MapManagement service = locator.getMapManagement(); 
PixelPoint[] result = service.xyToPixels(request, "YOUR_LOGIN|YOUR_PASSWORD");

Code sample (VB.NET)
Will be available in a future version

Code sample (C#.NET)
Will be available in a future version