GeoscienceAustralia / ga-worldwind-suite

A collection of tools created by the Geoscience Australia (GA) Movies and 3D Visualisation (M3DV) team. The tools are built around the NASA World Wind Java SDK, an open-source virtual globe toolkit.
40 stars 24 forks source link

Tiler Geoscience Australia #102

Closed shyamnguitar closed 10 years ago

shyamnguitar commented 10 years ago

Dear Team,

Firstly I would like to congratulate the Geoscience team for doing some excellent tools like Tiler , Viewer and Animator and after that sharing it with all of us.

I was working on tiler since last 1 month. The way it was producing PNG tiles of a Geotiff is amazing.Am trying to serve the tiles produced by the Tiler through NASA WW WMS Server.

Currently am facing three different issues related to Tiler.

  1. Geotiff files when I tile using Mapnik gdal rasters option , the PNGs created after tiling have turned to grayscale and lost their color.
  2. When I tried to tile elevation data including DTED(DT0, DT1, DT2) the tiler creates .bil files only.Am clueless as to how to serve these bil files through WMS server.
  3. Here am trying to tile a vector file inserted as table in DB.The XML file input for Mapnik Tiling is giving me an error saying that there is no PostGIS plugin.The XML file am using is as below. Exact Error it displays in tiler windows is "unhandled exception:System Exception: Culd not create datasource:No plugin found for type 'postgis'(Serached in C:\ga-worldwindsuite-master\Tiler\target\executable\tiler-windows-x86\mapnik) excountered during parsing of C:\file.xml"

<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE Map>

cultiv postgis 172.16.210.80 postgres postgis xyz2k13 (SELECT \* from cultiv) as "xx" 5432 false 77,33.50,77.25,33.75

Your help is appreciated.

mdehoog commented 10 years ago
  1. Are you using the "GDAL dataset" option, or the "Mapnik map" option? If the latter, you can test your map.xml by passing it to the Tiler/mapnik/nik2img.exe using a command prompt. This is what the tiler uses to generate tile images from the mapnik XML definition file.
  2. I'm not familiar with NASA's WW WMS Server. We use our own server to serve elevation/image tile data. It is a simple .jsp file available in the repository in the TileServer/tile_server directory. You may get a better answer for how to serve elevation data using NASA's server on the WorldWindCentral forums.
  3. The postgis mapnik plugin is not included in the Tiler distribution because we get unsatisfied depencency errors when trying to use it (we don't have postgis installed). The plugin is available in the .7z file here: http://sourceforge.net/projects/mapniknet/. Try copying the "mapnik_postgis.input" file into the Tiler/mapnik directory and try again.
shyamnguitar commented 10 years ago

Thank you very much Michael for the prompt reply.

Can you let me know how can I use the Tile server for elevation. Help me with the configuration of TIleserver. Any particular of Tomcat version that I have to install. I have Apache Tomcat installed in my system.Now where should I create the folder and copy these jsp files. Also in Common.inc where should I indicate the path to tiles directory.

Regards

On Tue, Sep 17, 2013 at 5:40 AM, Michael de Hoog notifications@github.comwrote:

1.

(Grayscale issue). Are you using the "GDAL dataset" option, or the "Mapnik map" option? If the latter, you can test your map.xml by passing it to the Tiler/mapnik/nik2img.exe using a command prompt. This is what the tiler uses to generate tile images from the mapnik XML definition file. 2.

(Elevation serving). I'm not familiar with NASA's WW WMS Server. We use our own server to serve elevation/image tile data. It is a simple .jsp file available in the repository in the TileServer/tile_server directory. You may get a better answer for how to serve elevation data using NASA's server on the WorldWindCentral forums. 3.

The postgis mapnik plugin is not included in the Tiler distribution because we get unsatisfied depencency errors when trying to use it (we don't have postgis installed). The plugin is available in the .7z file here: http://sourceforge.net/projects/mapniknet/. Try copying the "mapnik_postgis.input" file into the Tiler/mapnik directory and try again.

— Reply to this email directly or view it on GitHubhttps://github.com/ga-m3dv/ga-worldwind-suite/issues/102#issuecomment-24555196 .

shyamnguitar commented 10 years ago

I have configured the Tile Server as mentioned by copying all the JSP files in the Tomcat which is a JSP container.When I use the complete link on the browser it remains blank.

I hae tried http://localhost:8080/wwtileserver/tiles.jsp

somebody pls help

On Tue, Sep 17, 2013 at 12:48 PM, shyam megha shyamnguitar@gmail.comwrote:

Thank you very much Michael for the prompt reply.

Can you let me know how can I use the Tile server for elevation. Help me with the configuration of TIleserver. Any particular of Tomcat version that I have to install. I have Apache Tomcat installed in my system.Now where should I create the folder and copy these jsp files. Also in Common.inc where should I indicate the path to tiles directory.

Regards

On Tue, Sep 17, 2013 at 5:40 AM, Michael de Hoog <notifications@github.com

wrote:

1.

(Grayscale issue). Are you using the "GDAL dataset" option, or the "Mapnik map" option? If the latter, you can test your map.xml by passing it to the Tiler/mapnik/nik2img.exe using a command prompt. This is what the tiler uses to generate tile images from the mapnik XML definition file. 2.

(Elevation serving). I'm not familiar with NASA's WW WMS Server. We use our own server to serve elevation/image tile data. It is a simple .jsp file available in the repository in the TileServer/tile_server directory. You may get a better answer for how to serve elevation data using NASA's server on the WorldWindCentral forums. 3.

The postgis mapnik plugin is not included in the Tiler distribution because we get unsatisfied depencency errors when trying to use it (we don't have postgis installed). The plugin is available in the .7z file here: http://sourceforge.net/projects/mapniknet/. Try copying the "mapnik_postgis.input" file into the Tiler/mapnik directory and try again.

— Reply to this email directly or view it on GitHubhttps://github.com/ga-m3dv/ga-worldwind-suite/issues/102#issuecomment-24555196 .

mdehoog commented 10 years ago

The path to the tiles directory is defined by the rootPath variable on line 537 of common.inc. Currently it is set up for our servers, where we have a dev environment ("sandpit") and a production environment. The two environment paths are set on lines 26 and 27. You replace these lines with a single variable pointing to your tile directory, and then modify lines 536 and 537 to point to your variable.

Here are some example URLs that work for our tilesets:

http://www.ga.gov.au/apps/world-wind/tiles.jsp?T=landcover/edition1/DLCM_RGB&L=0&X=8&Y=1&F=png http://www.ga.gov.au/apps/world-wind/elev.jsp?T=elevation/ausbath09_r3&L=0&X=13&Y=1&F=zip

The first is an imagery tile. The tileset is stored in the landcover/edition1/DLCM_RGB/ directory within the tile directory set above. The entire tileset can be zipped to save on copy time; the tile server will read the tiles directly out of the zip. To zip the example above, you would put the "0", "1", "2", etc level directories into a zip file called DLCM_RGB.zip in the landcover/edition1/ directory.

The second is a zipped elevation tile. Note the use of elev.jsp instead of tiles.jsp.

shyamnguitar commented 10 years ago

Thx Michael for such useful info. You are amazing.

But still am not able to get the TileServer working. I have attached the common.inc file.

Folder Structure is as follows

Apache Tomcat 8.0- I use startup.bat and shutdown.bat from here C:\Users\shyam\Downloads\apache-tomcat-8.0.0-RC1-windows-x86\apache-tomcat-8.0.0-RC1\bin In this directory I have my tiles.jsp,common.inc,elev.jsp* * C:\Users\shyam\Downloads\apache-tomcat-8.0.0-RC1-windows-x86\apache-tomcat-8.0.0-RC1\webapps\wwtileserver This is where am storing my tiles of two levels C:\Users\shyam\Downloads\apache-tomcat-8.0.0-RC1-windows-x86\apache-tomcat-8.0.0-RC1\webapps\wwtileserver\india_tiles Am checking all this on the same machine i.e. localhost. I have tried all the following URLs http://localhost:8080/webapps/wwtileserver/tiles.jsp? http://localhost:8080/webapps/wwtileserver/tiles.jsp?T=webapps/wwtileserver/india_tiles&L=2&F=jpg&X=744&Y=1188 ** Please help me as this would be a make or break situation for me

Regards,

and yes thank you again for the support

I have attached the common.inc file and the tileset am using. It would be great if you can suggest me the correct URL or any changes that I have to do in common.inc

On Wed, Sep 18, 2013 at 3:16 AM, Michael de Hoog notifications@github.comwrote:

The path to the tiles directory is defined by the rootPath variable on line 537 of common.inc. Currently it is set up for our servers, where we have a dev environment ("sandpit") and a production environment. The two environment paths are set on lines 26 and 27. You replace these lines with a single variable pointing to your tile directory, and then modify lines 536 and 537 to point to your variable.

Here are some example URLs that work for our tilesets:

http://www.ga.gov.au/apps/world-wind/tiles.jsp?T=landcover/edition1/DLCM_RGB&L=0&X=8&Y=1&F=png

http://www.ga.gov.au/apps/world-wind/elev.jsp?T=elevation/ausbath09_r3&L=0&X=13&Y=1&F=zip

The first is an imagery tile. The tileset is stored in the landcover/edition1/DLCM_RGB/ directory within the tile directory set above. The entire tileset can be zipped to save on copy time; the tile server will read the tiles directly out of the zip. To zip the example above, you would put the "0", "1", "2", etc level directories into a zip file called DLCM_RGB.zip in the landcover/edition1/ directory.

The second is a zipped elevation tile. Note the use of elev.jsp instead of tiles.jsp.

— Reply to this email directly or view it on GitHubhttps://github.com/ga-m3dv/ga-worldwind-suite/issues/102#issuecomment-24625248 .

mdehoog commented 10 years ago

Try the following:

Comment out the following lines:

Line 26: private static final String sandpitRootPath = "/web/html/test_root/docs/resources/images/world-wind/tiles-sandpit"; //sandpit Line 27: private static final String productionRootPath = "/public/http/www/docs/resources/images/world-wind/tiles"; //production Line 536: boolean sandpit = request.getServerPort() == 8500; Line 537: String rootPath = sandpit ? sandpitRootPath : productionRootPath;

Add the following on line 28: private static final String rootPath = "c:/<full path to webapps/wwtileserver where india_tiles directory is>";

Start Tomcat and try the following URL:

http://localhost:8080/webapps/wwtileserver/tiles.jsp?T=india_tiles&L=2&F=jpg&X=744&Y=1188

shyamnguitar commented 10 years ago

Hi Michael .

Thx for your time. I have tried the same. Every time my server is started it is fine. Enclosed is the server status window also. When i use the URL in browser it shows me error status 404. (enclosed)

On Thu, Sep 19, 2013 at 1:27 PM, Michael de Hoog notifications@github.comwrote:

Try the following:

Comment out the following lines:

Line 26: private static final String sandpitRootPath = "/web/html/test_root/docs/resources/images/world-wind/tiles-sandpit"; //sandpit Line 27: private static final String productionRootPath = "/public/http/www/docs/resources/images/world-wind/tiles"; //production Line 536: boolean sandpit = request.getServerPort() == 8500; Line 537: String rootPath = sandpit ? sandpitRootPath : productionRootPath;`

Add the following on line 28: private static final String rootPath = "c:/<full path to webapps/wwtileserver where india_tiles directory is>";

Start Tomcat and try the following URL:

http://localhost:8080/webapps/wwtileserver/tiles.jsp?T=india_tiles&L=2&F=jpg&X=744&Y=1188

— Reply to this email directly or view it on GitHubhttps://github.com/ga-m3dv/ga-worldwind-suite/issues/102#issuecomment-24722650 .

mdehoog commented 10 years ago

Please note that you cannot attach files to email replies to Github issues.

Try setting line 28: private static final String rootPath = "c:/Users/shyam/Downloads/apache-tomcat-8.0.0-RC1-windows-x86/apache-tomcat-8.0.0-RC1/webapps/wwtileserver";

And then try the following URL: http://localhost:8080/webapps/wwtileserver/tiles.jsp?T=india_tiles&L=2&F=jpg&X=744&Y=1188

This will download the following file: c:/Users/shyam/Downloads/apache-tomcat-8.0.0-RC1-windows-x86/apache-tomcat-8.0.0-RC1/webapps/wwtileserver/india_tiles/2/1188/1188_0744.jpg Please ensure this file exists, or change the URL to a file that does exist.

You can debug the tile server yourself by printing text to the response at various points in common.inc.

shyamnguitar commented 10 years ago

Michael Thanx a ton for your continuous support . Firstly sorry for sending attachments as I was unaware. Endeavor was to give you a complete picture.

As you said I have created a folder by name '2' and inside India_tiles and a '1188' folder inside this '2 folder and then a copied a jpg and renamed it to 1188_0744.jpg

wwtileserver\india_tiles\2\1188\1188_0744.jpg

After doing this I could actually display the PNG. Thanks for that tip.Congratulations to you you could actually make us see a ray of hope. Now how about other tiles. how would I display all of them.

But it has confused me more than before.

My intention to use tile server is that I setup a tile server on a machine and server multiple tiles(pngs created by Tiler) in one URL in Geoscience Australia(GA) Viewer.

  1. Is tile server only capable of serving only one PNG at a time? Or else it can display all the tiles that I have created at a time? If so like I have displayed one PNG on the browser. in the same way how can i display the tiles of the complete folder ? Should I follow some kind of naming convention to all the tiles? Or else should I change teh URL for displaying all the tiles?
  2. Can I use the same URL in GA Viewer and get the tiles of raster files(jpg/png) on the viewer canvas?

Regards Shyam

On Fri, Sep 20, 2013 at 6:19 AM, Michael de Hoog notifications@github.comwrote:

Please note that you cannot attach files to email replies to Github issues.

Try setting line 28: private static final String rootPath = "c:/Users/shyam/Downloads/apache-tomcat-8.0.0-RC1-windows-x86/apache-tomcat-8.0.0-RC1/webapps/wwtileserver"';

And then try the following URL:

http://localhost:8080/webapps/wwtileserver/tiles.jsp?T=india_tiles&L=2&F=jpg&X=744&Y=1188

This will download the following file:

c:/Users/shyam/Downloads/apache-tomcat-8.0.0-RC1-windows-x86/apache-tomcat-8.0.0-RC1/webapps/wwtileserver/india_tiles/2/1188/1188_0744.jpg Please ensure this file exists, or change the URL to a file that does exist.

You can debug the tile server yourself by printing text to the response at various points in common.inc.

— Reply to this email directly or view it on GitHubhttps://github.com/ga-m3dv/ga-worldwind-suite/issues/102#issuecomment-24783919 .

mdehoog commented 10 years ago

The Tiler will generate the folder structure compatible with the server. Here is an image which describes the structure: http://issues.worldwind.arc.nasa.gov/confluence/download/attachments/394/world+wind+tile+systemt.gif

Here is a description of the parameters accepted by the server:

I assume your india_tiles dataset was generated by the Tiler. Inside should be a collection of numbered folders (0 - ). Inside each level is the row folders. Inside each row folder is the row tiles for each column.

You don't need to rename files inside tile structure. You just need to make sure you're requesting a tile that exists, by choosing the correct values for the L/X/Y parameters.

See this page on our wiki for more information about creating Layer Definition Files: https://github.com/ga-m3dv/ga-worldwind-suite/wiki/TiledDataPrep.