|
Prev: 5% paypal handling charge supports the online payment! PayPal
Next: The Partition-Exchange Sort algorithm
From: maud on 28 Jul 2008 00:36 I would like to produce a number of maps with customized pushpins. I do not need to embedded this into an application, however I need to produce many more than I can manually construct. I was hoping someone could recommend a simple application or programming environment to work in. I have been thinking that if I get a background map image, and then create a table of the pixel locations corresponding to map locations, I would just need a program that given some sort of input text file, created an image by placing a designated image on top of the world map image at a designated pixel location. Any ideas? Thanks!
From: Mensanator on 28 Jul 2008 00:52 On Jul 27, 11:36�pm, maud <maud.j...(a)gmail.com> wrote: > I would like to produce a number of maps with customized pushpins. I > do not need to embedded this into an application, however I need to > produce many more than I can manually construct. I was hoping someone > could recommend a simple application or programming environment to > work in. �I have been thinking that if I get a background map image, > and then create a table of the pixel locations corresponding to map > locations, I would just need a program that given some sort of input > text file, created an image by placing a designated image on top of > the world map image at a designated pixel location. > > Any ideas? Keywords: CAD GIS Trivial for programs like AutoCad or ArcView, two of the big commercial players in those areas. And very expensive. You might want to do Google searches on those keywords to see if there are more viable solutions. > > Thanks!
From: Richard Heathfield on 28 Jul 2008 03:11 maud said: > I would like to produce a number of maps with customized pushpins. I > do not need to embedded this into an application, however I need to > produce many more than I can manually construct. I was hoping someone > could recommend a simple application or programming environment to > work in. I have been thinking that if I get a background map image, > and then create a table of the pixel locations corresponding to map > locations, I would just need a program that given some sort of input > text file, created an image by placing a designated image on top of > the world map image at a designated pixel location. > > Any ideas? Writing a very simple image processing library is actually not so hard. The easiest file format to use is probably the BMP format. (If your images are in some other format, any image editing package worth its salt (GIMP, Photoshop, whatever) can convert to and from BMP easily). Writing load and save shouldn't take you more than an hour or so. Then read the pixel data into a buffer having a structure of your own devising (make it easy to have many buffers). I do it like this (well, almost - mine is actually a bit more complicated than this, but I've streamlined it for the purpose of this explanation): struct fbuf_ { unsigned long **pixel; /* 0xRRGGBB */ size_t width; size_t height; }; The idea is that, given a pointer fb to a struct fbuf_, you do fb->pixel=malloc(fb->height * sizeof *fb->pixel) and then loop round each of the rows, mallocing fb->width * sizeof fb->pixel[i] bytes for each row. At this point, you can actually set and get pixels using fb->pixel[y][x] if you like, although you might want to wrap that up in a couple of functions. Then write some supporting routines, especially a little routine to "blit" (copy an image rectangle of a given size) from a given location in one buffer to a given location in another. Clone-and-modify it (or add a flag) to take a particular colour and treat it as transparent (i.e. don't copy pixels of that colour). Then you can do the pushpin-onto-map thing very easily, specifying the background colour of the pushpin image as the "don't copy this" colour - and it will actually look pretty neat if you have a decent pin image. Don't forget to save your resultant image. :-) Yes, it takes some up-front time investment and maybe a little learning, but it's really quite easy, help is available here, and when you're done you should have something you can be reasonably proud of and that you can re-use when the next little graphics job comes along. -- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ Google users: <http://www.cpax.org.uk/prg/writings/googly.php> "Usenet is a strange place" - dmr 29 July 1999
From: Bartc on 28 Jul 2008 05:19 "maud" <maud.july(a)gmail.com> wrote in message news:b08133dd-c89d-414d-94a7-296e4a0a3ea0(a)s50g2000hsb.googlegroups.com... >I would like to produce a number of maps with customized pushpins. I > do not need to embedded this into an application, however I need to > produce many more than I can manually construct. I was hoping someone > could recommend a simple application or programming environment to > work in. I have been thinking that if I get a background map image, > and then create a table of the pixel locations corresponding to map > locations, I would just need a program that given some sort of input > text file, created an image by placing a designated image on top of > the world map image at a designated pixel location. It looks you don't need an application with a user interface, just an utility. In that case the approach can be very simple. However you do need some language or other with a library that can deal with images easily. (With my poor knowledge in that area, I can only think of Python.) I created the semi-pseudo code below as an example of this approach. The library functions bmload/bmsave (wrappers around Intel's IJL library) convert an image (it doesn't have to be jpeg) into internal form, in this case a Windows format akin to BMP -- I believe something called a 'dib-section'. The library function gxcopy (implemented at some deep level as Windows GDI) is designed for bit-blitting between windows, but here works just as well for copying pixels between images. define inputimg = "bart01.jpg" define pinimg = "pin.jpg" define outputimg = "markedup.jpg" define datafile = "locations.txt" PROC START= bmain:=bmload(inputimg) if bmain=nil then stop fi bpin:=bmload(pinimg) if bpin=nil then stop fi fin:=openfile(datafile) if fin=0 then stop fi while not eof(fin) do readln #fin,x,y gxcopy(bmain,bpin,x,y) od closefile(fin) bmsave(bmain,outputimg) END -- Bartc
From: Ben Bacarisse on 28 Jul 2008 06:26 maud <maud.july(a)gmail.com> writes: > I would like to produce a number of maps with customized pushpins. I > do not need to embedded this into an application, however I need to > produce many more than I can manually construct. I was hoping someone > could recommend a simple application or programming environment to > work in. I have been thinking that if I get a background map image, > and then create a table of the pixel locations corresponding to map > locations, I would just need a program that given some sort of input > text file, created an image by placing a designated image on top of > the world map image at a designated pixel location. > > Any ideas? As has been pointed out, you just need a utility to: (1) process the file of locations (2) generate overlayed images from a source map and a "pin" image I have done this sort of thing in the past with out any traditional programming. The ImageMagick[1] toolkit includes command-line utilities to generate and transform images, and others to built composites from one image overlayed on another. With a good input format to start with you can do it all with a small bit of "shell" scripting. [1] http://www.imagemagick.org/ -- Ben.
|
Next
|
Last
Pages: 1 2 Prev: 5% paypal handling charge supports the online payment! PayPal Next: The Partition-Exchange Sort algorithm |