georeference.org
Subscribe to this thread
Home - General / All posts - How can you tile large images (PNG) ?
yves324 post(s)
#04-Jun-08 23:00

Is there a way to tile large images (in my case png images) and have them accessed by manifold on a local application ?

Thanks for your advice.

dmbrubac


1,399 post(s)
#05-Jun-08 04:41

I have a tiling add-in that's been dormant for a while. Others have asked me to finish it and I will by the end of the week. I will let you now more then.

Here is a partial feature list:

  • Selectable top layer dimensions (e.g. tiles high by tiles wide)
  • Selectable tile size - width and height can be different
  • Up to 25 levels (not that you'd ever want to run the tiler that long!)
  • Save and restore tiling parameters
  • Multi-threaded
  • Labels match perfectly between tiles
  • Will tile Maps, Drawings, Images, etc - anything MapServer will publish.

Will Render (for?) Food

mdsumner


2,971 post(s)
#05-Jun-08 05:26

I'm interested to finish that conversation about perfect label matching. ;)


cuda shuda wuda

dmbrubac


1,399 post(s)
#05-Jun-08 06:18

I'll bet you are

I'll send you a demo copy Mike.


Will Render (for?) Food

yves324 post(s)
#05-Jun-08 11:31

Thanks for your help. I'm interested in this add-in.

firsttube

814 post(s)
#05-Jun-08 11:34

I am interested as well.

thanks


Phish reunion - March 6, 7, 8, Hampton, Virginia.

danb

678 post(s)
#05-Jun-08 13:20

I would definitely be interested in hearing more.

dmbrubac


1,399 post(s)
#06-Jun-08 14:26

Update: See attached screenshot

This is the tiling engine running inside Manifold. You can get a good idea of the available options from the screen shot.

I needed a fairly simple application that I could re-write using the Model-View-Controller (or Model-View-Presenter, depending on how you like to call things) design pattern. For the code heads out there, MVC says you have 3 types of classes in your application;

  • View is UI. It shows and collects data but has no idea what eventually gets done with it. It can have a bit of logic e.g. in options, the width and height numeric controls have a minimum value of 10. If you crank one of them up to 200, check the 'Lock aspect ratio' box and then crank it down again, the box that originally stayed at 100 will eventually try to go less than 10. The UI logic handles that but really not much else. The point is to only have code that is so simple it doesn't need testing.
  • Model is the data. In this case its a serializable class that holds a collection of tile engine settings. It's just values and has no idea what they're for. Again, this code should be simple.
  • Controller is where the real work happens. It connects View and Model, although in Windows, the Controller is usually instantiated in the code-behind of view. Because Controller can almost stand on its own, it's easy to test (although you need to do some mocking - I use RhinoMock).
  • You use interfaces to connect them. Form1 can implement IMyInterface with simple gets, sets or both, some methods (usually not many) and events. Button clicks often just raise an event back to the Controller. The Controller in turn can deal with Form1 as an implementation of IMyInterface. Now you can write a simple ASP.NET page or command line processor that implements IMyInterface and re-use Controller and Model - cool.

This may sound complex, but once you do it it's easy and is much better at compartmentalizing responsibility than putting all your hard working code in the code-behind file.

Anyway, I'm nearly done the rewrite - just wanted to keep you posted.

The screen shot also shows the pesky redraw bug is still there. Component should have a drop-down beside it that shows 'Drawing'. It doesn't because I'd just undocked it and forgot to pass my cursor over the drop-down to refresh it.

I also thought it would be nice to have a drop down of available views that became enabled and dynamically populated if you chose to tile a Map component that had defined views. Selecting a view would generate a tile set of just that view.

Suggest only becomes enabled when the component is or has an image or surface. Suggest will calculate the optimal width, height, levels, tile width and tile height so that Level 0 is sampled at 1:1. Suggest is a bit dodgey right now and will be even more tricky if I implement view rendering.

Comments and questions are welcome

Attachments:
Tiling Engine.jpg


Will Render (for?) Food

adamw


4,662 post(s)
#07-Jun-08 05:44

Suggestions:

  • Set the default number of levels to 5.
  • Assume the least detailed level always consists of 1 tile.
  • Renumber levels so that level 0 is the most detailed level to allow linking generated tiles back into Manifold as an image library (you can do that right now, but the pyramids won't work due to reverse level numbering).
  • Output the dimensions of the most detailed level in pixels and display resolution in meters (feet / degrees) per pixel.
  • Rename the "Exit" button in the Options dialog to "Close", remove the minimize and maximize buttons on that dialog.

What is "Integrate with Google Earth"?

Is there a progress bar during the build process?

dmbrubac


1,399 post(s)
#07-Jun-08 16:11
  • Yup - that's the way it is.
  • Uh huh. See above
  • Ditto
  • OK - good suggestion
  • Yes, you're right. I changed the window style (including the min-max) immediately after posting.
  • Integrate will generate KML and JavaScript as per Chris Marx's discussion with me. Tile set can be shown with Google Earth using this feature.

The progress bar is in the status bar and becomes visible during the build. The status window also reports when level generation is started and stopped.

Thanks Adam!


Will Render (for?) Food

atlasalive

135 post(s)
#08-Jun-08 05:49

Hi Dave,

Another cool feature could be 'Export to S3' ... Amazon's cloud hosting service.

db


Distributed Geospatial Solutions -- makers of AtlasAlive Geo-Hosting Framework dennis@distributedgis.com

dmbrubac


1,399 post(s)
#09-Jun-08 07:37

Renumber levels so that level 0 is the most detailed level to allow linking generated tiles back into Manifold as an image library (you can do that right now, but the pyramids won't work due to reverse level numbering).

Oops. The tiles are generated correctly but the message is wrong. Thanks Adam.


Will Render (for?) Food

atlasalive

135 post(s)
#16-Jul-08 09:21

How's this coming, Dave? Can I help?


Distributed Geospatial Solutions -- makers of AtlasAlive Geo-Hosting Framework dennis@distributedgis.com

muggle4 post(s)
#28-Sep-08 19:03

How can I get this TilingEngine into my manifold? I also want to try it.

adamw


4,662 post(s)
#07-Jun-08 05:35

Either (a) import all images as separate image components, or (b) do that and then merge them into a single image component via copy / paste or by creating a map containing all images and using Make Image to create the image of the map, or (c) if the images are the same size and are aligned in a grid, link them as an image library (if the images are larger than, say, 2000 x 2000, it would be a good idea to split them into smaller equal-size chunks first).

Satyajitray1 post(s)
#28-Jul-08 03:52

Hi All,

I need this add-in. I would like to create a website which is just looks like Mapquest.com

I am new to manifold....would appreciate if some one can help me in rasterising my data at diffrent scales to use with my website.

Thanks & regards

Satya

artlembo


1,596 post(s)
#13-Aug-08 16:21

any news on this?

dmbrubac


1,399 post(s)
#14-Aug-08 04:44

I sent a beta to Chris Marx but he hasn't responded. I will ping him again.

There are a couple issues still to iron out and a few more features to add but it is working.


Will Render (for?) Food

mdsumner


2,971 post(s)
#14-Aug-08 06:00

I'm not under Dave's nondisclosure so I can express my discontent.

Want :|

EDIT: don't make me call the vaporware fairy


cuda shuda wuda

dmbrubac


1,399 post(s)
#14-Aug-08 07:44

OK, I'll send you a beta too.

Edit: OK both you and Art have betas for x86. Let me know if you need x64. I will really try to look at the 1 major issue tonight and get you a new build - latest over the weekend.

BTW, performance on a reasonable system is about 7 tiles per second per execution thread. One thread max today, but when the issue above is fixed the thread limit can come off. That's still a long time if you are doing 18 levels!


Will Render (for?) Food

jkelly

518 post(s)
#28-Sep-08 17:05

I am doing some work with OpenLayers, so this add-on would be mighty handy. Any more news?

Dave, if you wish to discuss it off line, I can be found on james (at @) midway-pl (dot .) com (dot .) au

Cheers

James K.

mysiar
22 post(s)
#27-Oct-08 02:40

Hi dmbrubac

will you add in be public available ?

Regards

Piotr

dmbrubac


1,399 post(s)
#08-Dec-08 10:53

Yes, but for a fee.


Will Render (for?) Food

dmbrubac


1,399 post(s)
#15-Aug-08 08:02

Your email bounced Mike. Send me a (new?) address to davidb whose address might end in geomatica and be in Canada (lets see the email scraper figure that one out )


Will Render (for?) Food

mdsumner


2,971 post(s)
#15-Aug-08 08:08

Thanks Dave, I got it at my myriax email. I had some problems, but I'm keen to push it and get back to you in detail. : 0


cuda shuda wuda

sunsong
203 post(s)
#15-Aug-08 08:56

While the add-in is being finished, here's an interim solution.

Use Manifold's current Link to Image Library Files capability. It's not particularly fast but it does work with PNG files.

This assumes you have created Manifold projection XML files for the PNG files with the same name as the PNG.

Put your PNG and XML projection file or files in a folder.

In Manifold, Link, Image, set type to Image Library Files

navigate to the folder and select one of the PNG files from it.

In the Link Image Library dialogue box, select Georegister images using accompanying files and leave the mask as *.png

Check or uncheck the datum and subfolder boxes depending on what you want.

Hope this helps in the mean time.

dmbrubac


1,399 post(s)
#15-Aug-08 10:14

The purpose of the add-in is to make image library files, to to be a replacement display mechanism.


Will Render (for?) Food

sunsong
203 post(s)
#15-Aug-08 11:30

I'm not sure I'm understanding you.

You don't need to have "image library files" for my method to work.

You can place one large PNG image in the folder and Manifold will generate the image tiles on the fly while you move around. The "on the fly" is probably why it is not very fast.

Kali14 post(s)
#24-Oct-08 06:43

I really Really Need this my tiles are taking about 42 seconds each.... i am in desperate need. if its not done please give me a clue how to get started..

Thanks

Dimitri


2,322 post(s)
#24-Oct-08 06:49

First stop for any questions about performance is the Performance Tips topic at http://www.manifold.net/doc/performance_tips.htm - lots of information there.

Kali14 post(s)
#27-Oct-08 01:32

Thanks Dimitri But I am already running an optimized hardware setup based on manifolds own documentation. Dual Quad Core 2.33ghz Intel Xeon - 8gb Ram 64bit Manifold 8 and 64 bit Server 2008 250gb HD Configured as Raid 10. My Real problem is with manifolds response time to any sort of Http query, it does not seem able to (particularly with WMS and IMS) respond at what one might consider a servicable rate. with the net effect that anything that uses manifold as its GIS backend seems slow and clunky. For example when creating tiles from my Map file via WMS it takes about 15+ seconds per tile, ie for manifold to respond. This seems a little slow. Down to about 45 - 50 Seconds a tile on the office workstations. horribly slow.

We have a map that when rendered as an image is 8.4 gb, we need to tile it and serve it fast to enable a rich experience, how is this possible with manifold's performance, current;y i spend 3 days per layer generating tiles.

What else should i buy ????

Dimitri


2,322 post(s)
#27-Oct-08 07:43

I am already running an optimized hardware setup

Hardware is only part of the Performance Tips topic. If that's all that you are looking at you could be missing some opportunities for more speed.

The standard advice to everyone interested in performance is to go through every item in that topic, line by line, seriously considering each and every one before checking it off as relevant/accomplished or not. This is especially important for any item not fully understood (such as the use of inappropriate location precision, often misunderstood).

See also the advice in http://www.manifold.net/doc/optimizing_performance.htm, which can have very important advice within a single line. For example, since you have eight cores in play have you configured multiple worker processes?

sunsong
203 post(s)
#24-Oct-08 11:38

Kali,

Have a look at this in the Manifold Help

http://www.manifold.net/doc/example_storing_an_image_in_sql_server_2008.htm

Storing your images in a DBMS makes them extremely fast and automatically generates the tiles for you.

Kali14 post(s)
#27-Oct-08 01:17

Hey

Thanks I have trawled the docs endlessly. The Images i need to generate are WMS response type images, my problem is that when tiling my map through tilecache or any http based WMS call Manifold is very slow to generate individual tiles. This is a huge issue because we have a large map and we need regular updates and i need the map to be slick on the Web side so i can integrate with my UX, and the map is not a mash up its all proprietry subscription only information, so if you have any suggestions please let me know

Dimitri


2,322 post(s)
#19-Nov-08 16:20

if you have any suggestions please let me know

Sigh! How about my prior post? ....

See also the advice in http://www.manifold.net/doc/optimizing_performance.htm, which can have very important advice within a single line. For example, since you have eight cores in play have you configured multiple worker processes?

Don't trawl all the docs. Go through the optimizing performance topic line by line. Check each and every item suggested in that topic. It's virtually guaranteed you'll hit something that is a big speed up.

pcardoso


1,383 post(s)
#27-Oct-08 14:09

Are you considering to share the add-in? both x86 and x64.

dmbrubac


1,399 post(s)
#27-Oct-08 15:17

Share as in free? No, but not expensive either - probably $75 per seat, same price for x68 and x64.


Will Render (for?) Food

jkelly

518 post(s)
#27-Oct-08 15:38

I am very happy to spend this, as I am in the same position as Kali, the WMS is just too slow even through tilecache, so I need to be able to pre-generate tiles in an acceptable time to run in openLayers.

pcardoso


1,383 post(s)
#27-Oct-08 16:36

good!

dwatling41 post(s)
#28-Oct-08 00:55

Looking forward to seeing it asap anything i can do to help ?

dmbrubac


1,399 post(s)
#28-Oct-08 04:40

as per the thread in Scripting, I have a project going until Nov 10, then I will finish this one off.


Will Render (for?) Food

dwatling41 post(s)
#24-Nov-08 03:13

Hi Dave

I also have a large map with lots of detail (the .map file is 76MB) and would like to pre-cache tiles to use with openLayers, but find the Manifold WMS server TOO slow! Have you had the opportunity to finish this project?

I would most definitely be interested in the x64 version if it does what we need in a realistic time frame.

Will Feed for Speed!

Thanks

Derek

bochenek1371 post(s)
#19-Nov-08 15:59

Dave,

Any luck in finishing this add on. I would be interested in purchasing it.

Rob

chrismarx

815 post(s)
#08-Dec-08 09:03

sorry to get in on this thread so late (i did try dave's tiler, it works great, but the version i have only allows for tiling to 6 zoom levels), I've been using tilecache with manifold wms, and after following all the optimizing performance tips to the letter, I've got a workable system, although there still appears to be a problem with manifold and/or iis.

for my sites, i take a two fold approach (i will be posting a permanent demo site soon), i pre-seed the cache with tiles ( are people who are using tilecache (which is great by the way!) aware that there is already a script to do this?) for the first couple of zoom levels, then let manifold handle the image production as people zoom in.

this works great because the tiles with lots of data take longer to render, and thankfully, for me, they're also usually the tiles you see when zoomed out, so there arent that many to generate. generating a complete tile set beforehand would take too long, so this way, i can handle the majority of requests before hand, then let manifold file in tiles slowly for the zoom levels that have tons of tiles.

and now to the problem, when iis is fresh, or right after an app pool recycle, the worker processes and manifold seem to be able to handle all of the concurrent wms requests, but as time goes by, sometimes the processes go "bad" somehow, because some of the requests will be successful, and others will return the error i mention here (can't create mapserver) (http://forum.manifold.net/forum/t74325.10)

to get around this, i wrote the app i mentioned at the bottom of the page, it tests if the worker processes are behaving, otherwise, recycles them.

anyways, I generally don't have a problem using the tilecache seed script, perhaps because it never makes concurrent requests, but in any case, you can use to create a tileset for google maps, etc-

I'm not sure where this leaves dave's tiler, i imagine his probably goes much faster than making wms requests...

dmbrubac


1,399 post(s)
#08-Dec-08 10:52

see http://forum.manifold.net/forum/t75321#75375


Will Render (for?) Food

1 msec Copyright (C) 2007-2008 Manifold.net. All rights reserved.