Mapviewer - SH Customer Density Semi-Static Map

Prerequisites

You must have the sh schema and the spatial demo files installed.

You can also do it with your own map : MapBuilder - Import of a Shapefile Map

Articles Related

Create the spatial data

As sys :

GRANT SELECT ANY TABLE TO MVDEMO;

As mvdemo :

CREATE TABLE t_sh_customer_density AS (
SELECT STATE_ABRV, 
(
SELECT count(DISTINCT T245.CUST_ID)
FROM 
     SH.COUNTRIES T175,
     SH.CUSTOMERS T186,
     SH.SALES T245
WHERE  
  T175.COUNTRY_ID = T186.COUNTRY_ID 
  AND T175.COUNTRY_NAME = 'United States of America' 
  AND T186.CUST_ID = T245.CUST_ID
  AND state_abrv = T186.CUST_STATE_PROVINCE
) CountCustomers, 
geom  
FROM
mvdemo.states
)
INSERT INTO USER_SDO_GEOM_METADATA VALUES (
    'sh_customer_density', 
    'GEOM', 
        MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X', -180, 180, .00000005), 
                            MDSYS.SDO_DIM_ELEMENT('Y', -90, 90, .00000005)),
        8307);
 
CREATE INDEX t_sh_customer_density_SDX ON t_sh_customer_density(GEOM)
indextype IS mdsys.spatial_index;

Create the Bucket Style

Create the theme

Set the attributes of theme

With Oracle Maps, labels are manifest as tool-tips on mouse-over the feature on the map.

Preview of the theme

cx : -96.554346 cy : 38.987208 height : 42.081234

Create the base map

Create the Map Tile Layer

Location :

  • In Map Builder / node Tile Layers
  • In MapViewer : Admin (Type the oc4j admin credentials) / Management / Manage Map Tile Layers / Create

Zoom Level Definition :

Level Scale Tile width
0 1.5E8 91.71616894864779

To know more about how to define the zoom level : Point Center and Zoom Level Definition

Show the map in a web page

The tutorial is provided with the installation of MapViewer on this url :

<script language=javascript>
  function showMap()
  {	
    var baseURL  = "http://"+document.location.host+"/mapviewer";
    var mapCenterLon =  -96.554346;
    var mapCenterLat =  38.987208;
    var mapZoom      =  0;
    var mpoint = MVSdoGeometry.createPoint(mapCenterLon,mapCenterLat,8307);
    var mapview = new MVMapView(document.getElementById("map"), baseURL);
    mapview.addMapTileLayer(new MVMapTileLayer("mvdemo.SH_CUST_DENSITY_MAP")); 
    mapview.setCenter(mpoint); 
    mapview.setZoomLevel(mapZoom);    
    mapview.display();  			
  }
</script>

Support

See this article on how to retrieve debug information : Mapviewer debugging - log

interface not supported without a spatial index

You have forgotten to create the spatial index.

 
Message:Exception while querying theme: THEME_SH_CUST_DENSITY
Description: Nested exception is:
java.sql.SQLException: ORA-13226: interface not supported without a spatial index
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 8
ORA-06512: at "MDSYS.SDO_3GL", line 1173
  • Bookmark "Mapviewer - SH Customer Density Semi-Static Map" at del.icio.us
  • Bookmark "Mapviewer - SH Customer Density Semi-Static Map" at Digg
  • Bookmark "Mapviewer - SH Customer Density Semi-Static Map" at Ask
  • Bookmark "Mapviewer - SH Customer Density Semi-Static Map" at Google
  • Bookmark "Mapviewer - SH Customer Density Semi-Static Map" at StumbleUpon
  • Bookmark "Mapviewer - SH Customer Density Semi-Static Map" at Technorati
  • Bookmark "Mapviewer - SH Customer Density Semi-Static Map" at Live Bookmarks
  • Bookmark "Mapviewer - SH Customer Density Semi-Static Map" at Yahoo! Myweb
  • Bookmark "Mapviewer - SH Customer Density Semi-Static Map" at Facebook
  • Bookmark "Mapviewer - SH Customer Density Semi-Static Map" at Yahoo! Bookmarks
  • Bookmark "Mapviewer - SH Customer Density Semi-Static Map" at Twitter
  • Bookmark "Mapviewer - SH Customer Density Semi-Static Map" at myAOL
 
mapviewer/map_customer_sh_density.txt · Last modified: 2011/05/15 20:51 by gerardnico