Coder Social home page Coder Social logo

Comments (4)

apaleja avatar apaleja commented on May 22, 2024

I am also getting this same error. did you find any solution ?

from maptilesdownloader.

Dawson-Jiang avatar Dawson-Jiang commented on May 22, 2024

you can print outputType value for check reason

from maptilesdownloader.

RussellTaylor83 avatar RussellTaylor83 commented on May 22, 2024

I have this problem under Ubuntu and not Windows. In server.py, line 133 you'll see

outputDirectory = str(postvars['outputDirectory'][0])

If you print out the value with the following you get different values under Windows and Ubuntu

print("postvars['outputDirectory'][0]: " + str(postvars['outputDirectory'][0]))

Under ubuntu this gives b'{timestamp}' and under windows it gives the correct {timestamp}

I'm not a Python guy but it seems str conversions are handled differently under each OS. On a quick Google search it's something to do with being a byte array and not understanding the character encoding when using str(). Anyway in Ubuntu I swapped out that block of code for this

elif parts.path == '/start-download':
	outputType = str(postvars['outputType'][0], 'utf-8')
	outputScale = int(postvars['outputScale'][0])
	outputDirectory = str(postvars['outputDirectory'][0], 'utf-8')
	outputFile = str(postvars['outputFile'][0], 'utf-8')
	minZoom = int(postvars['minZoom'][0])
	maxZoom = int(postvars['maxZoom'][0])
	timestamp = int(postvars['timestamp'][0])
	bounds = str(postvars['bounds'][0], 'utf-8')
	boundsArray = map(float, bounds.split(","))
	center = str(postvars['center'][0], 'utf-8')
	centerArray = map(float, center.split(","))

Note all str functions having the second argument passed in. Anyway there is probably a correct way to fix this, but this got it running for me for now.

If I get time to figure it out properly I'll post back.

from maptilesdownloader.

AliFlux avatar AliFlux commented on May 22, 2024

I'm currently porting the code to Electron since there are too many python issues including version confusions and performance hits. The v2 will be significantly faster and easier to run

from maptilesdownloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.