Skip to content

Commit

Permalink
Add def world_file it will output a .pgw file on map export
Browse files Browse the repository at this point in the history
  • Loading branch information
heldersepu committed Nov 29, 2015
1 parent 3140a70 commit e0b686d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
5 changes: 5 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Nov 2015 H.S <[email protected]>
* 0.8.0.6
* Migrate code to GitHub
* Add a world map file to the export

July 20 2013 H.S <[email protected]>
* 0.8.0.5 - At revision: 1590
* Fix issue in py2exe that created problems in Win 8
Expand Down
2 changes: 1 addition & 1 deletion gmapcatcher/mapConst.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import locale

NAME = "GMapCatcher"
VERSION = "0.8.0.5"
VERSION = "0.8.0.6"
VERSION_NAME = ""
WEB_ADDRESS = "http://GMapCatcher.GoogleCode.com"

Expand Down
12 changes: 12 additions & 0 deletions gmapcatcher/mapServices.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,23 @@ def do_combine(self, tPoint, zoom, layer, online, conf, size, mode="RGBA"):
x += 1
fileName = tPoint['FileName']
result.save(fileName)
world_file(tPoint)
return fileName
except Exception, inst:
print str(inst)
return 'error=' + str(inst)

## Create world file with the given data
def world_file(self, tPoint):
file = open(tPoint['FileName'].replace(".png", ".pgw"), 'w')
file.write("0.0000000007\n")
file.write("0.0000000000\n")
file.write("0.0000000000\n")
file.write("-0.0000000007\n")
file.write(str(tPoint['lowCoord'][0]) + "\n")
file.write(str(tPoint['lowCoord'][1]) + "\n")
file.close()

## Export tiles to one big map
def do_export(self, tPoint, zoom, layer, online, conf, size, mode, callback):
def exportThread():
Expand Down
2 changes: 1 addition & 1 deletion installer/setup.nsi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!define PRODUCT_NAME "GMapCatcher"
!define PRODUCT_VERSION "0.8.0.5"
!define PRODUCT_VERSION "0.8.0.6"
!define PRODUCT_WEB_SITE "http://code.google.com/p/gmapcatcher/"
!include nsDialogs.nsh

Expand Down
10 changes: 6 additions & 4 deletions maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,16 +607,18 @@ def update_export(self, *args):
self.tPoint['yHigh'] = tile[0][1] + (heightFact - int(heightFact / 2))

lowCoord = mapUtils.tile_to_coord(
((self.tPoint['xLow'], self.tPoint['yLow']),
(0, 0)), self.export_panel.expZoom.get_value_as_int()
((self.tPoint['xLow'], self.tPoint['yLow']), (0, 0)),
self.export_panel.expZoom.get_value_as_int()
)
self.tPoint['lowCoord'] = lowCoord
self.export_panel.entryUpperLeft.set_text(str(lowCoord[0]) + ", " + str(lowCoord[1]))
self.tPoint['FileName'] = "coord=%.6f,%.6f_zoom=%d.png" % lowCoord

highCoord = mapUtils.tile_to_coord(
((self.tPoint['xHigh'], self.tPoint['yHigh']),
(0, 0)), self.export_panel.expZoom.get_value_as_int()
((self.tPoint['xHigh'], self.tPoint['yHigh']), (0, 0)),
self.export_panel.expZoom.get_value_as_int()
)
self.tPoint['highCoord'] = highCoord
self.export_panel.entryLowerRight.set_text(str(highCoord[0]) + ", " + str(highCoord[1]))

# Set the vars to draw rectangle
Expand Down

0 comments on commit e0b686d

Please sign in to comment.