473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Python - Map decode routine problem?

Python programmers may find the application to decoding an encrypted
map
image format known as Memory Map to produce a standard PNG image file
interesting.

Someone obviously very well versed in Python and in the intricacies
of image
files has written a routine to decode originally the UK Landranger
maps, so
that they can be used with other mapping and GPS programs apart from
the
restricted Memory Map viewer.

You can get the details in this RAR archive.
http://www.mediafire.com/?3twm5xbozet

The application was obviously written with a specific job in mind,
and has
no GUI and is not very user friendly for people to use who are not
Python
experts.

One of the problems is that the original application was intended for
UK
Landranger map squares which are 20000 pixels square, and when
decoded from
Memory Map qct format to PNG format the files produced are around 50-
60
megabytes which is quite manageable as a PNG image. PNG has to be
fully
loaded into RAM to manipulate, can't be paged from disk. But with a
much
larger qct image file, to decode it into a single PNG file would
produce too
big a file for most computers to handle when a say 200Mb PNG file on
disk is
decompressed into RAM.

So it is necessary to be able to decode large qct (Memory Map Image)
files
into map squares of a manageable size.

Easy enough when you know how! Problem is the existing Python routine
starts
decoding at the top left of the qct image file, and the only control
in the
routine that I have been able to decipher is the number of pixels
along an
edge of the square that are decoded which are controlled in the code
line

extractsquare(row[2],row[1],int(row[3]),int(row[4]),20000)

near the end of the file qct2png.py

The last term 20000 sets the edge length of the decoded square.

The question is how can this routine be modified to start the
decoding at
pixel x,y, instead of at pixel 1,1 in the qct file, and to then
decode a map
square of say 20000 pixels edge length from that point, so that a qct
image
perhaps 60000 x 60000 pixels could be decoded into 9 squares of 20000
x
20000?

The original programmer has solved all of the complex problems of
decrypting
the encrypted file format and the routine works as intended, but with
a much
larger qct file than the originally intended target you are limited
to
decoding a square of about 30000 pixels edge depending on how much
RAM your
computer has to later handle the resultant PNG image file. Usually
the PNG
file needs to be further converted to a format which can be paged
from disk
such as MrSID or ozf2 which is a format used by a very popular GPS
application called OziExplorer.

Does anyone know any "Python Pirates" who could solve this?

Could you post a suggested code alteration to do this to this
newsgroup
please?
Dec 15 '07 #1
0 3321

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Edward K. Ream | last post by:
Previous to Python 2.3 my app has destroyed the root Tk window using root.destroy rather than the more usual root.quit. In Python 2.3 this does not work so well. In some situations (i.e., for some...
16
by: Paul Prescod | last post by:
I skimmed the tutorial and something alarmed me. "Strings are a powerful data type in Prothon. Unlike many languages, they can be of unlimited size (constrained only by memory size) and can hold...
5
by: Michael Sperlle | last post by:
Is it possible? Bestcrypt can supposedly be set up on linux, but it seems to need changes to the kernel before it can be installed, and I have no intention of going through whatever hell that would...
0
by: Independent | last post by:
Python programmers may find the application to decoding an encrypted map image format known as Memory Map to produce a standard PNG image file interesting. Someone obviously very well versed in...
0
by: james.duckworthy | last post by:
Python programmers may find the application to decoding an encrypted map image format known as Memory Map to produce a standard PNG image file interesting. Someone obviously very well versed in...
1
by: anonymous | last post by:
1 Objective to write little programs to help me learn German. See code after numbered comments. //Thanks in advance for any direction or suggestions. tk 2 Want keyboard answer input, for...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.