1

I am fairly new to GIS, and brand new to ArcGIS Pro (came from ArcMap).

I recently created a visual basic program that generates an image from the Google Static Maps API with a respective ESRI world file (.PGW). Below is an example image with the corresponding world file:

staticmap.png

0.000171661 
0
0
-0.00012673
-122.8704705 
42.4147755

The image is named "staticmap.png" and the world file is "staticmap.pgw", they are both saved in the same folder. Here are some of the things I've tried so far:

  • Loading it in without the world file present, it loads in the Pacific Ocean.
  • Assigning the Mercador Web Map and then loading the image with world file in my map, which results in it appearing outside of Africa (it should be in southern oregon).
  • Deleting all references to the image / world file in ArcGIS Pro and regenerating both, loading into my map without a projection (It loads in the same spot it loaded without a world file present). This step convinced me that the program is ignoring my world file for some reason, maybe I wrote it incorrectly?
  • Tried it in ArcMap with the same results.
  • What spatial reference are you assigning to the layer? – Kirk Kuykendall Mar 26 at 18:09
  • According to Googles support page for the Static Maps API their imagery uses the WGS 1984 Web Mercador projection, I am using that as the spatial reference. – dashton Mar 26 at 18:11
  • Did you try replacing the -122 and 42 in the pgw with their web mercator coordinates for that location? – Kirk Kuykendall Mar 26 at 18:24
  • Ah you might be onto something here, I just used the Lat Long coordinates from points on google maps. Let me check and see. – dashton Mar 26 at 18:30
0

ArcGIS IS reading your pgw file. Your file points the x1, y1 point (the two last numbers in your pgw file) to -122.8704705, 42.4147755, which is in Web Mercator, near Africa. When it should be pointing to something like -13396443.965, 5568945.439 (coordinates near Oregon).

  • Thank you for this! Those coordinates I am using are the Lat Long values from Google Maps, are they GPS units? Sorry I am a complete novice with coordinates and transformations. – dashton Mar 26 at 18:34
  • Yes, when I open your file in geographic coordinate system, the image appears in Medford. Geographic coordinates systems use degrees as units, the Web Mercator is a projected coordinate system and uses meters as units. – Lucas Mar 26 at 18:52
  • Be careful to not just change coordinates because the cell values will be still wrong. Use ArcToolbox->Data Management Tools->Projections and Transformations->Raster->Project Raster and set the gcs initial projection and the Webmercator output projection (search for 3857 epsg). I could reproject it changing extension to tif. The tfw should be like this: 22.2355311179 0.0000000000 0.0000000000 -16.4137715288 -13677876.6464319360 5223316.0736071728 – Lucas Mar 26 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.