Select to view content in your preferred language

Problem with same center-point showing different view in Arcgis and Google static map

2296
2
04-14-2016 04:53 AM
DevelopmentTeam
New Contributor

We need to write a map service that returns a static map image in png. The map service will return 25 nearest records from a center point (lat/long input to the service) within 0.25 and 0.5 mile radius (Red and Yellow circle in the map). We are getting different results when using the Google Map and the ArcGIS Map as basemap Layer. Please see below the comparative images to know the difference between the result images. The left side images are generated using Google Map as basemap layer and the right side images are generated using the ArcGIS map as the basemap layer.

This is happening for some locations though, for some locations the maps are identical.

Example No - 1

map1.png

     lat=61.230110000000082 lng=-149.89142999999996

Example No - 2

map1.png

lat=40.641575 lng=-74.134704

Example No - 3

map2.png

lat=60.9075 lng=-161.229402

Code

1.Geocode Server find

https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text=" . $lng . "," . $lat . "&outFields=addr_type&f=json

2. Basemap layer

World_Topo_Map (MapServer)

We have used Map option scale as 18055.954822 for zoom level.

3. Circle layer using symbol

Circle red [ 0.25 mile radius ]  size  : 175 

Circle yellow [ 0.50 mile radius ]  size  : 350

4. Custom feature server layer data for multi point.

     https://services6.arcgis.com/xxxxxxxxxx/ArcGIS/rest/services/Facility_Data/FeatureServer/0/

     where=(( 6371 * acos( cos( '.$lat.' * 0.01745 ) * cos( (LATITUDE83) * 0.01745 ) * cos( ((LONGITUDE8) * 0.01745) - ('.$lng.' * 0.01745) ) + sin( '.$lat.' * 0.01745) * sin( (LATITUDE83) * 0.01745 ) ) ) ) / 1.60934 <= .5

5. Then sorting

$sort = array();

foreach($features as $key => $value){

$xa = $value['geometry']['x'];

$ya = $value['geometry']['y'];

$id = $value['attributes']['OBJECTID'];

$pi = pi() / 180.0;

$dis = (( 6371 * acos( cos( $lat * $pi ) * cos( $ya * $pi ) * cos( ($xa * $pi) - ($lng * $pi) ) + sin( $lat * $pi) * sin( $ya * $pi ) ) ) ) / 1.60934;

$sort[$id] = $dis;

$data[$id] = $value;

}

asort($sort);

Can you please guide on what is the problem here?

0 Kudos
2 Replies
JenniferMcCall4
Frequent Contributor

Could it be a projection issue?

0 Kudos
DevelopmentTeam
New Contributor

Thanks Jennifer for the reply.

That is very much possible. But is there a way we could control the projection in ArcGIS Basemap?

To me it looks like that the main difference between these two cases are that the circles in the google map is exactly maintaining the 0.25 and 0.5 miles radius as we are passing these parameter in miles while calling the API, so even in cases when of the zoom level changes, the circles may show up in smaller or bigger sizes but the points are never outside the designated circle as their physical location over the map is never changed. But in case of the ArcGIS map we are not able to send the 0.25 and 0.5 miles as parameter to draw the circles. We are drawing the circles by calculating the pixel radius and trying to match with the physical distance. So the map draws the circle measuring the pixel, it does not consider the actual physical distance. So it is geometrically correct but if the basemap layer is not projected exactly like google map as you have anticipated or in some other way it is tilted, then the circles are far from "geospacially" correct.

Can you please advise?

0 Kudos