2

After some work, I managed to extract some PNGs out of a GIS we have at work. This GIS has some polygons in which addresses are surrounded by them. I managed to create an extractor in Python and to align the overlays and google maps pretty well, although it is not perfect. My question is, what I'm doing wrong or overlooking when making these transformations, to make them align perfectly.

For example, I have this image:

Polygon overlay onto Google Maps

As you can see, it aligns, but not perfectly, I found out a method for alignment using the markers, and dragging them to modify the overlay, but when there are 64 images, it is a very long process.

The overlay PNG comes from a different coordinate system (WGS72 BE UTM). What I did was a Python script that downloads all the tiles necessary for 2 given points (SouthWest,NorthEast), and then prints out the boundaries for all the tiles so I can place them onto Google Maps.

This is an example of the program run:

X1: 348724
Y1: 6294333
X2: 354334
Y2: 6300043
Delta: 4100
Processing...

4 images will be downloaded...
image:  0001  limits:  348724 , 6294333 ; 352824 , 6298433
1
image:  0002  limits:  348724 , 6298433 ; 352824 , 6302533
2
image:  0003  limits:  352824 , 6294333 ; 356924 , 6298433
3
image:  0004  limits:  352824 , 6298433 ; 356924 , 6302533
4

The data is in Santiago, Chile.

Then I convert those limits to Google Maps coordinates (WGS84) and place them. However, the results are not precise. It would be great to hear your ideas. I hope explained myself correctly.

  • 1
    Are you converting between WGS 72 BE and WGS 84? EPSG registry has 1239 to convert between WGS 72 BE and WGS 72, then 1237 or 1238 to go from WGS 72 and WGS 84. However, I think you're off more than that. Could it be on PSAD56 or SAD69 instead? – mkennedy Feb 8 '17 at 17:49
  • I grabbed a random building with its WGS 72 coordinates, and converted them to WGS 84, it aligned perfectly so it is not that. Maybe there is some bug in my code. I don't really know a lot about geography but maybe some distortion from the earth's roundness has to do with the problem. Would it help if I post the code? – SeñorPythoniano Feb 8 '17 at 18:34
1

I have had a similar problem before and found that the solution was increasing the coordinate precision of the other projection before reprojecting to the coordinate system used for the map overlay. Of course this will only work if you were using a lower precision than the data started with. You cannot just increase precision if the data is stored with a lower precision than needed. Have you tried doing that? You will also want to make sure that you aren't ever rounding coordinates anywhere.

  • Precisely that's why I used whole values (no decimals coordinates) for the points. See the code above, the Xs and Ys are all integers, so I avoid decimals from that point on. I haven't rounded anything, what Im thinking is maybe the coordinates converter Im using doesnt work as expected. – SeñorPythoniano Feb 8 '17 at 17:11

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.