Wednesday Aug 28, 2013

Potential memory usage issue when using the new MVDEMO data set

Just want to let people know that there is a memory usage issue when viewing the new MVDEMO data set at very detailed zoom levels.  As you probably have seen already the tile layer named 'demo_map' contains a raster layer that looks like the below screenshot:

mvdemo screenshot

The issue is that the base map 'demo_map' does not stop the display of this raster layer even for map scales that are way beyond the intrinsic resolution of the original raster. As a result, if you zoom in far enough, such as at zoom level 15 or beyond, the Java JAI library used for handling the raster image will cause OutOfMemory errors in the JVM and make MapViewer unresponsive. 

There is a very simple fix that involves running the following SQL statement in the database schema where the new MVDEMO data was imported:

[code] 

update user_sdo_maps
set definition=
'<?xml version="1.0" standalone="yes"?>
  <map_definition>
    <theme name="WORLD_RASTER" min_scale="1.5E18" max_scale="1000000.0" scale_mode="RATIO"/>
    <theme name="THEME_DEMO_STATES" min_scale="1.5E8" max_scale="0.0" scale_mode="RATIO"/>
    <theme name="THEME_DEMO_COUNTIES" min_scale="8500000.0" max_scale="0.0" scale_mode="RATIO"/>
    <theme name="THEME_DEMO_HIGHWAYS_LINE" min_scale="1.0E8" max_scale="4.5E7" scale_mode="RATIO"/>
    <theme name="THEME_DEMO_HIGHWAYS" min_scale="4.5E7" max_scale="0.0" scale_mode="RATIO"/>
    <theme name="THEME_DEMO_BIGCITIES" min_scale="4.5E7" max_scale="7500001.0" scale_mode="RATIO"/>
    <theme name="THEME_DEMO_CITIES" min_scale="7500000.0" max_scale="0.0" scale_mode="RATIO"/>
  </map_definition>'
  where name='DEMO_MAP';

commit; /

 [code]

 The above SQL changes the max_scale value for the raster layer in the basemap 'demo_map' (which the tile layer with the same name is based on).  Note that the other tile layer, 'world_map' already has the correct max_scale value for the raster theme. 

Remember to restart MapViewer or flush its cached metadata to pick up this new definition.

Thanks

LJ 

Tuesday Aug 20, 2013

Basic example of using GDAL/OGR with MapViewer

This is a quick example of using gdal/ogr to access 3rd party spatial data formats in MapViewer. Specifically a MapInfo mid/mif and TAB files using the builtin ogrSDP (ogr spatial data provider class) to define and access a custom geometry theme.

First, download and install GDAL. I used the prebuilt binaries for version 1.9.2 for 64-bit Windows.

The precompiled supported formats list includes ESRI and MapInfo files
C:\Program Files\GDAL>ogrinfo --formats
Supported Formats:
  -> "ESRI Shapefile" (read/write)
  -> "MapInfo File" (read/write)
...

Then copy the gdal.jar file in the GDAL/Java directory over to someplace where it is in the classpath for MapViewer and MapBuilder. I copied it to the WEB-INF/lib directory for MapViewer and the directory which has MapBuilder.

Start up MapBuilder with gdal in the classpath and define custom geometry themes, i.e. use something like the following command to start it.
java -Xmx512M -cp .\mapbuilder.jar;.\gdal.jar oracle.mapviewer.builder.MapBuilder

Then define Custom Geometry Theme(s) using the ogrSDP. The following screenshots show the definition of a VICTORIA_TAB (tab file format) and MAPINFO_EXAMPLE (mid/mif format)  of postcode boundaries for someplace in Victoria, AU in the VicGrid94 spatial reference system. The corresponding SDO srid is 82473.

Once these are defined they can used as predefined themes in MapViewer. This assumes the files are accessible by the MapViewer server and the gdal.jar file is in the lib directory or in the classpath for that MapViewer server.

To test it, I modified the C00 - Display a predefined vector layer sample to use a different tile and vector layer. That is, the following lines of the sample code were changed to use the MAPINFO_EXAMPLE theme instead of "customers"
        var tileLayer = new OM.layer.TileLayer(
        "baseMap",
        {
            dataSource:"mvdemo",
            tileLayer:"elocation_map",
            tileServerURL: baseURL+"/mcserver"
        });
        map.addLayer(tileLayer) ;
        layer = new OM.layer.VectorLayer("layer1",
        {
            def:{
                type:OM.layer.VectorLayer.TYPE_PREDEFINED,
                dataSource:"mvdemo2", theme:"MAPINFO_EXAMPLE",
                url: baseURL
            }
        }); 
Re-running the modified sample gives the result shown in the screenshot below.







About

Official blog for Oracle FMW MapViewer and related products.

Search

Categories
Archives
« August 2013 »
SunMonTueWedThuFriSat
    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
21
22
23
24
25
26
27
29
30
31
       
Today