NathanW2 / ascii_qgis

A ASCII QGIS map viewer
http://nathanw2.github.io/ascii_qgis
25 stars 4 forks source link

Lessons Learned #4

Open geowurster opened 8 years ago

geowurster commented 8 years ago

I was hoping someone would take vector text rendering to this level. Using the QGIS API is pretty clever.

I hope this isn't an unwanted suggestion, but one lesson I learned from gj2ascii is that adding an empty space after each character (effectively between "pixels") produces a graphic that looks less squished. Ideally this empty space would be the same character as the "pixel" to produce a more continuous graphic although I have not tried this. An area that is two characters wide and one line tall is closer to being square than an area one character wide and one line tall. The big trade off is that you can't render as much data in each rendered view because you have to cut the vertical width in half. The array2ascii() function handles this if you're interested.

If (when?) I do another pass through gj2ascii I would also use Numpy arrays wherever possible, which should be faster than the list-of-lists arrays.

NathanW2 commented 8 years ago

Thanks for the advice. Much appreciated. Happy to take any and all feedback.

Here is a update using the double row idea. Thanks it looks heaps better.

image

image

I'm going to try numpy once I get a chance to learn it. Hopefully it's a easy drop in. Have never really used it before.

geowurster commented 8 years ago

Ah yeah the double pixel thing works! I'll try to find a couple minutes sometime in the next few days to sketch out at least layer stacking with Numpy.

NathanW2 commented 8 years ago

That would be cool. I have added some timing around the code now so I will try to get it down to as fast as I can