Exporting map from TileMill to PDF/SVG - pdf

I have such a big problem with exporting and importing map from TileMill to Illustrator/Inkscape. The problem is with strokes of labels / names.
It seems that TileMill export each letter of label as a separate expanded path–object and doing an outline of that. The result is very bad. Take a look: http://cl.ly/image/0Z2o2v3v2r2C
Do you have any ideas how to fix it? Or maybe there is a solution to create a working text path in Illustrator from that kind of object?

This is unfortunately an upstream bug in Mapnik, and upstream from there in the raw SVG rendering libraries it uses.

Related

p:dataexporter columns with images

I want to export a datatable (with p:graphicImages in columns) in PrimeFaces but even in the new version of PrimeFaces I can only see the alt: value of image in my PDF file. Can't I export graphicImage itself?
It's also asked in this link comment #3.
No you can't, not without extending the exporter
I can give you two ideas of how I got to put in a pdf images:
1. Use a printer (), then print it to pdf and you're done. You will have your table with the pretty images.
2. Generate the PDF using iText and you can personalize it as far as you want.

.mesh file "ref" var explanation

I am trying to understand the .mesh files, usually generated for mesh visualization with Medit.
The documentation is here, but it is in french.
The thing I understand is that after every line describing and object in the file (vertex, triangle, tetrahedra, etc.) it comes a ref variable, that in the examples files I have, they usually are 0,1,2,3 and I don't understand what is their purpose.
Can somebody please explain this?
You can get an .mesh example here.
Each reference corresponds to a color in Medit. The colors are arbitrary, and can be changed in Medit (using the GUI or changing a configuration file).
The reference values in the Mesh file refers to a color index. Maybe the program uses this to display the vertices, triangles and tetrahedra with certain colors. You can ignore this value for all practical purposes.

Maya: Create temporary MFnMEsh for smooth export

Im writing an exporter that exports the subdivision preview mesh via the 'generateSmoothMesh()' method like this:
MFnMesh mesh(mesh_dag_path);
MFnMesh subdiv_mesh(mesh.generateSmoothMesh());
but after the export finishes the new subdivided geometry is left in my maya scene. How should i deal with this geometry, or is this even the right way to be doing this export?
my first instinct is to delete the geometry after the export is finished, if this is the correct thing to do does anybody know he correct way to delete the geometry from the api
Saying you need to do it from the API makes me think this is a command plugin. Correct me if I'm wrong. One way to do it is to run MEL code from your plugin with MGlobal .
MGlobal::executeCommand(MString("delete meshTransform;"));
Where meshTransform is the transform of the newly created mesh. You can get it by having parentOrOwner be MObject::kNullObj.
Or you can directly use:
MGlobal::deleteNode()

Table template for org-mode pdf export

I'd like my tables to be the same width (75% text width) in my org pdf export.
I've used http://emacs-fu.blogspot.co.uk/2011/04/nice-looking-pdfs-with-org-mode-and.html to add a nice title page and some other customisations, but I can't work out how to stop the exporter putting \begin{center} around the tables.
Ideally I'd like to be able to control the export for these and potentially other entities, but having scoured the documentation I can't find much that will let me accomplish this at a global level rather than having to specify it on every table.
A quick read through the org-mode code got this sorted.
(setq org-export-latex-tables-centered nil)
Loads of other variables listed in /lisp/org-latex.el for the curious.
#+ATTR_LATEX: :center nil
will do this for a single table, if you don't want to turn off centering globally.

How do you assign a default Image to the Blob object in Play framework?

I followed this nice article
http://www.lunatech-research.com/playframework-file-upload-blob
and have a perfectly working image upload solution
My questions is, if the user doesn't select any image, how do I assign a default image during save (probably stored in the server)?
if (!user.photo)
user.photo= ?;
user.save();
The one-hack that I can think of is upload the default image and see which UID "Play" stores in the /tmp directory and assign that above. Is there an elegant named* solution to this?
when I say named, I mean I want the code to look like (which means I know what I'm doing and I can also write elegant automated code if there are more than one picture)
user.photo= "images/default/male.jpg"
rather than (which means I'm just hacking and I can't extend it elegantly for a list of pictures)
user.photo= "c0109891-8c9f-4b8e-a533-62341e713a21"
Thanks in advance
The approach I have always taken is to not change the model for empty images, but instead do something in the view to show a default image, if the image does not exist. This I think is a better approach because your are corrupting your model for display purposes, which is bad practice (as you may want to be able to see all those who have not selected an image, for example).
To achieve this, in your view you can simply use the exists() method on the Blob field. The code would look like
#{if user.photo.exists()}
<img src="#{userPhoto(user.id)}">
#{/if}
#{else}
<img src="#{'public/images/defaultUserImage.jpg'}">
#{/else}
I have assumed in the above code that you are rendering the image using the action userPhoto as described in the Lunatech article.
I'd assume you can store the default image somewhere in your applications source folder and use
user.photo.set(new FileInputStream(photo), MimeTypes.getContentType(photo.getName()));
to save the data. Photo is just a File object, so you can get the reference of your default image and use it.