UnitsPerDIP question

476
1
11-03-2020 02:55 PM
BrianCrist
New Contributor II

Hi Y'all,

  This is an embarrassing question to ask, because it will expose my ignorance to GIS topics.  But I can't figure out how to do this operation and I'm wondering if someone could throw me a bone.

  So I have an image that I need to scale based on the zoom level of the map and place in a PictureMarkerSymbol.  (Operating in Map / MapGraphicsView).  When I place the image at location 0,0 (WGS84), the UnitsPerDIP call returns a value that scales the image appropriately.  But (perhaps obviously), when I place the image at a location away from (0,0), the image's size is different.

  So is the solution to use the GeometryEngine to MoveGeodetic to the location in question?  If so, I don't really understand how to "move" a PictureMarkerSymbol (which is referenced by a single point) instead of something like the 4 corners of an envelope... but an envelope isn't the geometry I need.

  Another way to put it:  I have an icon that is a 10x10 meter square.  When I scale my original graphic's PNG using UnitsPerDIP at location 0,0 it scales properly.  When I scale it at WGS84 lon,lat (-70.6, 41.9) the graphic renders to somewhere in the mid 7 meters per side.  How do I make it 10x10 meters at (-70.6, 41.9)? 

Thank you,

  Brian Crist

0 Kudos
1 Reply
LucasDanzinger
Esri Frequent Contributor

UnitsPerDip was primarily created for creating a scale bar. The inherent problem with measuring distance is that many map projections don't preserve distance. Web mercator, for example preserves direction but not distance or size - the further you move away from the equator, the more inaccurate the distance will get. The best solution is to use a spatial reference that preserves distance. This Learn ArcGIS lesson might be interesting to you https://learn.arcgis.com/en/projects/choose-the-right-projection/ 

0 Kudos